From 100bb69f2e721332e71e4e5bf8dd96cf3499296c Mon Sep 17 00:00:00 2001 From: Micah Anderson Date: Fri, 30 May 2008 17:43:51 +0000 Subject: 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 --- manifests/client.pp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'manifests/client.pp') 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}"], } -- cgit v1.2.3