Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

Check Mode

Direct answer

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.

When to use this

Use it when configuring, checking or troubleshooting Check Mode in Ansible.

First 30 seconds

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.

Operational verification

playbook → check mode → predicted changes

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Ansible automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformAnsible automation · Check Mode owns Ansible simulation semantics. Change approval and target acceptance remain external controls.
Scope / prerequisiteUse it when configuring, checking or troubleshooting Check Mode in Ansible.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

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 references

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.

observation · 1
Key points
  • 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.
Key checks
  • 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.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docAnsible automation current

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%
Terminology layer

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.

Aliases that resolve here
ansible check modedry run ansible--checkansible diff mode
Embedded reference data

Quick lookup tables

Check Mode Ansible boundary map

Fast input/selection, execution/result and target-proof boundaries for Check Mode.

BoundaryHealthy evidenceSuspicious evidence
Inputs / selectionCorrect inventory, hosts, variables/facts and content are explicitWrong scope, stale facts, hidden precedence or content-version drift
ExecutionConnection, privilege, module/task context and ordering match intentUnreachable, wrong execution host, privilege/plugin failure or misleading skip/change state
Result semanticsPer-host/item results are preserved and interpreted correctlyAggregate recap hides partial/skipped/handled failures
Target proofResource/workload read-back and rerun confirm convergenceGreen Ansible status treated as end-to-end acceptance
Confirmation

Confirm action

Continue?