diff options
author | Micah <micah@leap.se> | 2016-07-12 16:46:31 -0400 |
---|---|---|
committer | Micah <micah@leap.se> | 2016-07-12 16:46:31 -0400 |
commit | a75fea409bf8e62e55ba341672c202aab5fa480e (patch) | |
tree | 829b97fbc74703d4301bfcfa658cb1cae329eba8 /puppet/modules/sysctl/manifests | |
parent | 6a895ece94a86c9ccc32c9bec51413d4e4f0df8e (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"
commit: "1e79595"
Change-Id: Ica1925ea414df32850d0358ae17d6c704ae6fa7d
Diffstat (limited to 'puppet/modules/sysctl/manifests')
-rw-r--r-- | puppet/modules/sysctl/manifests/config.pp | 18 | ||||
-rw-r--r-- | puppet/modules/sysctl/manifests/init.pp | 10 |
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 + } +} + |