Hands-on Lab·Ansible
Ansible forks, serial and Rolling Changes
`forks` and `serial` both control parallelism and they are not the same thing. Forks is how many hosts Ansible works on simultaneously; serial splits the play into batches that each complete fully before the next begins. That difference is what turns a play into a rolling deployment, and it is visible in the output.
Scale and Debugging Guide 37 of 45 Intermediate
- OSUbuntu 26.04 LTS
- ansible-core2.20.1
- Python3.14.4
- TimeAbout 15 min
- Reviewed23 August 2026
Written against the versions above. `serial` accepts a number, a percentage (`serial: 25%`) or a list (`serial: [1, 5, 10]`) for a canary batch followed by progressively larger ones. Combined with `max_fail_percentage` it is how a large rollout is made safe - stop after the first batch if too much of it fails.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| ANS-CTL01 | 192.168.0.36 | Ubuntu 26.04 LTS | Ansible Control Node | 2 Core | 3 GB | 50 GB |
| ANS-A01 | 192.168.0.37 | Ubuntu 26.04 LTS | Managed Node (group: web) | 2 Core | 3 GB | 50 GB |
| ANS-B01 | 192.168.0.38 | Ubuntu 26.04 LTS | Managed Node (group: db) | 2 Core | 3 GB | 50 GB |
Before you start
- A control node configured as shown in the first step.
- The session runs several short playbooks and changes nothing on the managed nodes.
-
The configuration this guide assumes
-
forks is how many hosts at once
-
serial turns one play into batches
-
run_once and delegate_to
-
Throttling one task