forks
The setting for how many hosts Ansible works on at the same time, using that many parallel worker processes on the control node.
In more detail
The default is 5. More forks can shorten a run across many hosts, but they add load on the control node and on shared services the hosts use. Measure a real workload before raising it, and keep the chosen value in ansible.cfg with a note on why.
Example
forks = 10Related terms
- ansible.cfg — Ansible's INI-format settings file; a copy in the project directory sets options such as the inventory location and forks for everyone who runs there.
- control node — The machine where Ansible is installed and where you run its commands; it reaches out to every other machine it manages.
Taught in
- Performance, Forks And Best Practices — Ansible Configuration Management at Scale
- ansible.cfg: Which File Wins, And The Settings That Matter — RHCE in Ansible (EX294): Automate Red Hat Systems
References
- Controlling playbook execution: setting the number of forks
- Ansible configuration settings: DEFAULT_FORKS