Use this when previewing what automation would change.
Dry Run
A dry run shows what an automation would change without changing anything, such as ansible-playbook --check --diff, terraform plan or PowerShell -WhatIf, so changes can be reviewed first.
1. Dry run shows what would change without changing.
2. Use before every production run.
3. Not all modules support it — know limits.
4. Review diffs.
5. Make it the default for risky automation.
code → dry run → diff review → real run
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 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as implicit defaults, hidden dependencies, duplicate dispatch, worker drift, timeout without cancellation, retries against non-idempotent operations and confusing control-plane completion with target convergence, choosing the cases most relevant to side-effect suppression, plan/diff fidelity, API calls that still read or validate, detecting unsupported dry-run behavior and comparing dry-run to actual execution.
Step 2 Common mistakes Narrow the fault
- Modules that do not support check mode and silently skip.
- Applying something different from what was reviewed (use the saved plan).
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.
- A dry run shows intended changes without making them.
- Use --check --diff, terraform plan or -WhatIf.
- Some modules or commands cannot simulate their effect.
ansible-playbook site.yml --check --diff— Ansible dry runterraform plan— TerraformSet-Something -WhatIf— PowerShell
ReferenceWhy it matters1 section · depth on demand
What it is
A dry run shows what would change without changing anything: terraform plan, ansible-playbook --check --diff, kubectl apply --dry-run=server. Review it before every production run.
ReferenceImportant terms & boundaries2 sections · depth on demand
In depth
A dry run shows what an automation would change without changing anything. It is the single most useful safety feature: reviewers see the exact impact, operators can check scope before running for real, and CI can produce previews for pull requests.
| Tool | Dry run |
|---|---|
| Ansible | --check --diff |
| Terraform | plan |
| Kubernetes | kubectl apply --dry-run=server, kubectl diff |
| PowerShell | -WhatIf (with SupportsShouldProcess) |
| rsync | --dry-run |
| Custom scripts | --apply flag, default off |
Limitations: some modules cannot predict results (commands with no check support are skipped), and dry runs cannot show effects that depend on earlier changes in the same run. Make dry run the default for custom tools, so making changes requires an explicit flag.
Example
terraform plan -out=tfplan
ansible-playbook site.yml --check --diff
kubectl apply -f app.yaml --dry-run=server
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 Automation Design > Dry Run. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/azure/well-architected/operational-excellence/enable-automation · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For side-effect suppression, plan/diff fidelity, API calls that still read or validate, detecting unsupported dry-run behavior and comparing dry-run to actual execution, prefer typed fields and stable IDs over human presentation text.