aboutsummaryrefslogtreecommitdiff
path: root/manifests/defines/sysctl.pp
diff options
context:
space:
mode:
Diffstat (limited to 'manifests/defines/sysctl.pp')
-rw-r--r--manifests/defines/sysctl.pp19
1 files changed, 19 insertions, 0 deletions
diff --git a/manifests/defines/sysctl.pp b/manifests/defines/sysctl.pp
new file mode 100644
index 0000000..06f6a14
--- /dev/null
+++ b/manifests/defines/sysctl.pp
@@ -0,0 +1,19 @@
+# Simple sysctl definition
+define sysctl(
+ $ensure = present,
+ $value
+) {
+ file { "/etc/sysctl.d/${name}.conf":
+ owner => "root",
+ group => "root",
+ mode => 0644,
+ ensure => $ensure,
+ content => "$name = $value\n",
+ }
+
+ exec { "sysctl ${name}=${value}":
+ user => root,
+ subscribe => File["/etc/sysctl.d/${name}.conf"],
+ refreshonly => true,
+ }
+}