Commit a2dd755c authored by Baptiste Jonglez's avatar Baptiste Jonglez

[big] [puppet] Refactor linux-headers installation between nvidia and beegfs

This should be used for any software that builds kernel modules, so that
it pulls the correct version of linux-headers.
parent 43f5d137
......@@ -2,6 +2,8 @@ class env::big::configure_nvidia_gpu::drivers () {
### This class exists for gpuclus cluster, that require a recent version of nvidia driver
include env::big::prepare_kernel_module_build
case "$env::deb_arch" {
"amd64": {
$driver_source = 'http://packages.grid5000.fr/other/nvidia/NVIDIA-Linux-x86_64-450.80.02.run'
......@@ -14,25 +16,16 @@ class env::big::configure_nvidia_gpu::drivers () {
}
}
package {
['module-assistant', 'dkms']:
ensure => installed;
}
exec{
'retrieve_nvidia_drivers':
command => "/usr/bin/wget -q $driver_source -O /tmp/NVIDIA-Linux.run; chmod u+x /tmp/NVIDIA-Linux.run",
timeout => 1200, # 20 min
creates => "/tmp/NVIDIA-Linux.run";
'prepare_kernel_module_build':
command => "/usr/bin/m-a prepare -i -l ${installed_kernelreleases[-1]}",
user => root,
require => Package['module-assistant'];
'install_nvidia_driver':
command => "/tmp/NVIDIA-Linux.run -qa --no-cc-version-check --ui=none --dkms -k ${installed_kernelreleases[-1]}",
timeout => 1200, # 20 min,
user => root,
require => [Exec['prepare_kernel_module_build'], File['/tmp/NVIDIA-Linux.run'], Package['dkms']];
require => [Exec['prepare_kernel_module_build'], File['/tmp/NVIDIA-Linux.run']];
'cleanup_nvidia':
command => "/bin/rm /tmp/NVIDIA-Linux.run",
user => root,
......
......@@ -39,6 +39,8 @@ class env::big::install_beegfs {
"buster" : {
include env::big::prepare_kernel_module_build
apt::source { 'beegfs':
location => 'https://www.beegfs.com/release/beegfs_7_1/',
release => 'stretch', #FIXME : change release to buster when beegfs release it
......@@ -50,7 +52,7 @@ class env::big::install_beegfs {
},
}
-> package { # client
[ 'beegfs-utils', 'beegfs-helperd', 'beegfs-client', 'linux-headers-amd64', 'libbeegfs-ib' ]:
[ 'beegfs-utils', 'beegfs-helperd', 'beegfs-client', 'libbeegfs-ib' ]:
require => Class['apt::update'],
ensure => installed;
}
......@@ -66,7 +68,8 @@ class env::big::install_beegfs {
-> exec {
'/etc/init.d/beegfs-client rebuild':
timeout => 1200,
refreshonly => true
refreshonly => true,
require => Exec['prepare_kernel_module_build']
}
}
}
......
class env::big::prepare_kernel_module_build {
# Prepare everything needed to build a custom kernel module.
# Installs kernel headers for the latest available kernel, which can be different
# from the running kernel.
package {
['module-assistant', 'dkms']:
ensure => installed;
}
exec {
'prepare_kernel_module_build':
command => "/usr/bin/m-a prepare -i -l ${installed_kernelreleases[-1]}",
user => root,
require => Package['module-assistant'];
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment