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.
More on Security: Vault, Become and Compliance
Database passwords are sitting in plain text in `group_vars`. How do you fix it?BeginnerYou need separate vault passwords for staging and prod.IntermediateA CI pipeline needs the vault password without storing it in the repo.IntermediateYou want to see the value inside an encrypted file without writing a decrypted copy to disk.BeginnerOnly one value in a vars file is secret and you want it in the same file as plain values.BeginnerA task needs root on the target but your user has only limited sudo rights.Intermediate