Interview Prep/Ansible/Inventory and Targeting

You need to send a one-off command to 500 hosts quickly without overloading the jump host.

IntermediateScenarioInventory and Targeting
Answer

Situation read → High parallelism meets a bottleneck.

What I'd do →

ansible all -m ansible.builtin.command -a "uptime" -f 20

and enable SSH pipelining and ControlPersist in ansible.cfg.

Why → -f caps concurrent connections (default 5); tune it to what the bastion's MaxStartups and CPU allow.

Interview tip → Mention that the default forks = 5 is deliberately conservative.

All Ansible questions Roadmap: Ansible

More on Inventory and Targeting