I run the following on the command line:
$ htpasswd -nb demo demo
demo:$apr1$nB6zClk/$SXB.D6Tr81L2Q6zxLulEg.
Then in my playbook I have the following:
htpasswd: path=/tmp/.htpasswd name=demo password=$apr1$nB6zClk/$SXB.D6Tr81L2Q6zxLulEg.
And the resulting file (/tmp/.htpasswd), the entry for demo is different than what was in the playbook, and authentication through nginx fails. My understanding was that the apr_md5_crypt was the default for the htpasswd module.
Any ideas what I am doing wrong?
thanks.
iprok
(iprok)
December 14, 2014, 7:18pm
2
pass clear text password using password= parameter. For example
htpasswd: path=/tmp/.htpasswd name=demo password=demo
And resulting password string can be different when using same password because of using salt.
Ah, I see - thanks. That wasnt clear to me from the documentation. Is there any way to pass a password not in clear text?
Thanks.
-john
iprok
(iprok)
December 15, 2014, 1:24pm
4
To pass it - I think is would be tricky. But you can store it in encrypted form using ansible-vault.
Great, I had forgotten about vault, thanks again.