What is the `vault_` prefix convention for secrets in `group_vars`?
IntermediateConceptVault, Privilege Escalation and Error Handling
Answer
Keep two files per group: a plain vars.yml that references secrets, and an encrypted vault.yml that holds the values with a vault_ prefix.
# group_vars/prod/vars.yml
db_password: "{{ vault_db_password }}"
# group_vars/prod/vault.yml (encrypted)
vault_db_password: S3cret!
You can grep for db_password and see where it is used without decrypting anything, and diffs on vars.yml stay readable. The encrypted file only changes when a secret does.
More on Vault, Privilege Escalation and Error Handling
What is Ansible Vault?BeginnerWhich `ansible-vault` commands do you use day to day?BeginnerHow do you supply the vault password when running a playbook?BeginnerWhat is `encrypt_string` and when is it better than encrypting a whole file?IntermediateWhat are vault IDs and why use them?AdvancedHow is Vault data encrypted and what does the file look like?Advanced