projects
/
mirror
/
dsa-puppet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
54eb9ac
)
Try adding a linux_module function
author
Peter Palfrader
<peter@palfrader.org>
Sat, 19 Mar 2011 15:07:30 +0000
(16:07 +0100)
committer
Peter Palfrader
<peter@palfrader.org>
Sat, 19 Mar 2011 15:07:30 +0000
(16:07 +0100)
modules/debian-org/manifests/init.pp
patch
|
blob
|
history
diff --git
a/modules/debian-org/manifests/init.pp
b/modules/debian-org/manifests/init.pp
index
1e23846
..
75bb70d
100644
(file)
--- a/
modules/debian-org/manifests/init.pp
+++ b/
modules/debian-org/manifests/init.pp
@@
-17,6
+17,26
@@
define set_alternatives($linkto) {
}
}
+define linux_module ($ensure) {
+ 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",
+ }
+ }
+ default: {
+ err("invalid ensure value ${ensure}")
+ }
+ }
+}
+
class debian-org {
package {