diff mode
An option that makes modules print a before-and-after diff of each file they change, or would change in check mode.
In more detail
Start it with ansible-playbook --diff, usually together with --check, to see exactly which lines of a configuration file or template would change before you approve a run. Only modules that manage text can provide one, and it can reveal secret values in file content, so use it with care on sensitive files.
Related terms
- check mode — A rehearsal run that asks each module what it would change and stops before changing anything.
- diff — A listing of the differences between two versions of something, such as two files, two commits or two screenshots.
- template module — The module that fills in a Jinja template with variables and writes the result to a file on each host.
Taught in
- Check Mode And Diff — Ansible Configuration Management at Scale
- ansible.cfg: Which File Wins, And The Settings That Matter — RHCE in Ansible (EX294): Automate Red Hat Systems