Bootstrap FreeKB - Ansible - vault_password_file ansible.cfg
Ansible - vault_password_file ansible.cfg

Updated:   |  Ansible articles

If you are not familiar with the Ansible Vault, check out my article Getting Started with the Ansible Vault.

The ansible-vault command can be used to perform a number of tasks.

Additionally, there are a few command line options to be aware of.

  • --ask-vault-pass - prompt for the vault password
  • --vault-id - use a specific users password in a file
  • --vault-password-file - use a single password in a file

 

This assumes you have created the Ansible Vault password file. Let's say the password file is:

/usr/local/vault/.vault_password.txt

 

A vault password file can be used to provide the vault password when:

 

You could define vault_password_file in your ansible.cfg file.

[defaults]
vault_password_file = /usr/local/ansible/vault/.vault_password.txt

 

Then you can view an encrypted file (vault.yml) without having to include the --vault-password-file or --vault-id command line options.

ansible-vault view vault.yml

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter a6a8a1 in the box below so that we can be sure you are a human.