From: Silvio Rhatto Date: Thu, 22 Sep 2011 13:39:11 +0000 (-0300) Subject: Adding hibernation support for laptops X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=f55276477c27770af28e53bb8d4c8f9447993f05;p=puppet-nodo.git Adding hibernation support for laptops --- diff --git a/files/etc/crypttab/laptop.hibernate b/files/etc/crypttab/laptop.hibernate new file mode 100644 index 0000000..ab8a8e2 --- /dev/null +++ b/files/etc/crypttab/laptop.hibernate @@ -0,0 +1,5 @@ +# +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 diff --git a/manifests/laptop.pp b/manifests/laptop.pp index db355c0..38f235d 100644 --- a/manifests/laptop.pp +++ b/manifests/laptop.pp @@ -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, diff --git a/manifests/subsystems/utils/laptop.pp b/manifests/subsystems/utils/laptop.pp index e1022a5..5ae29d6 100644 --- a/manifests/subsystems/utils/laptop.pp +++ b/manifests/subsystems/utils/laptop.pp @@ -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, + }, + } } }