summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2016-05-17 12:13:59 +0200
committervarac <varacanero@zeromail.org>2016-05-17 12:13:59 +0200
commitfc2fa42ca764358ea06db090e8d283febe63a0f1 (patch)
tree95fed058eaa50765bf486ccc59e46123666acabe
parentf9a33075bd2df0a6b2f17629a45c7723827f724f (diff)
linted manifests/htpasswd_user.pp
-rw-r--r--manifests/htpasswd_user.pp21
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}",
}
}