A CI pipeline needs the vault password without storing it in the repo.
IntermediateScenarioSecurity: Vault, Become and Compliance
Answer
Situation read → Secure delivery to automation.
What I'd do → Store it as a masked CI secret and write it to a temp file or use a script that prints it from a secret manager.
echo "$VAULT_PASS" > "$RUNNER_TEMP/vp" && chmod 600 "$RUNNER_TEMP/vp"
ansible-playbook site.yml --vault-password-file "$RUNNER_TEMP/vp"
shred -u "$RUNNER_TEMP/vp"
A cleaner method: --vault-password-file ./vault-pass.sh where the script fetches from AWS Secrets Manager.
Why → If the file is executable, Ansible runs it and uses stdout.
Interview tip → Never echo the secret in logs; mask it.
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.IntermediateHow do you change the vault password for all encrypted files?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