summaryrefslogtreecommitdiff
path: root/puppet/modules/sysctl/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/modules/sysctl/manifests')
m---------puppet/modules/sysctl0
-rw-r--r--puppet/modules/sysctl/manifests/config.pp18
-rw-r--r--puppet/modules/sysctl/manifests/init.pp10
3 files changed, 28 insertions, 0 deletions
diff --git a/puppet/modules/sysctl b/puppet/modules/sysctl
deleted file mode 160000
-Subproject 975852b7acc1125b4cd9d4d490b9abd8d31217e
diff --git a/puppet/modules/sysctl/manifests/config.pp b/puppet/modules/sysctl/manifests/config.pp
new file mode 100644
index 00000000..79ddd295
--- /dev/null
+++ b/puppet/modules/sysctl/manifests/config.pp
@@ -0,0 +1,18 @@
+define sysctl::config ($value, $comment) {
+
+ include sysctl
+
+ augeas { "sysctl_${name}":
+ context => '/files/etc/sysctl.conf',
+ changes => [ "set ${name} ${value}", "insert #comment before ${name}",
+ "set #comment[last()] '${comment}'" ],
+ onlyif => "get ${name} != ${value}",
+ notify => Exec["sysctl_${name}"],
+ }
+
+ exec { "sysctl_${name}":
+ command => '/sbin/sysctl -p',
+ subscribe => File['/etc/sysctl.conf'],
+ refreshonly => true,
+ }
+}
diff --git a/puppet/modules/sysctl/manifests/init.pp b/puppet/modules/sysctl/manifests/init.pp
new file mode 100644
index 00000000..43d9299e
--- /dev/null
+++ b/puppet/modules/sysctl/manifests/init.pp
@@ -0,0 +1,10 @@
+class sysctl {
+
+ file { '/etc/sysctl.conf':
+ ensure => present,
+ mode => '0644',
+ owner => root,
+ group => root
+ }
+}
+