From fc2fa42ca764358ea06db090e8d283febe63a0f1 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 17 May 2016 12:13:59 +0200 Subject: linted manifests/htpasswd_user.pp --- manifests/htpasswd_user.pp | 21 +++++++++++---------- 1 file 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}", } } -- cgit v1.2.3