summaryrefslogtreecommitdiff
path: root/puppet/modules/sysctl
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2016-11-04 10:54:28 -0400
committerMicah Anderson <micah@riseup.net>2016-11-04 10:54:28 -0400
commit34a381efa8f6295080c843f86bfa07d4e41056af (patch)
tree9282cf5d4c876688602705a7fa0002bc4a810bde /puppet/modules/sysctl
parent0a72bc6fd292bf9367b314fcb0347c4d35042f16 (diff)
parent5821964ff7e16ca7aa9141bd09a77d355db492a9 (diff)
Merge branch 'develop'
Diffstat (limited to 'puppet/modules/sysctl')
m---------puppet/modules/sysctl0
-rw-r--r--puppet/modules/sysctl/.gitrepo11
-rw-r--r--puppet/modules/sysctl/README20
-rw-r--r--puppet/modules/sysctl/manifests/config.pp18
-rw-r--r--puppet/modules/sysctl/manifests/init.pp10
5 files changed, 59 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/.gitrepo b/puppet/modules/sysctl/.gitrepo
new file mode 100644
index 00000000..a6d7f8fe
--- /dev/null
+++ b/puppet/modules/sysctl/.gitrepo
@@ -0,0 +1,11 @@
+; DO NOT EDIT (unless you know what you are doing)
+;
+; This subdirectory is a git "subrepo", and this file is maintained by the
+; git-subrepo command. See https://github.com/git-commands/git-subrepo#readme
+;
+[subrepo]
+ remote = https://leap.se/git/puppet_sysctl
+ branch = master
+ commit = 975852b7acc1125b4cd9d4d490b9abd8d31217e6
+ parent = 6a895ece94a86c9ccc32c9bec51413d4e4f0df8e
+ cmdver = 0.3.0
diff --git a/puppet/modules/sysctl/README b/puppet/modules/sysctl/README
new file mode 100644
index 00000000..a3980f70
--- /dev/null
+++ b/puppet/modules/sysctl/README
@@ -0,0 +1,20 @@
+sysctl module
+-------------
+
+This puppet module handles the setting of variables in sysctl.conf, its
+a simple module that utilizes the puppet augeas built-in type and the
+sysctl binary. You must have the augeas ruby libraries installed to
+use this type.
+
+You can set a value and a comment for that value using this module,
+some examples:
+
+sysctl::config { "vm.mmap_min_addr":
+ value => 32768,
+ comment => "Never mmap into the first 32k of memory",
+}
+
+sysctl::config { "fs.file-max":
+ value => 65536,
+ comment => "Maximum number of filehandles",
+}
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
+ }
+}
+