
A green dry run is a useful starting point. I would not use it as the approval to change a whole environment. The important question is what happens after the first real change, especially when the next task fails.

What check mode actually tells you
Modules that support check mode predict their changes; unsupported tasks can be skipped. A workflow that depends on results from an earlier change may therefore take a different path from a real run. Also inspect check_mode: false: that override allows a task to run normally even when the playbook uses --check. Ansible documents these limits explicitly.
For a reviewed playbook and an isolated test target, I would start with a narrow preview, not the complete inventory:
ansible-playbook service.yml --check --diff \
--limit test01.example.com
The hostname above is fictional. Review overrides and module support before running it. Diffs can expose secrets: disable them on sensitive tasks with diff: false and review the rest of the logging separately. A quiet output is not evidence that every intended task was tested.
A small failure with a large consequence
Consider a fictional service change: render a configuration, reload the service, then test an endpoint. The configuration task succeeds, but the reload fails. The file on disk is now new; the running process may still use the old configuration. Re-running the playbook without inspecting that state can obscure the original failure.
| Observation | What it proves | What it does not |
|---|---|---|
| Template changed | The file was updated | The service accepted it |
| Reload succeeded | The reload task succeeded | The user-facing path works |
| Endpoint test passed | That tested path works | Recovery has been tested |
Put validation before the commit
For file-based changes, ansible.builtin.template offers validate: it checks a temporary file before placing it at the destination. The validator must suit the application and its dependencies. This catches a different class of problem from a post-change health check. Template module reference.
Define the stop condition as well. By default, a failed task stops execution on that host, not necessarily on every other host. any_errors_fatal changes that behaviour, but it does not reverse completed tasks. Error-handling reference.
What happens to a notified handler after a later task fails?
Consider one isolated test host. A template task changes a service file and notifies its reload handler. A later task fails before the normal handler flush. By default the previously notified handler does not run on that failed host. The file on disk can now differ from the configuration loaded by the running process. A handler that actually ran and returned an error is a separate failure with a different task record.
| Evidence to capture | What decides the next step |
|---|---|
| File: checksum and validation result | Did the validated revision reach disk? If it did, compare it to the last approved revision. |
| Process: handler output and active configuration | Was a handler notified, did it run, and did the service accept the reload? A running PID alone cannot answer these questions. |
| User path: representative request | Confirm expected behaviour on the same target after reload or recovery. Record the request result and timestamp. |
In a rehearsal, identify the host and ansible-core/collection versions, capture the three observations, and repeat after restoring the last approved file and reloading. force_handlers can run notified handlers on hosts with earlier failures, subject to conditions such as reachability. meta: flush_handlers executes handlers notified up to that point. Choose either only when applying the pending change at that point is safe. Neither reverses already completed tasks.
Ansible check and diff modes · Errors and handlers · Handler execution order and flushing.
My acceptance test
I want four pieces of evidence: the intended diff, a successful real run on a representative test target, a service-level check, and a rehearsed recovery from partial completion. For the example above, that recovery may mean restoring the previous file, reloading it and testing the endpoint again. It must be deliberately implemented and tested.
That is the difference between a playbook that runs and a change I can reason about when something goes wrong. My infrastructure automation approach shows how teams can build these checks into recurring changes.
Technical references checked 17 November 2026. Generic example, not a customer runbook. Validate behaviour against the ansible-core and collection versions you deploy.
