can we encrypt a string (password) using ansible vault.

Hi,

can we encrypt a string (password) using ansible vault. I have a file which contains the usernames and passwords.

Could we encrypt the username and password inside the file rather then encrypting the file with ansible-vault encrypt. if yes, then how do we go about calling those encrypted users and passwords in the playbook.

Please suggest. Thank you.

Hi,

Have a look here:
https://docs.ansible.com/ansible/latest/user_guide/vault.html#use-encrypt-string-to-create-encrypted-variables-to-embed-in-yaml

kind regards
Pshem

Thanks Pshem for sharing … will check the link and get back.

Thank you.