Search code examples
testingansibleansible-vault

Is it possible to disable vault with ansible playbook?


For automated testing purposes, I'd like to disable the vault when executing ansible-playbook so that the encrypted variables are overridden in the tests.

I've seen the --ask-vault-pass but not the contrary i.e. --no-vault-pass or the like.

The ansible settings don't specify an environment variable to do so.


Solution

  • You can create a special configuration file for your tests where the vault information is deliberatly excluded and tell ansible to use this configuration file when running your test playbooks:

    ANSIBLE_CONFIG=/my/special.cfg ansible-playbook testplaybook.yml