Interview Prep/Ansible/Security: Vault, Become and Compliance

How do you change the vault password for all encrypted files?

IntermediateScenarioSecurity: Vault, Become and Compliance
Answer

Situation read → Rotation after someone leaves.

What I'd do →

ansible-vault rekey --vault-id prod@old_pw_file --new-vault-id prod@new_pw_file group_vars/prod/*.yml

Then rotate the underlying secrets too, because the ex-employee may have read them.

Why → Rekey protects future access to the files, not secrets already seen.

Interview tip → Say both: rekey the vault and rotate the secrets.

All Ansible questions Roadmap: Ansible

More on Security: Vault, Become and Compliance