Added mount point adjustments.
authorAndreas Schiermeier <as@ccc504j.site>
Mon, 16 Mar 2015 21:57:18 +0000 (22:57 +0100)
committerAndreas Schiermeier <as@ccc504j.site>
Mon, 16 Mar 2015 21:57:18 +0000 (22:57 +0100)
modules/common/manifests/init.pp

index 4f0c789..591a5db 100644 (file)
@@ -9,6 +9,27 @@ class common {
   
 # apt-dater ALL=NOPASSWD: /usr/bin/apt-get
 
+  define set_mountpoint_option($mount, $option) {
+    augeas{ "fstab-$mount-$option":
+      context => "/files/etc/fstab/*[file = '$mount'][count(opt[. = '$option']) = 0]",
+      changes => [
+        "ins opt after opt[last()]",
+        "set opt[last()] $option",
+        ],
+      onlyif => "match /files/etc/fstab/*[file = '$mount'][count(opt[. = '$option']) = 0] size > 0",
+    }
+  }
+  
+  set_mountpoint_option { '/usr-nodev':
+    mount => '/usr',
+    option => 'nodev',
+  }
+
+  set_mountpoint_option { '/var-nodev':
+    mount => '/var',
+    option => 'nosuid',
+  }
+  
   $packages = [ 'git-core',
                 'puppet',
                 'sudo',