Skip to content

Instantly share code, notes, and snippets.

@rjsalts
Created August 26, 2014 08:04
Show Gist options
  • Save rjsalts/1ce9628fc4e18edd867d to your computer and use it in GitHub Desktop.
Save rjsalts/1ce9628fc4e18edd867d to your computer and use it in GitHub Desktop.
define loadkmod {
exec { "modprobe_$name":
command => "/sbin/modprobe ${name}",
unless => "/bin/grep \"^${name} \" /proc/modules",
}
exec { "add_${name}_to_etc_modules" :
command => "/bin/bash -c 'echo $name >> /etc/modules'",
unless => "/bin/grep ^${name} /etc/modules",
}
}
class loadmodule {
$kmod = [ "ip_vs", "xfs" ]
loadkmod { $kmod: }
}
class loadmodule2 {
$kmod = [ "ip_vs", "ntfs" ]
loadkmod { $kmod: }
}
include loadmodule
include loadmodule2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment