Hashing values supplied byvars_prompt
You can hash the entered value so you can use it, for example, with the user module to define a password:
If you havePasslibinstalled, you can use any crypt scheme the library supports:
des_crypt- DES Cryptbsdi_crypt- BSDi Cryptbigcrypt- BigCryptcrypt16- Crypt16md5_crypt- MD5 Cryptbcrypt- BCryptsha1_crypt- SHA-1 Cryptsun_md5_crypt- Sun MD5 Cryptsha256_crypt- SHA-256 Cryptsha512_crypt- SHA-512 Cryptapr_md5_crypt- Apache’s MD5-Crypt variantphpass- PHPass’ Portable Hashpbkdf2_digest- Generic PBKDF2 Hashescta_pbkdf2_sha1- Cryptacular’s PBKDF2 hashdlitz_pbkdf2_sha1- Dwayne Litzenberger’s PBKDF2 hashscram- SCRAM Hashbsd_nthash- FreeBSD’s MCF-compatible nthash encoding
The only parameters accepted are ‘salt’ or ‘salt_size’. You can use your own salt by defining
‘salt’, or have one generated automatically using ‘salt_size’. By default, Ansible generates a salt
of size 8.
If you do not have Passlib installed, Ansible uses thecryptlibrary as a fallback. Ansible supports at most four crypt schemes, depending on your platform at most the following crypt schemes are supported:
bcrypt- BCryptmd5_crypt- MD5 Cryptsha256_crypt- SHA-256 Cryptsha512_crypt- SHA-512 Crypt