Ansible: Vault Password File Not Found¶
Error¶
[WARNING]: Error getting vault password file (default): The vault password file /Users/majorlinux/.ansible/vault_pass was not found
[ERROR]: The vault password file /Users/majorlinux/.ansible/vault_pass was not found
Cause¶
Ansible is configured to look for a vault password file at ~/.ansible/vault_pass, but the file does not exist. This is typically set in ansible.cfg via the vault_password_file directive.
Solutions¶
Option 1: Remove the vault config (if you're not using Vault)¶
Check your ansible.cfg for this line and remove it if Vault is not needed:
Option 2: Create the vault password file¶
Security note: Keep permissions tight (
600) so only your user can read the file. The actual vault password is stored in Bitwarden under the "Ansible Vault Password" entry.
Option 3: Pass the password at runtime (no file needed)¶
Diagnosing the Source of the Config¶
To find which config file is setting vault_password_file, run:
This shows all non-default config values and their source files. Config is loaded in this order of precedence:
ANSIBLE_CONFIGenvironment variable./ansible.cfg(current directory)~/.ansible.cfg/etc/ansible/ansible.cfg
Related¶
- Ansible Getting Started
- Vault password is stored in Bitwarden under "Ansible Vault Password"
- Ansible playbooks live at
~/MajorAnsibleon MajorAir/MajorMac - ansible-lint in CI Without the Vault Password — the same error inside CI, and how to lint without the secret