]> git.donarmstrong.com Git - dsa-puppet.git/blobdiff - 3rdparty/modules/sysctl/manifests/value.pp
try again, with puppetforge modules, correctly included now
[dsa-puppet.git] / 3rdparty / modules / sysctl / manifests / value.pp
diff --git a/3rdparty/modules/sysctl/manifests/value.pp b/3rdparty/modules/sysctl/manifests/value.pp
new file mode 100644 (file)
index 0000000..cb57f14
--- /dev/null
@@ -0,0 +1,28 @@
+# Manage sysctl value
+#
+# It not only manages the entry within
+# /etc/sysctl.conf, but also checks the
+# current active version.
+#
+# Parameters
+#
+# * value: to set.
+# * key Key to set, default: $name
+# * target: an alternative target for your sysctl values.
+define sysctl::value (
+  $value,
+  $key    = $name,
+  $target = undef,
+) {
+  require sysctl::base
+  $val1 = inline_template("<%= String(@value).split(/[\s\t]/).reject(&:empty?).flatten.join(\"\t\") %>")
+
+  sysctl { $key :
+    val    => $val1,
+    target => $target,
+    before => Sysctl_runtime[$key],
+  }
+  sysctl_runtime { $key:
+    val => $val1,
+  }
+}