Every change to `vault.yml` produces an unreadable diff and constant merge conflicts
IntermediateTroubleshootingVault, Performance and Execution Behaviour
Answer
Likely causes → Encrypted files change completely on every edit, because each encryption uses a new salt. Two people editing the same vault file at the same time always conflict.
Fix → Get readable local diffs with a textconv:
echo '*vault*.yml diff=ansible-vault' >> .gitattributes
git config diff.ansible-vault.textconv "ansible-vault view"
To resolve a conflict, view both versions, merge the plaintext by hand, and encrypt again.
Prevent → Keep vault files small and split them per environment and per role. Consider an external secret manager for secrets that change often.
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.`AdvancedVaulted variables are undefined, although the file decrypts fine with `ansible-vault view`Beginner