Serial Execution
Cheat sheet · https://pcornel.dk/topic.php?topic=5416
Answer
Ansible serial execution limits a play to batches of hosts, allowing staged changes and validation while later batches wait for earlier batch progression.
Remember
- serial: 1 ≠ transactional rollout; each host can still be left changed before a later failure.
- Batch completed ≠ service capacity healthy; external load/cluster checks may be required.
- Inventory order ≠ desired maintenance order unless explicitly controlled.
- Handler execution timing ≠ necessarily after entire fleet; batch/play semantics affect when actions occur.
First checks
- serial: 1 / '25%' — batches
- max_fail_percentage — stop rollout
ansible-playbook rolling.yml --check— preview
Verify in this order
batch 1 → health check → batch 2 …
Where it usually breaks
A serial batch completing proves that batch ran; it does not provide rollback or prove fleet/service health unless explicit checks verify those properties.
Inventory/vars → play/task selection → connection/become → module request → module result → target object read-back → handler/service effective state → workload verification.
Serial Execution Ansible boundary map
| 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 |
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5416