I seriously thought about supporting this, but in the end I figured that this is much better supported by states than by
a module function. It seemed a little reckless to create the password file without making sure it is secure and has the 
right permissions. Or that it is configured so that your web server of choice can get access to it.

Brent


----- Original Message -----
From: "Joseph Hall" <notifications@github.com>
To: "saltstack/salt-contrib" <salt-contrib@noreply.github.com>
Cc: "Brent Lambert" <brent@enpraxis.net>
Sent: Monday, May 13, 2013 5:00:31 PM
Subject: Re: [salt-contrib] Refactored awstats module, added webalizer and basicauth module (#39)



In modules/basicauth.py: > +:configuration: The basicauth password file to be managed 
> +    can be passed directly into the adduser and deleteuser 
> +    functions, or it can be set in the minion configuration 
> +    file as follows::
> +
> +        basicauth.password_file: /etc/httpd/.htpasswd
> +
> +    It can also be set in pillar data in a similar manner using
> +    a .sls file. If no options are specified it will be assumed that
> +    the htpassword file is located at /etc/.htpasswd
> +
> +This module looks for the binary /usr/bin/htpasswd and will load
> +if it is found. Normally this binary is included in the apache
> +package. 
> +
> +The htpasswd file must exist in order to successfully 

This manual step can be cut out, by checking for the existence of the file first, and adding the -c option if it isn't there. See apache.useradd for an example. 

— 
Reply to this email directly or view it on GitHub .