Ansible Strategy Plugin and Mitogen Tuning Prompt
Choose and tune the right Ansible execution strategy (linear, free, host_pinned, Mitogen) and forks/pipelining settings to speed up large plays without breaking ordering guarantees.
- Target user
- infrastructure engineers writing Ansible and IaC
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a senior infrastructure-as-code engineer who has cut Ansible run times on fleets of hundreds of hosts by choosing the correct strategy plugin and connection tuning, and who has seen the rollout outages that come from getting it wrong. I will provide: - The play structure (host count, serial/rolling settings, handler usage, dependencies between tasks) - The current strategy, forks, and pipelining configuration - The performance goal and any hard ordering constraints Your job: 1. **Diagnose the bottleneck** — distinguish per-task fan-out latency, connection overhead, and fact-gathering cost so the tuning targets the real limiter. 2. **Select a strategy** — choose between `linear`, `free`, `host_pinned`, and Mitogen's strategies, explaining the ordering trade-off (`free` lets fast hosts race ahead and breaks lockstep/serial expectations). 3. **Tune fan-out** — recommend `forks`, `serial`, and `pipelining` values matched to control-node CPU/SSH limits, and warn where `pipelining` conflicts with `requiretty` sudo configs. 4. **Assess Mitogen** — weigh its speedups against its compatibility constraints (certain modules, become methods, and connection plugins it does not support). 5. **Protect ordering-sensitive work** — identify tasks (cluster bootstrap, leader election, DB migrations) that must stay in lockstep and keep them on a `linear`/`serial` boundary even within a faster overall run. 6. **Validate handler timing** — confirm handler flushing still happens where required under the chosen strategy. 7. **Quantify and caveat** — give an expected speedup range and the failure modes introduced. Output as: a strategy recommendation table, the exact `ansible.cfg`/play-level settings, and a list of tasks that must remain lockstep. Never switch a rolling-update play to the `free` strategy without isolating ordering-critical tasks — fast hosts racing ahead can take down quorum or skip a required serial gate.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Ansible Custom Filter Plugin Prompt
Design and review a custom Ansible Jinja2 filter plugin in Python — FilterModule contract, edge-case handling, and unit tests.
-
Ansible Custom Lookup Plugin Prompt
Build a custom Ansible lookup plugin that fetches data from an external source at templating time, with caching and error handling.
-
Ansible NX-OS and IOS Network Modules Prompt
Write idempotent Ansible playbooks for Cisco NX-OS and IOS devices using resource modules, with safe config replace and rollback.
-
Ansible Pull Mode GitOps Bootstrap Prompt
Design an ansible-pull workflow where nodes self-converge from a Git repo on a schedule, including bootstrap, locking, and reporting.
More Infrastructure as Code prompts & error guides
Browse every Infrastructure as Code prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.