2018-04-25 20:18:52 +02:00
.. _playbooks_strategies:
2015-07-20 04:35:49 +02:00
Strategies
2015-07-17 19:53:13 +02:00
===========
2017-11-22 05:14:27 +01:00
Strategies are a way to control play execution. By default, plays run with a `` linear `` strategy, in which all hosts will run each task before any host starts the next task, using the number of forks (default 5) to parallelize.
2015-07-17 19:53:13 +02:00
The `` serial `` directive can 'batch' this behaviour to a subset of the hosts, which then run to
completion of the play before the next 'batch' starts.
2017-11-22 05:14:27 +01:00
A second `` strategy `` ships with Ansible - `` free `` - which allows each host to run until the end of
2015-07-17 19:53:13 +02:00
the play as fast as it can.::
- hosts: all
strategy: free
tasks:
...
2015-07-19 23:27:13 +02:00
Strategy Plugins
2015-07-17 19:53:13 +02:00
`` ` ` ` ` ` ` ` ` ` ` ` ` ` ``
2017-11-22 05:14:27 +01:00
The strategies are implemented as plugins. In the future, new
execution strategies can be added, either locally by users or to Ansible itself by
2015-07-17 19:53:13 +02:00
a code contribution.
2016-04-08 20:39:08 +02:00
One example is `` debug `` strategy. See :doc: `playbooks_debugger` for details.
2015-07-17 19:53:13 +02:00
.. seealso ::
:doc: `playbooks`
An introduction to playbooks
2017-06-06 23:39:48 +02:00
:doc: `playbooks_reuse_roles`
2015-07-17 19:53:13 +02:00
Playbook organization by roles
2018-07-21 15:48:47 +02:00
`User Mailing List <https://groups.google.com/group/ansible-devel> `_
2015-07-17 19:53:13 +02:00
Have a question? Stop by the google group!
`irc.freenode.net <http://irc.freenode.net> `_
#ansible IRC chat channel