diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2016-06-23 14:57:28 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2016-06-23 14:57:28 -0300 |
commit | e22d7cc42d0cb3a8d65086468502194df490bde7 (patch) | |
tree | 7f210247e3450e6204d70fb86e8a6ffc4ee5bb14 | |
parent | f9b3ea701d231871b3dc1a5bee5266b735df71aa (diff) | |
download | puppet-backup-e22d7cc42d0cb3a8d65086468502194df490bde7.tar.gz puppet-backup-e22d7cc42d0cb3a8d65086468502194df490bde7.tar.bz2 |
Fixes backup::user
-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, } } |