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.
More on Inventory and Targeting
You are handed a fresh Ansible project and 10 servers. How do you make sure Ansible can reach all of them before writing any playbook?BeginnerYour team keeps prod and staging hosts in one inventory file and someone ran a playbook on prod by mistake. How do you prevent it?IntermediateYou need to run a playbook on only the web servers in Mumbai that are not in the canary group. How?BeginnerServers are autoscaled in AWS and IPs change daily. How do you keep the inventory accurate?IntermediateA host is reachable by SSH on port 2222 with a different user from all others. How do you model that?BeginnerYou must configure servers in a private subnet that is only reachable through a bastion.Intermediate