Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Owner

dploeger commented Sep 19, 2018

Based on this Blog post

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