diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d0d5b6..8af513a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,4 +7,4 @@ ##### Changes * Install package ipmitool - +* Ensure needed modules load at boot time diff --git a/manifests/config.pp b/manifests/config.pp new file mode 100644 index 0000000..db9bc37 --- /dev/null +++ b/manifests/config.pp @@ -0,0 +1,29 @@ +# == Class: ipmi::config +# +# Some tiny configurations for IPMI +# +class ipmi::config { + + File { + owner => root, + group => root, + mode => 0644, + } + + ## Modules + # Directory which contains kernel modules to load during boot time + if ! defined(File['/etc/modules-load.d']) { + file { '/etc/modules-load.d': + ensure => directory, + } + } + # Additionnal modules to load at boot time + file { "${ipmi::modules_file_path}": + ensure => 'present', + content => template("${ipmi::modules_file_content}"), + require => File['/etc/modules-load.d'], + } + + + +} # Private class: ipmi::config diff --git a/manifests/init.pp b/manifests/init.pp index 1cc7212..ed0203d 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -38,10 +38,15 @@ class ipmi ( $pkg_ensure = $ipmi::params::pkg_ensure, $pkg_name = $ipmi::params::pkg_name, + $modules_list = $ipmi::params::modules_list, + $modules_file_path = $ipmi::params::modules_file_path, + $modules_file_content = $ipmi::params::modules_file_content, ) inherits ipmi::params { include '::ipmi::install' + include '::ipmi::config' - #Class['ipmi::install'] -> + Class['ipmi::install'] -> + Class['ipmi::config'] } # Public class: ipmi diff --git a/manifests/params.pp b/manifests/params.pp index 8044e6e..0d94819 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -8,6 +8,10 @@ class ipmi::params { $pkg_ensure = 'present' $pkg_name = [ 'ipmitool' ] + # Modules + $modules_list = [ 'ipmi_devintf', 'ipmi_si', 'ipmi_msghandler' ] + $modules_file_path = '/etc/modules-load.d/ipmi.conf' + $modules_file_content = 'ipmi/ipmi_modules.conf.erb' } } diff --git a/templates/ipmi_modules.conf.erb b/templates/ipmi_modules.conf.erb new file mode 100644 index 0000000..1ea740f --- /dev/null +++ b/templates/ipmi_modules.conf.erb @@ -0,0 +1,8 @@ +#file generated by puppet +#Don't edit, please see https://forge.puppetlabs.com/gardouille/proxmox + +## Load additonnal modules for IPMI +<% @modules_list.each do |val| -%> +<%= val %> +<% end -%> +