Interview Prep/Ansible/Vault, Performance and Execution Behaviour

On 300 hosts, every task seems to run in batches of five

BeginnerTroubleshootingVault, Performance and Execution Behaviour
Answer

Likely causes → The default forks is 5. Ansible only talks to five hosts at a time per task.

Diagnose → ansible-config dump | grep -i forks

Fix →

[defaults]
forks = 50

Size this to the controller's CPU and memory. Every fork is a Python process.

Prevent → Set forks in the project's ansible.cfg, and measure with callbacks_enabled = ansible.posix.profile_tasks, ansible.posix.timer.

All Ansible questions Roadmap: Ansible

More on Vault, Performance and Execution Behaviour