- Configuration File (ansible.cfg) Set the default value in your ansible.cfg file under the [defaults] section so it applies automatically to all runs:
Ini, TOML
[defaults]
forks = 5
How Forks Work
Default Value: Ansible defaults to 5 forks if no custom configuration is provided.
Impact of Lowering: Lowering the number of forks reduces total CPU and memory usage on the Ansible control node (and prevents worker crashes in resource-constrained environments), but it increases total playbook execution time for large inventories because hosts are processed in smaller sequential batches.
Top comments (0)