Created
September 19, 2018 13:06
-
-
Save dploeger/d9d63c9a56a0f132e21972718ea12266 to your computer and use it in GitHub Desktop.
HTPasswd management using Puppet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<% @accounts.each do |user, password| -%> | |
<%= user %>:<%= scope.call_function('apache_pw_hash', [password]) %> | |
<% end -%> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @summary Manages a HTPasswd file | |
# @param [String] filename The name and path of the htpasswd file | |
# @param [Hash] accounts The accounts to manage (username => password) | |
class profiles::htpasswd ( | |
String $filename, | |
Hash $accounts | |
) { | |
file { | |
$filename: | |
content => template("${module_name}/htpasswd/htpasswd.erb") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Based on this Blog post