2015-07-20 02:35:49 +00:00
|
|
|
Strategies
|
2015-07-17 17:53:13 +00:00
|
|
|
===========
|
|
|
|
|
|
|
|
In 2.0 we added a new way to control play execution, ``strategy``, by default plays will
|
|
|
|
still run as they used to, with what we call the ``linear`` strategy. All hosts will run each
|
2015-07-20 16:31:35 +00:00
|
|
|
task before any host starts the next task, using the number of forks (default 5) to parallelize.
|
2015-07-17 17:53:13 +00: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.
|
|
|
|
|
|
|
|
A second ``strategy`` ships with ansible ``free``, which allows each host to run until the end of
|
|
|
|
the play as fast as it can.::
|
|
|
|
|
|
|
|
- hosts: all
|
|
|
|
strategy: free
|
|
|
|
tasks:
|
|
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
.. _strategy_plugins:
|
|
|
|
|
2015-07-19 21:27:13 +00:00
|
|
|
Strategy Plugins
|
2015-07-17 17:53:13 +00:00
|
|
|
`````````````````
|
|
|
|
|
2015-10-20 15:38:16 +00:00
|
|
|
The strategies are implemented via a new type of plugin, this means that in the future new
|
2015-07-19 21:33:26 +00:00
|
|
|
execution types can be added, either locally by users or to Ansible itself by
|
2015-07-17 17:53:13 +00:00
|
|
|
a code contribution.
|
|
|
|
|
2016-04-08 18:39:08 +00:00
|
|
|
One example is ``debug`` strategy. See :doc:`playbooks_debugger` for details.
|
|
|
|
|
2015-07-17 17:53:13 +00:00
|
|
|
.. seealso::
|
|
|
|
|
|
|
|
:doc:`playbooks`
|
|
|
|
An introduction to playbooks
|
2017-06-06 21:39:48 +00:00
|
|
|
:doc:`playbooks_reuse_roles`
|
2015-07-17 17:53:13 +00:00
|
|
|
Playbook organization by roles
|
|
|
|
`User Mailing List <http://groups.google.com/group/ansible-devel>`_
|
|
|
|
Have a question? Stop by the google group!
|
|
|
|
`irc.freenode.net <http://irc.freenode.net>`_
|
|
|
|
#ansible IRC chat channel
|
|
|
|
|