is it possible to insert a variable into the password_hash() filter? something that would work like this:
password: "{{ 'mypassword' | password_hash('hash_var') }}"
hash_var being md5 or sha256 or sha512
thanks!
is it possible to insert a variable into the password_hash() filter? something that would work like this:
password: "{{ 'mypassword' | password_hash('hash_var') }}"
hash_var being md5 or sha256 or sha512
thanks!
Yes. It is possible. For example, both expressions below
password: "{{ 'mypassword' | password_hash('sha256', 'salt') }}"
password: "{{ 'mypassword' | password_hash(hash_var, 'salt') }}"
hash_var: sha256
give the same result
password: $5$salt$TYJ6ATpIhYy.nairVJIpWv4n5ky/FxBc31yIH5kPE70