From: Stephen Gran Date: Thu, 5 Apr 2012 14:00:19 +0000 (+0100) Subject: guard against accidentally doing something X-Git-Url: https://git.adam-barratt.org.uk/?a=commitdiff_plain;h=5c3ced682c222d6dca1882b1c07eefc08f2d249b;p=mirror%2Fdsa-puppet.git guard against accidentally doing something Signed-off-by: Stephen Gran --- diff --git a/modules/site/manifests/linux_module.pp b/modules/site/manifests/linux_module.pp index 62b2197a4..8a81c6c0e 100644 --- a/modules/site/manifests/linux_module.pp +++ b/modules/site/manifests/linux_module.pp @@ -1,19 +1,21 @@ define site::linux_module ($ensure = present) { - case $ensure { - present: { - exec { "append_module_${name}": - command => "echo '${name}' >> /etc/modules", - unless => "grep -q -F -x '${name}' /etc/modules", + if $::kernel == linux { + case $ensure { + present: { + exec { "append_module_${name}": + command => "echo '${name}' >> /etc/modules", + unless => "grep -q -F -x '${name}' /etc/modules", + } } - } - absent: { - exec { "remove_module_${name}": - command => "sed -i -e'/^${name}\$/d' /etc/modules", - onlyif => "grep -q -F -x '${name}' /etc/modules", + absent: { + exec { "remove_module_${name}": + command => "sed -i -e'/^${name}\$/d' /etc/modules", + onlyif => "grep -q -F -x '${name}' /etc/modules", + } + } + default: { + err("invalid ensure value ${ensure}") } - } - default: { - err("invalid ensure value ${ensure}") } } }