Interview Prep/Ansible/Vault, Privilege Escalation and Error Handling

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.

All Ansible questions Roadmap: Ansible

More on Vault, Privilege Escalation and Error Handling