Strategies: linear, free & host_pinned
Change how plays sweep hosts.
Strategies: linear, free & host_pinned is a free DevOps Bootcamp lesson on CoddyKit. This is lesson 2 of 4. Any 3 lessons of this learning path are free to read in full — after that, CoddyKit PRO unlocks every lesson, plus hands-on practice with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, and your progress syncs across the web and the CoddyKit app. The DevOps Bootcamp course includes 4 lessons in total.
Strategy Sets the Pace
A strategy plugin decides how hosts march through the tasks of a play. It controls whether they move in step or each go at their own speed.
linear Is the Default
The default linear strategy runs one task on every host, waits for all to finish, then moves to the next task together.
- hosts: web
strategy: linearWhy linear Can Drag
With linear, the slowest host on each task holds everyone back. Fast servers sit idle waiting for the laggard before the play advances.
free Lets Hosts Sprint
The free strategy removes the wall. Each host races through its tasks as fast as it can, never waiting for the others to catch up.
- hosts: web
strategy: freefree Trades Order for Speed
With free, hosts finish at different times and output interleaves. You gain speed but lose the tidy task-by-task synchronization.
When free Shines
Reach for free when hosts are independent and some are much slower. Avoid it when one host must finish a step before another begins.
Meet host_pinned
The host_pinned strategy keeps a worker glued to one host until that host is done, instead of round-robining across the whole fleet.
- hosts: web
strategy: host_pinnedWhy Pinning Helps
By finishing hosts fully before grabbing new ones, host_pinned caps how many machines are touched at once, easing load on backends like a license server.
Set It Per Play
Strategy is a play-level key, so different plays in one file can use different strategies. Pick the best fit for each phase of work.
Or Set a Default
Choose a project-wide default under the strategy key in ansible.cfg. The per-play setting still wins whenever you override it.
[defaults]
strategy = freeStrategy Plus Forks
Strategy decides how hosts flow, while forks caps how many run at once. Tune both together to get the throughput you want.
Quick Check
One host in your batch is far slower than the rest and stalls the play.
Recap
linear keeps hosts in step, free lets them sprint independently, and host_pinned finishes one host before starting the next. Pick per play. 🏁
Learn DevOps Bootcamp with an AI tutor — free
Write and run real code in your browser, get instant help from a 24/7 AI tutor, and pick up where you left off on the web or in the app.
- Courses
- 142
- Lessons
- 568
Frequently Asked Questions
Is the “Strategies: linear, free & host_pinned” lesson free?
Yes — any 3 lessons of the DevOps Bootcamp learning path, including “Strategies: linear, free & host_pinned”, are free to read in full here on the web. After that, CoddyKit PRO unlocks every lesson, plus interactive practice with a built-in code editor and a 24/7 AI tutor. The DevOps Bootcamp course includes 4 lessons in total.
What will I learn in “Strategies: linear, free & host_pinned”?
Change how plays sweep hosts. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start DevOps Bootcamp?
No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners, so you can start here or from the beginning and move at your own pace. This is lesson 2 of 4.
How long does the “Strategies: linear, free & host_pinned” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this DevOps Bootcamp lesson?
Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- forks & Parallelism Tuning
- Strategies: linear, free & host_pinned
- SSH Pipelining & Connection Reuse
- serial & Rolling Batch Execution