Vaulted variables are undefined, although the file decrypts fine with `ansible-vault view`
BeginnerTroubleshootingVault, Performance and Execution Behaviour
Answer
Likely causes → The vault file is not where Ansible loads variables from. It sits at group_vars/prod/secrets/vault.yml (too deep is fine), or at vars/vault.yml (never loaded automatically), or it is named after a group that does not exist.
Fix → Use the standard pattern:
inventories/prod/group_vars/all/vars.yml # db_password: "{{ vault_db_password }}"
inventories/prod/group_vars/all/vault.yml # vault_db_password: ... (encrypted)
Or load it explicitly with vars_files.
Prevent → Use the vault_ prefix and indirection pattern, so grep can always find where a secret is used.
More on Vault, Performance and Execution Behaviour
`ERROR! Attempting to decrypt but no vault secrets found`Beginner`ERROR! Decryption failed (no vault secrets were found that could decrypt) on inventories/prod/group_vars/all/vault.yml`BeginnerBoth `--vault-id [email protected]` and `--vault-id prod@prompt` are passed, and prod files still fail to decryptIntermediate`Vault format unhexlify error: Odd-length string` after pasting an `encrypt_string` valueIntermediate`Problem running vault password script /home/ci/.vault_pass ([Errno 8] Exec format error). If this is not a script, remove the executable bit from the file.`AdvancedEvery change to `vault.yml` produces an unreadable diff and constant merge conflictsIntermediate