Use it when configuring, checking or troubleshooting Serial Execution in Ansible.
Serial Execution
Ansible serial execution limits a play to batches of hosts, allowing staged changes and validation while later batches wait for earlier batch progression.
1. serial runs plays in batches for rolling updates.
2. Combine with health checks and max_fail_percentage.
3. Drain/undrain from load balancers.
4. Start with a canary.
5. Stop on failures.
batch 1 → health check → batch 2 …
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
selected hosts/order → serial batching → per-host tasks/handlers → batch acceptance → next batch → fleet acceptance
Healthy evidence: batch membership/order are intentional, acceptance gates run between batches and final fleet/service state is verified.
Step 2 Failure modes and next checks Narrow the fault
Suspicious evidence: unexpected ordering, no health gate, partial fleet changed after failure, unsuitable failure threshold or assuming serial automatically preserves availability.
Step 3 Common mistakes Narrow the fault
serialtoo large for safe rolling changes.- No
max_fail_percentage.
Step 4 Where it fails Narrow the fault
Where Serial Execution usually goes wrong: batch size, failure threshold, rollout ordering and partial fleet state.
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.
- 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.
- serial: 1 / '25%' — batches
- max_fail_percentage — stop rollout
ansible-playbook rolling.yml --check— preview
ReferenceWhat it is1 section · depth on demand
Core model
Validate serial batch size/percentage, inventory ordering, failure thresholds, handler timing and acceptance checks between batches before relying on rollout safety.
ReferenceImportant terms & boundaries2 sections · depth on demand
What this shows and what it does not
A serial batch completing shows that batch ran; it does not provide rollback or show fleet/service health unless explicit checks verify those properties.
In depth
Serial execution (serial: on a play) runs the play on hosts in batches, finishing each batch before starting the next. It enables rolling updates where only part of the fleet is affected at a time.
- hosts: web
serial: [1, 25%, 50%] # canary, then larger batches
max_fail_percentage: 10
tasks:
- ansible.builtin.include_role: { name: patch }
| Setting | Effect |
|---|---|
serial: 1 | One host at a time |
| Percentages | Batches relative to group size |
max_fail_percentage | Stop the rollout if too many fail |
any_errors_fatal | Stop everything on first failure |
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 > Serial Execution. 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
Serial Execution Ansible boundary map
Fast input/selection, execution/result and target-proof boundaries for Serial Execution.
| 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 |
Deep reference
Healthy vs suspicious evidence
Output interpretation
For Serial Execution, rely on structured fields and stable IDs (batch size, failure threshold, rollout ordering and partial fleet state) rather than text formatted for display.