diff options
Diffstat (limited to 'manifests/htpasswd_user.pp')
-rw-r--r-- | manifests/htpasswd_user.pp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/manifests/htpasswd_user.pp b/manifests/htpasswd_user.pp index c4c5453..82fbce4 100644 --- a/manifests/htpasswd_user.pp +++ b/manifests/htpasswd_user.pp @@ -1,12 +1,11 @@ # ToDo: This should be rewritten as native type define apache::htpasswd_user( - $ensure = present, - $site = 'absent', - $username = 'absent', $password, $password_iscrypted = false, - $ensure = 'present', - $path = 'absent' + $ensure = 'present', + $site = 'absent', + $username = 'absent', + $path = 'absent' ){ case $username { 'absent': { $real_username = $name } @@ -22,12 +21,14 @@ define apache::htpasswd_user( $real_password = htpasswd_sha1($password) } + case $path { + 'absent': { $real_path = "/var/www/htpasswds/${real_site}" } + default: { $real_path = $path } + } + file_line{"htpasswd_for_${real_site}": ensure => $ensure, - path => $path ? { - 'absent' => "/var/www/htpasswds/${real_site}", - default => $path - }, - line => "${username}:${real_password}", + path => $real_path, + line => "${username}:${real_password}", } } |