I have multiple roles. Each of them has it's own vault encrypted by a unique pass. I include vault in each role by using: include_vars: vars/encrypted.yml
in playbook tasks. To be able to decypt the data I have to put each VaultID to ansible.cfg or use --vault-id
.
Ansible asks for password for EVERY VaultID referenced even if it will not be used eventually. Thus if I run a single role I have to edit either ansible.cfg or cmd line parameters to reference only necessary VaultIDs every time.
How do I dynamically ask for passwords only for required roles? Maybe I can use Ansible Prompt module to ask the password and somehow declare the VaultID before I use include_vars module?
P. S.: I cannot store passwords in files due to security concerns.