diff options
-rw-r--r-- | manifests/user.pp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/manifests/user.pp b/manifests/user.pp index 4b60f97..9c63c22 100644 --- a/manifests/user.pp +++ b/manifests/user.pp @@ -1,9 +1,15 @@ # Inspired by backupninja::sandbox -class backup::user( +define backup::user( $ensure = present, $hosting_domain = $::domain, - $sshkey = hiera("compiled::ssh::key::${name}.${hosting_domain}"), + $sshkey = '', ) { + #$hosting_domain = regsubst($::domain, '\.', '_', 'G'), + $real_sshkey = $sshkey ? { + '' => hiera("compiled::ssh::key::${name}.${hosting_domain}"), + default => $sshkey, + } + user::manage { $name: ensure => $ensure, password => '*', @@ -11,6 +17,6 @@ class backup::user( gid => 'backupninjas', shell => '/bin/bash', homedir => "${::backup::params::backupdir_remote}/${name}.${hosting_domain}", - sshkey => $sshkey, + sshkey => $real_sshkey, } } |