]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Making fstab and crypttab management optional
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 17:49:41 +0000 (15:49 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 24 Jan 2013 17:49:41 +0000 (15:49 -0200)
manifests/desktop.pp
manifests/laptop.pp
manifests/subsystems/crypttab.pp
manifests/subsystems/fstab.pp

index 6b3a7247fa2960c1fd86c96a83a453a39070fe9c..3cbe00162fed235530343bd806ee227da2342382 100644 (file)
@@ -1,24 +1,16 @@
 class nodo::desktop inherits nodo::personal {
   include utils::desktop
 
-  # fstab
-  if $fstab != false {
-    class { 'fstab':
-      type => 'desktop',
-    }
+  class { 'fstab':
+    type => 'desktop',
   }
 
-  # crypttab
-  if $crypttab != false {
-    class { 'crypttab':
-      type => 'desktop',
-    }
+  class { 'crypttab':
+    type => 'desktop',
   }
 }
 
 class nodo::desktop::minimal {
-  $fstab    = false
-  $crypttab = false
   $pam      = false
 
   # Backups should happen when the box is likely to be online
index 93376d6899b1a250b17514df0cdbe164a0a4cab6..f184801e1d138ec3a5980430008c3be0481e8d2c 100644 (file)
@@ -7,21 +7,15 @@ class nodo::laptop inherits nodo::personal {
   include firewall::ppp
   include dhclient
 
-  # fstab
-  if $fstab != false {
-    class { 'fstab':
-      type => 'laptop',
-    }
+  class { 'fstab':
+    type => 'laptop',
   }
 
-  # crypttab
-  if $crypttab != false {
-    class { 'crypttab':
-      type => $hibernate ? {
-        false   => "laptop",
-        default => "laptop.hibernate",
-      },
-    }
+  class { 'crypttab':
+    type => $hibernate ? {
+      false   => "laptop",
+      default => "laptop.hibernate",
+    },
   }
 
   # hibernation
index 64470052b48e30fcb379060b644cafd40c761680..0a9a4d153f5343d53cb1b6c8bf37218aa1d63781 100644 (file)
@@ -1,12 +1,15 @@
 class crypttab(
-  $type
+  $type,
+  $manage = hiera('nodo::crypttab::manage', false)
 ) {
-  file { "/etc/crypttab":
-    source  => "puppet:///modules/nodo/etc/crypttab/${type}",
-    owner   => "root",
-    group   => "root",
-    mode    => 0644,
-    ensure  => present,
-    notify  => Exec['update-initramfs'],
+  if $manage == true {
+    file { "/etc/crypttab":
+      source  => "puppet:///modules/nodo/etc/crypttab/${type}",
+      owner   => "root",
+      group   => "root",
+      mode    => 0644,
+      ensure  => present,
+      notify  => Exec['update-initramfs'],
+    }
   }
 }
index 40c8c30d8c3c6d69f79f15e0da1c9d6199604241..c6f2ecd7be0e632779357ff9e876b1da491aff8a 100644 (file)
@@ -1,12 +1,15 @@
 class fstab(
-  $type
+  $type,
+  $manage = hiera('nodo::fstab::manage', false)
 ) {
-  file { "/etc/fstab":
-    source  => "puppet:///modules/nodo/etc/fstab/${type}",
-    owner   => "root",
-    group   => "root",
-    mode    => 0644,
-    ensure  => present,
-    notify  => Exec['update-initramfs'],
+  if $manage == true {
+    file { "/etc/fstab":
+      source  => "puppet:///modules/nodo/etc/fstab/${type}",
+      owner   => "root",
+      group   => "root",
+      mode    => 0644,
+      ensure  => present,
+      notify  => Exec['update-initramfs'],
+    }
   }
 }