]> gitweb.fluxo.info Git - puppet-nodo.git/commitdiff
Adding hibernation support for laptops
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 22 Sep 2011 13:39:11 +0000 (10:39 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 22 Sep 2011 13:39:11 +0000 (10:39 -0300)
files/etc/crypttab/laptop.hibernate [new file with mode: 0644]
manifests/laptop.pp
manifests/subsystems/utils/laptop.pp

diff --git a/files/etc/crypttab/laptop.hibernate b/files/etc/crypttab/laptop.hibernate
new file mode 100644 (file)
index 0000000..ab8a8e2
--- /dev/null
@@ -0,0 +1,5 @@
+# <target name> <source device>          <key file>      <options>
+root            /dev/mapper/vg-root      none            luks,cipher=aes-cbc-essiv:sha256
+home            /dev/mapper/vg-home      none            luks,cipher=aes-cbc-essiv:sha256
+var             /dev/mapper/vg-var       none            luks,cipher=aes-cbc-essiv:sha256
+cswap           /dev/sda1                none            swap,cipher=aes-cbc-essiv:sha256
index db355c0d19b0e5d0157522aafaea8b6607a288c9..38f235d51962e497f72e88e0dd7e4a959f4d1b5c 100644 (file)
@@ -20,7 +20,10 @@ class nodo::laptop inherits nodo::personal {
   # crypttab
   if $crypttab != false {
     file { "/etc/crypttab":
-      source  => "puppet://$server/modules/nodo/etc/crypttab/laptop",
+      source  => $hibernate ? {
+        false   => "puppet://$server/modules/nodo/etc/crypttab/laptop",
+        default => "puppet://$server/modules/nodo/etc/crypttab/laptop.hibernate",
+      },
       owner   => "root",
       group   => "root",
       mode    => 0644,
index e1022a51b6893343c72eecdc32777e8ed63b1a55..5ae29d66269c2159e969c7dda08961a5053e83cc 100644 (file)
@@ -16,8 +16,13 @@ class utils::laptop {
     }
   }
 
-  # Currently no hibernation
-  package { 'uswsusp':
-    ensure => absent,
+  # Hibernation on lenny
+  if $lsbdistcodename == 'lenny' {
+    package { 'uswsusp':
+      ensure => $hibernate ? {
+        false   => absent,
+        default => present,
+      },
+    }
   }
 }