From e22d7cc42d0cb3a8d65086468502194df490bde7 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Thu, 23 Jun 2016 14:57:28 -0300 Subject: Fixes backup::user --- manifests/user.pp | 12 +++++++++--- 1 file 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, } } -- cgit v1.2.3