Hi,
What i am trying to do :
ansible-playbook -i playbooks/hosts/vt-hosts playbooks/vault-test.yml --ask-vault-pass
I have some properties encrypted using vault. The idea i want to code is to combine using some CI tool like Team City asking for vault password and then running ancible playbook to setup hosts. Everything works fine except i would like to find a way to pass captured password from my CI as a parameter to ancible playbook executionn.
Let’s assume i would have my password in variablie VP. Is there any way to automatically pass password from VP to
ansible-playbook -i playbooks/hosts/vt-hosts playbooks/vault-test.yml --ask-vault-pass (in bash)
when the promp would appear:
Vault password:
Smth like
echo $VP | ansible-playbook -i playbooks/hosts/vt-hosts playbooks/vault-test.yml --ask-vault-pass
does not work.
I dont like to store password in file as a plain text and pass it to ansible-playbook because when some errors would occur the file with password could be not delete from the environments.
Please help is automatically passing password to that prompt is possible.
Michal Klasinski