check mode
A rehearsal run that asks each module what it would change and stops before changing anything.
In more detail
Start it with ansible-playbook --check. Tasks report changed if they would change something, and the recap counts predicted changes. It is evidence about the current target, not a guarantee: some modules have limited support, and command tasks cannot predict anything useful. A final check run after applying should report no changes.
Example
ansible-playbook --check --diff preview.ymlRelated terms
- diff mode — An option that makes modules print a before-and-after diff of each file they change, or would change in check mode.
- ansible-playbook — The command that runs a playbook, printing a banner for each play and task, a result per host, and a recap at the end.
- idempotency — The property of an operation that gives the same result whether you run it once or many times, because a repeat run finds nothing left to do.
Taught in
- Check Mode And Diff — Ansible Configuration Management at Scale
- Handlers And Notify — Ansible Configuration Management at Scale
- Performance, Forks And Best Practices — Ansible Configuration Management at Scale
- Static Inventories: Hosts, Groups And Groups Of Groups — RHCE in Ansible (EX294): Automate Red Hat Systems
- Anatomy Of A Playbook: Plays, Tasks And Modules — RHCE in Ansible (EX294): Automate Red Hat Systems
- Conditionals: register, when, changed_when And failed_when — RHCE in Ansible (EX294): Automate Red Hat Systems
- Handlers And Failure: notify, block, rescue And always — RHCE in Ansible (EX294): Automate Red Hat Systems
- Ansible Vault: Secrets Encrypted, Runs Without A Prompt — RHCE in Ansible (EX294): Automate Red Hat Systems
- Drill: Storage Only Where The Disk Exists — RHCE in Ansible (EX294): Automate Red Hat Systems