aboutsummaryrefslogtreecommitdiff
path: root/manifests/client.pp
diff options
context:
space:
mode:
authorMicah Anderson <micah@riseup.net>2008-05-30 17:43:51 +0000
committerMicah Anderson <micah@riseup.net>2008-05-30 17:43:51 +0000
commit100bb69f2e721332e71e4e5bf8dd96cf3499296c (patch)
tree26e540ec4786e0c033f56c44294a9a3977cc014b /manifests/client.pp
parentd08410db8a81ce6060eea2044c0ac09c001568ab (diff)
downloadpuppet-backupninja-100bb69f2e721332e71e4e5bf8dd96cf3499296c.tar.gz
puppet-backupninja-100bb69f2e721332e71e4e5bf8dd96cf3499296c.tar.bz2
change the backupninja::client::key definition to use the $user variable
change the $host variable to no longer use the $user variable, that way multiple rdiff's can be instantiated for a particular host, with different name variables in order to do that, the class also has to have the $installkeys variable that can be passed to backupninja::client::key so that the second rdiff instantiation would set installkeys => false, otherwise there will be an attempt to duplicate the resource
Diffstat (limited to 'manifests/client.pp')
-rw-r--r--manifests/client.pp12
1 files changed, 10 insertions, 2 deletions
diff --git a/manifests/client.pp b/manifests/client.pp
index 67191d9..6942299 100644
--- a/manifests/client.pp
+++ b/manifests/client.pp
@@ -33,8 +33,16 @@ class backupninja::client {
file { $configdir:
ensure => directory
}
- define key ( $host=$user, $installkeys=false, $keyowner=false, $keygroup=false, $keystore=false, $keytype=false )
+ define key ( $user = false, $host = false, $installkeys=false, $keyowner=false, $keygroup=false, $keystore=false, $keytype=false )
{
+ $real_user = $user ? {
+ false => $name,
+ default => $user
+ }
+ $real_host = $host ? {
+ false => $user,
+ default => $host
+ }
$install_keys = $installkeys ? {
false => "${backupninja::client::real_keymanage}",
default => $installkeys,
@@ -64,7 +72,7 @@ class backupninja::client {
mode => 700, owner => $key_owner, group => $key_group,
}
file { "${backupninja::client::real_keydestination}/id_${key_type}":
- source => "${key_store}/${host}_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}"],
}