Use it when configuring, checking or troubleshooting Check Mode in Ansible.
Check Mode
Ansible check mode asks supported content to predict changes without applying them, providing planning evidence whose accuracy depends on module/plugin support and observable current state.
1. Check mode simulates changes.
2. --diff shows file changes.
3. Some modules don't support it.
4. Command tasks skip unless check_mode: false (for read-only).
5. Use before production runs.
playbook → check mode → predicted changes
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Operational evidence path Verify boundary
current state → check-mode support/model → predicted task results/diff → skipped/unknown paths → controlled real run → target read-back
Healthy evidence: critical modules declare meaningful support, predicted paths are understood and controlled real-run results align with the simulation.
Step 2 Failure modes and next checks Narrow the fault
Suspicious evidence: unsupported modules silently skipped, registered-value dependencies, false confidence from no-change output or treating check mode as transactional rollback.
Step 3 Common mistakes Narrow the fault
- Modules without check-mode support skipped silently.
- Trusting check mode for tasks that depend on earlier changes.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Check mode ok ≠ real run guaranteed; external APIs, generated data and unsupported modules can behave differently.
- changed prediction ≠ actual change applied; check mode normally does not mutate target state.
- No predicted change ≠ target healthy; the task may validate only a narrow resource boundary.
- Module supports check mode ≠ every dependent role/task is simulation-safe.
ansible-playbook site.yml --check --diff— dry run- check_mode: false for read-only commands — make checks work
- Modules without check mode support — limitations
ReferenceWhat it is1 section · depth on demand
Core model
Treat check-mode results as simulation/prediction: record module support, skipped unsupported actions, data dependencies and diff output, then verify with a controlled real run when confidence is required.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
Check mode shows what supported content predicts from observable state, but it does not show the real execution will succeed or produce identical results.
In depth
Check mode (--check) runs a playbook without making changes; modules report what they would change. Combined with --diff, it shows the exact line-level differences — the standard way to preview Ansible changes before applying them.
ansible-playbook site.yml --check --diff --limit sw-oslo-07
- name: Always gather state, even in check mode
cisco.ios.ios_command: { commands: [show version] }
check_mode: false
- name: Never run during a real run (preview only)
ansible.builtin.debug: msg="preview"
check_mode: true
Limitations: command/shell tasks are skipped, and tasks depending on results of earlier changed tasks may report misleadingly. Test check-mode support of your playbooks — a check run that fails or reports changes that never happen erodes trust in previews.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Ansible > Check Mode. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://docs.ansible.com/ansible/latest/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Quick lookup tables
Check Mode Ansible boundary map
Fast input/selection, execution/result and target-proof boundaries for Check Mode.
| Boundary | Healthy evidence | Suspicious evidence |
|---|---|---|
| Inputs / selection | Correct inventory, hosts, variables/facts and content are explicit | Wrong scope, stale facts, hidden precedence or content-version drift |
| Execution | Connection, privilege, module/task context and ordering match intent | Unreachable, wrong execution host, privilege/plugin failure or misleading skip/change state |
| Result semantics | Per-host/item results are preserved and interpreted correctly | Aggregate recap hides partial/skipped/handled failures |
| Target proof | Resource/workload read-back and rerun confirm convergence | Green Ansible status treated as end-to-end acceptance |