Closed BEfelipe closed 4 years ago
second this CentOS7.7
Building the main VirtualBox module. Error building the module: /tmp/vbox.0/Makefile-header.gmk:100: *** The variable KERN_DIR must be a kernel build folder and end with /build without a trailing slash, or KERN_VER must be set. Stop.
I would suggest this code:
exec { 'vboxdrv'
unless => '/sbin/lsmod | grep vboxdrv',
command => "${vboxdrv_command} setup",
environment => [ "KERN_DIR=/lib/modules/${kernelrelease}/build" ],
require => Package[$vboxdrv_dependencies],
}
Thanks! Could you please provide a pull request.
https://github.com/voxpupuli/puppet-virtualbox/blob/8b9c47037fd8c41e96b91d5ab29c6b7c47db9036/manifests/kernel.pp#L18
if puppet is called from a bootstrapping process /usr/bin may not be in the PATH by default, this will cause setup to fail
LOG
please fully qualify the path for this or add all paths to exec resource.