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.
This assumes you have created the Ansible Vault password file. Let's say the password file is:
A vault password file can be used to provide the vault password when:
You could define vault_password_file in the same directory that the ansible-playbook command will be issued from or from your users personal ansible.cfg (e.g. /home/john.doe/.ansible.cfg).
I can't think of any reason why you would ever want to define vault_password_file in the global /etc/ansible/ansible.cfg file.
[defaults] vault_password_file = /home/john.doe/.vault_password.txt
ansible-vault view foo.txt
Or For example, you can view an encrypted file (foo.txt) by including the --vault-password-file command line option and you will not be prompted for the vault password.
ansible-vault --vault-password-file /usr/local/vault/.vault_password.txt view foo.txt