Skip to content

Instantly share code, notes, and snippets.

@dploeger
Created September 19, 2018 13:06
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dploeger/d9d63c9a56a0f132e21972718ea12266 to your computer and use it in GitHub Desktop.
Save dploeger/d9d63c9a56a0f132e21972718ea12266 to your computer and use it in GitHub Desktop.
HTPasswd management using Puppet
<% @accounts.each do |user, password| -%>
<%= user %>:<%= scope.call_function('apache_pw_hash', [password]) %>
<% end -%>
# @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")
}
}
@dploeger
Copy link
Author

Based on this Blog post

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment