Playbook crawled with an idle controller CPU — `forks` too low, hosts waiting in line. Root cause: Too few forks serialized host execution. The fix: Raise `forks` (within `ulimit -n`); enable pipelining; `async` long tasks.
A production war story from the TheCodeForge Ansible series — the incident, why it happened, and the exact fix.
⏳ Timestamps:
0:00 - Cold open: 45 minutes
0:11 - Intro
0:18 - What Is Ansible Tuning?
0:35 - Forks: Parallelism Lever
1:05 - SSH Pipelining
1:37 - SSH ControlMaster
2:05 - Strategy Plugins
2:31 - Async Tasks
2:56 - Fact Caching with Redis
3:18 - Profiling with profile_tasks
3:39 - 45 minutes
4:02 - Default forks and pipelining
4:17 - The Fix
4:36 - ⚠ Gotcha: Default forks=5 and pipelining=False
4:49 - ⚠ Gotcha: Setting forks › ulimit -n
5:01 - ⚠ Gotcha: Enabling pipelining without disabling requiretty
5:12 - ⚠ Gotcha: Using free strategy with non-idempotent tasks
5:22 - ⚠ Gotcha: Setting ControlPersist too long (e.g., 600s)
5:32 - ⚠ Gotcha: Using poll:0 and never checking status
5:42 - ⚠ Gotcha: Using jsonfile caching for concurrent runs
5:52 - Version Compatibility: ControlPath and OpenSSH
6:34 - Production Caveat: Pipelining and become Methods
7:11 - Debugging Guide
7:22 - Interview Questions
7:41 - FAQ
7:55 - Key Takeaways
8:08 - Next up
8:23 - Wrap-up
👉 Full article + code: https://thecodeforge.io/devops/ansibl...
⏭ Next up: Ansible Linting and Testing with Molecule
#ansible #devops #automation