diff options
author | varac <varacanero@zeromail.org> | 2016-05-17 12:19:20 +0200 |
---|---|---|
committer | varac <varacanero@zeromail.org> | 2016-05-17 12:19:20 +0200 |
commit | 415e9504f99dca3ccaa4dfd389dde24ad9d0e01c (patch) | |
tree | 95fed058eaa50765bf486ccc59e46123666acabe | |
parent | 117bed9a9263c21d253d86b667eb165948efdc24 (diff) | |
parent | fc2fa42ca764358ea06db090e8d283febe63a0f1 (diff) |
Merge remote-tracking branch 'shared/master' into leap_master
-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}", } } |