diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2013-01-22 12:56:24 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2013-01-22 12:56:24 -0200 |
commit | 616d2575015a57407cd0a930b8cd16b0b29aecb6 (patch) | |
tree | c19024bf97fd737511a22acd0029fc48cff905c1 /manifests | |
parent | fb6d9071efc4ebc47d34ed0ab263e55d5ed143a6 (diff) | |
download | puppet-nodo-616d2575015a57407cd0a930b8cd16b0b29aecb6.tar.gz puppet-nodo-616d2575015a57407cd0a930b8cd16b0b29aecb6.tar.bz2 |
Adding fstab and crypttab classes
Diffstat (limited to 'manifests')
-rw-r--r-- | manifests/appliance.pp | 18 | ||||
-rw-r--r-- | manifests/desktop.pp | 18 | ||||
-rw-r--r-- | manifests/init.pp | 2 | ||||
-rw-r--r-- | manifests/kvm.pp | 18 | ||||
-rw-r--r-- | manifests/laptop.pp | 39 | ||||
-rw-r--r-- | manifests/removable.pp | 4 | ||||
-rw-r--r-- | manifests/server.pp | 18 | ||||
-rw-r--r-- | manifests/subsystems/crypttab.pp | 12 | ||||
-rw-r--r-- | manifests/subsystems/fstab.pp | 12 |
9 files changed, 59 insertions, 82 deletions
diff --git a/manifests/appliance.pp b/manifests/appliance.pp index 94da45b..c8e2cc7 100644 --- a/manifests/appliance.pp +++ b/manifests/appliance.pp @@ -2,22 +2,12 @@ class nodo::appliance inherits nodo::physical { include sysctl::appliance # fstab - file { "/etc/fstab": - source => "puppet://$appliance/modules/nodo/etc/fstab/appliance", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'fstab': + type => 'appliance', } # crypttab - file { "/etc/crypttab": - source => "puppet://$appliance/modules/nodo/etc/crypttab/appliance", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'crypttab': + type => 'appliance', } } diff --git a/manifests/desktop.pp b/manifests/desktop.pp index 7efbfaf..0a58830 100644 --- a/manifests/desktop.pp +++ b/manifests/desktop.pp @@ -3,25 +3,15 @@ class nodo::desktop inherits nodo::personal { # fstab if $fstab != false { - file { "/etc/fstab": - source => "puppet://$server/modules/nodo/etc/fstab/desktop", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'fstab': + type => 'desktop', } } # crypttab if $crypttab != false { - file { "/etc/crypttab": - source => "puppet://$server/modules/nodo/etc/crypttab/desktop", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'crypttab': + type => 'desktop', } } } diff --git a/manifests/init.pp b/manifests/init.pp index 2c08011..f5a3e66 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -85,6 +85,8 @@ import "subsystems/domain.pp" import "subsystems/dhclient.pp" import "subsystems/mount.pp" import "subsystems/monitor.pp" +import "subsystems/fstab.pp" +import "subsystems/crypttab.pp" import "subsystems/utils.pp" import "subsystems/utils/debian.pp" import "subsystems/utils/desktop.pp" diff --git a/manifests/kvm.pp b/manifests/kvm.pp index 2f4d632..293d753 100644 --- a/manifests/kvm.pp +++ b/manifests/kvm.pp @@ -1,21 +1,11 @@ class nodo::kvm inherits nodo::host { # fstab - file { "/etc/fstab": - source => "puppet://$server/modules/nodo/etc/fstab/kvm", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'fstab': + type => 'kvm', } # crypttab - file { "/etc/crypttab": - source => "puppet://$server/modules/nodo/etc/crypttab/kvm", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'crypttab': + type => 'kvm', } } diff --git a/manifests/laptop.pp b/manifests/laptop.pp index 382279e..43303a3 100644 --- a/manifests/laptop.pp +++ b/manifests/laptop.pp @@ -9,38 +9,29 @@ class nodo::laptop inherits nodo::personal { # fstab if $fstab != false { - file { "/etc/fstab": - source => "puppet://$server/modules/nodo/etc/fstab/laptop", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'fstab': + type => 'laptop', } } # crypttab if $crypttab != false { - file { "/etc/crypttab": - source => $hibernate ? { - false => "puppet://$server/modules/nodo/etc/crypttab/laptop", - default => "puppet://$server/modules/nodo/etc/crypttab/laptop.hibernate", + class { 'crypttab': + type => $hibernate ? { + false => "laptop", + default => "laptop.hibernate", }, - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], } + } - # hibernation - file { "/etc/initramfs-tools/conf.d/resume": - owner => "root", - group => "root", - mode => 0644, - content => "RESUME=/dev/mapper/cswap\n", - notify => Exec['update-initramfs'], - ensure => $hibernate ? { + # hibernation + file { "/etc/initramfs-tools/conf.d/resume": + owner => "root", + group => "root", + mode => 0644, + content => "RESUME=/dev/mapper/cswap\n", + notify => Exec['update-initramfs'], + ensure => $hibernate ? { false => absent, default => present, }, diff --git a/manifests/removable.pp b/manifests/removable.pp index ee7c369..9b0a723 100644 --- a/manifests/removable.pp +++ b/manifests/removable.pp @@ -1,11 +1,11 @@ class nodo::removable inherits nodo::desktop { # fstab File["/etc/fstab"] { - source => "puppet://$server/modules/nodo/etc/fstab/removable", + source => "puppet:///modules/nodo/etc/fstab/removable", } # crypttab File["/etc/crypttab"] { - source => "puppet://$server/modules/nodo/etc/crypttab/removable", + source => "puppet:///modules/nodo/etc/crypttab/removable", } } diff --git a/manifests/server.pp b/manifests/server.pp index 2170d53..15e52ad 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -1,21 +1,11 @@ class nodo::server inherits nodo::physical { # fstab - file { "/etc/fstab": - source => "puppet://$server/modules/nodo/etc/fstab/server", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'fstab': + type => 'server', } # crypttab - file { "/etc/crypttab": - source => "puppet://$server/modules/nodo/etc/crypttab/server", - owner => "root", - group => "root", - mode => 0644, - ensure => present, - notify => Exec['update-initramfs'], + class { 'crypttab': + type => 'server', } } diff --git a/manifests/subsystems/crypttab.pp b/manifests/subsystems/crypttab.pp new file mode 100644 index 0000000..6447005 --- /dev/null +++ b/manifests/subsystems/crypttab.pp @@ -0,0 +1,12 @@ +class crypttab( + $type +) { + file { "/etc/crypttab": + source => "puppet:///modules/nodo/etc/crypttab/${type}", + owner => "root", + group => "root", + mode => 0644, + ensure => present, + notify => Exec['update-initramfs'], + } +} diff --git a/manifests/subsystems/fstab.pp b/manifests/subsystems/fstab.pp new file mode 100644 index 0000000..40c8c30 --- /dev/null +++ b/manifests/subsystems/fstab.pp @@ -0,0 +1,12 @@ +class fstab( + $type +) { + file { "/etc/fstab": + source => "puppet:///modules/nodo/etc/fstab/${type}", + owner => "root", + group => "root", + mode => 0644, + ensure => present, + notify => Exec['update-initramfs'], + } +} |