Is there a way to access the vault password as a variable in an Ansible playbook? I am looking for something like this:
---
debug: var=ansible_vault_password
Is there a way to access the vault password as a variable in an Ansible playbook? I am looking for something like this:
---
debug: var=ansible_vault_password
Try to save the password into a different file and use "vars_files" to include the password. Example:
In Password.yml:
In Playbook.yml:
Try this and please let me know.
I ended up solving this by copying the local vault password file to the server. The task to do that looks like that:
And then the
root
user will execute theansible-pull
command.