How do you rotate a vault password?
IntermediateConceptVault, Privilege Escalation and Error Handling
Answer
ansible-vault rekey --vault-password-file old.txt \
--new-vault-password-file new.txt \
group_vars/prod/vault.yml roles/*/vars/vault.yml
Rekey every encrypted file with the same old password, then distribute the new password and update CI. rekey does not touch inline !vault strings inside plain files; those must be regenerated with encrypt_string. Rotating the password does not make previously leaked history safe, so rotate the underlying secrets as well.
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