Wednesday, November 27, 2019

Ansible Vault

Ansible Vault:
Encrypt playbooks and password protect them.
Purpose used:
creating,editing playbooks and for storing passwords.

ansible-vault create test.yaml
It will prompt for a password and the test.yaml is created with encrypted form.

To run this playbook,we need to provide the encryption password also.
ansible-playbook test.yaml --ask-vault-pass
ansible-playbook test.yaml --vault-password-file password.txt

you can keep the password file readable only by owner, so other users can't see the content of it.

And to edit the playbook.
ansible-valult edit test.yaml



encrypt variables:
ansible-vault encrypt group_vars/all.yml

ansible db -m win_ping --ask-vault-pass

No comments:

Post a Comment