Add and remove username/password entries in a password file using htpasswd. ,This is used by web servers such as Apache and Nginx for basic authentication.


path Path to the file that contains the usernames and passwords true
name User name to add or remove true
  • Password associated with user.
  • Must be specified if user does not exist yet.
crypt_scheme Encryption scheme to be used. As well as the four choices listed here, you can also use any other hash supported by passlib, such as md5_crypt and sha256_crypt, which are linux passwd hashes. If you do so the password file will not be compatible with Apache or Nginx
  • apr_md5_crypt
  • des_cryptldap_sha1plaintext
state Whether the user entry should be present or not
  • present
  • absent
create Used with C(state=present). If specified, the file will be created if it does not already exist. If set to "no", will fail if the file does not exist
  • yes
  • no


Ansible Core Team