Skip to content
This repository has been archived by the owner on Jun 11, 2019. It is now read-only.

fixes apache::htpasswd #85

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions manifests/htpasswd.pp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
# Default: $name
#
# [*crypt_password*]
# Crypted password (as it appears in htpasswd)
# Plain password which will be stored encrypted in the htpasswd file
# Default: false (either crypt_password or clear_password must be set)
#
# [*clear_password*]
# Clear password (as it appears in htpasswd)
# Clear password which will be stored 'as is' in the htpasswd file
# Default: false (either crypt_password or clear_password must be set)
#
#
Expand Down Expand Up @@ -85,8 +85,8 @@
}

if $clear_password {
exec { "test -f ${real_htpasswd_file} || OPT='-c'; htpasswd -bp \$OPT ${real_htpasswd_file} ${username} ${clear_password}":
unless => "egrep '^${username}:' ${real_htpasswd_file} && grep ${username}:\$(mkpasswd -S \$(egrep '^${username}:' ${real_htpasswd_file} |cut -d : -f 2 |cut -c-2) ${clear_password}) ${real_htpasswd_file}",
exec { "test -f ${real_htpasswd_file} || OPT='-c'; htpasswd -bp \$OPT ${real_htpasswd_file} ${username} '${clear_password}'":
unless => "egrep '^${username}:' ${real_htpasswd_file} && grep ${username}:\$(mkpasswd -S \$(egrep '^${username}:' ${real_htpasswd_file} |cut -d : -f 2 |cut -c-2) '${clear_password}') ${real_htpasswd_file}",
path => '/bin:/sbin:/usr/bin:/usr/sbin',
}
}
Expand Down