Running `--diff` on a template leaks a secret into the CI log.
IntermediateScenarioSecurity: Vault, Become and Compliance
Answer
Situation read → Diff output reveals file content.
What I'd do → Disable diff on that task.
- ansible.builtin.template:
src: db.env.j2
dest: /etc/app/db.env
mode: "0600"
diff: false
no_log: true
Why → The diff: false task keyword suppresses diff output for the task.
Interview tip → Both keywords exist: diff shows content differences, no_log hides module args and result.
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?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.Beginner