Commit 3ce7f652 authored by mh's avatar mh
Browse files

make it work on EL systems

parent 55ab5146
......@@ -22,6 +22,8 @@ class modprobe {
"puppet:///modules/modprobe/${::operatingsystem}/modprobe.conf",
"puppet:///modules/modprobe/modprobe.conf",
],
owner => root, group => 0, mode => 0644;
owner => root,
group => 0,
mode => '0644';
}
}
define modprobe::kern_module(
$ensure = 'present'
){
file_line{"module_${name}":
line => $::operatingsystem ? {
debian => $name,
ubuntu => $name,
if ($osfamily != 'RedHat') or versioncmp($operatingsystemmajrelease,'7') < 0 {
$line = $::operatingsystem ? {
/(Debian|Ubuntu)/ => $name,
default => "/sbin/modprobe $name"
},
path => $::operatingsystem ? {
debian => '/etc/modules',
ubuntu => '/etc/modules',
default => '/etc/rc.modules'
},
ensure => $ensure,
}
$path = $::operatingsystem ? {
/(Debian|Ubuntu)/ => '/etc/modules',
ubuntu => '/etc/modules',
default => '/etc/rc.modules'
}
file_line{"module_${name}":
line => $line,
path => $path,
ensure => $ensure,
}
} else {
file{"/etc/modules-load.d/${name}.conf":
content => "# managed by puppet\n${name}\n",
owner => root,
group => 0,
mode => '0644',
}
}
case $ensure {
present: {
......
class modprobe::module::fuse {
package{'fuse-utils':
ensure => present,
if $osfamily == 'RedHat' {
$pkg_name = 'fuse'
} else {
$pkg_name = 'fuse-utils'
}
modprobe::kern_module{'fuse':
package{$pkg_name:
ensure => present,
} -> modprobe::kern_module{'fuse':
ensure => present,
}
}
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