summaryrefslogtreecommitdiff
path: root/puppet/modules/sysctl/manifests
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-06-09 17:34:39 +0200
committervarac <varacanero@zeromail.org>2016-06-14 12:05:18 +0200
commitc429f55ef10f3c757189bdab9823c0b74d81fb00 (patch)
tree42d550f747b77dd21e0d62a864776a6dd6064a1d /puppet/modules/sysctl/manifests
parentd2c8498b41bebc6a06216515b3cf75564b8fb61a (diff)
git subrepo clone https://leap.se/git/puppet_sysctl puppet/modules/sysctl
subrepo: subdir: "puppet/modules/sysctl" merged: "975852b" upstream: origin: "https://leap.se/git/puppet_sysctl" branch: "master" commit: "975852b" git-subrepo: version: "0.3.0" origin: "https://github.com/ingydotnet/git-subrepo.git" commit: "cb2995b"
Diffstat (limited to 'puppet/modules/sysctl/manifests')
-rw-r--r--puppet/modules/sysctl/manifests/config.pp18
-rw-r--r--puppet/modules/sysctl/manifests/init.pp10
2 files changed, 28 insertions, 0 deletions
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
+ }
+}
+