diff options
author | Antoine Beaupre <anarcat@koumbit.org> | 2009-09-24 12:16:03 -0400 |
---|---|---|
committer | Antoine Beaupre <anarcat@koumbit.org> | 2009-09-24 12:16:03 -0400 |
commit | 343f27fa91865c0c20f633f36048f8d61179fb02 (patch) | |
tree | ecc6f2e8aa1616d04d4cc6e550ff35fec9b34f44 /manifests/client.pp | |
parent | de010623a8594900b9661db9c0dc8707a1e402fe (diff) | |
parent | 70cae2f75b1938ac26a75597a8e75dc3e7d327b7 (diff) |
Merge commit 'micah/master'
Conflicts:
manifests/mysql.pp
manifests/rdiff.pp
manifests/server.pp
Diffstat (limited to 'manifests/client.pp')
-rw-r--r-- | manifests/client.pp | 69 |
1 files changed, 55 insertions, 14 deletions
diff --git a/manifests/client.pp b/manifests/client.pp index 66dbd1c..c21e669 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -1,4 +1,4 @@ -class backupninja::client { +class backupninja::client::defaults { $configdir = $cfg_override ? { '' => "/etc/backup.d", default => $cfg_override, @@ -8,7 +8,8 @@ class backupninja::client { default => $backupkeystore, } $real_keytype = $backupkeytype ? { - '' => 'rsa', + '' => 'rsa', + false => 'rsa', default => $backupkeytype, } $real_keydestination = $keydestination ? { @@ -37,6 +38,9 @@ class backupninja::client { file { $configdir: ensure => directory } +} + +class backupninja::client inherits backupninja::client::defaults { define key( $user = false, $host = false, $installkey=false, $keyowner=false, $keygroup=false, $keystore=false, $keytype=false) @@ -50,40 +54,77 @@ class backupninja::client { default => $host } $install_key = $installkey ? { - false => "${backupninja::client::real_keymanage}", + false => "${backupninja::client::defaults::real_keymanage}", default => $installkey, } $key_owner = $keyowner ? { - false => "${backupninja::client::real_keyowner}", + false => "${backupninja::client::defaults::real_keyowner}", default => $keyowner, } $key_group = $keygroup ? { - false => "${backupninja::client::real_keygroup}", + false => "${backupninja::client::defaults::real_keygroup}", default => $keygroup, } $key_store = $keystore ? { - false => "${backupninja::client::real_keystore}", + false => "${backupninja::client::defaults::real_keystore}", default => $keystore, } $key_type = $keytype ? { - false => "${backupninja::client::real_keytype}", + '' => "${backupninja::client::defaults::real_keytype}", + false => "${backupninja::client::defaults::real_keytype}", default => $keytype, } + $key_dest = "${backupninja::client::defaults::real_keydestination}" + $key_dest_file = "$key_dest/id_$key_type" + case $install_key { true: { - file { "${backupninja::client::real_keydestination}": - ensure => directory, - mode => 0700, owner => $key_owner, group => $key_group, + if !defined(File["$key_dest"]) { + file { "$key_dest": + ensure => directory, + mode => 0700, owner => $key_owner, group => $key_group, + } } - file { "${backupninja::client::real_keydestination}/id_${key_type}": - source => "${key_store}/${real_user}_id_${key_type}", - mode => 0400, owner => $key_owner, group => $key_group, - require => File["${backupninja::client::real_keydestination}"], + if !defined(File["$key_dest_file"]) { + file { "$key_dest_file": + source => "${key_store}/${real_user}_id_${key_type}", + mode => 0400, owner => $key_owner, group => $key_group, + require => File["$key_dest"], + } } } } } } +class backupninja::client::maildir inherits backupninja::client::defaults { + + if !defined(Package["rsync"]) { + if $rsync_ensure_version == '' { $rsync_ensure_version = 'installed' } + package { 'rsync': + ensure => $rsync_ensure_version, + } + } +} + +class backupninja::client::rdiff_backup inherits backupninja::client::defaults { + if !defined(Package["rdiff-backup"]) { + if $rdiff_backup_ensure_version == '' { $rdiff_backup_ensure_version = 'installed' } + package { 'rdiff-backup': + ensure => $rdiff_backup_ensure_version, + } + } +} + +class backupninja::client::duplicity inherits backupninja::client::defaults { + + if !defined(Package["duplicity"]) { + if $duplicity_ensure_version == '' { $duplicity_ensure_version = 'installed' } + package { 'duplicity': + ensure => $duplicity_ensure_version, + } + } +} + |