ansible/docs/docsite/rst/plugins/strategy.rst
Alicia Cozine c8a9b411bc
Last docs link fixes (#39391)
* should not need <>, but fails without

* adds anchor to keywords page, uses it on plugins pages

* fixes envvar link errors

* harmonize file name and ref name as python_3

* removes undefined-lable from ignore list
2018-04-27 13:21:39 -05:00

2.1 KiB

Topics

Strategy Plugins

Strategy plugins control the flow of play execution by handling task and host scheduling.

Enabling Strategy Plugins

Strategy plugins shipped with Ansible are enabled by default. You can enable a custom strategy plugin by putting it in one of the lookup directory sources configured in ansible.cfg <ansible_configuration_settings>.

Using Strategy Plugins

Only one strategy plugin can be used in a play, but you can use different ones for each play in a playbook or ansible run. The default is the linear <strategy/linear> plugin. You can change this default in Ansible configuration <ansible_configuration_settings> using an environment variable:

export ANSIBLE_STRATEGY=free

or in the ansible.cfg file:

[defaults]
strategy=linear

You can also specify the strategy plugin in the play via the strategy keyword <playbook_keywords> in a play:

- hosts: all
  strategy: debug
  tasks:
    - copy: src=myhosts dest=/etc/hosts
      notify: restart_tomcat

    - package: name=tomcat state=present

  handlers:
    - name: restart_tomcat
      service: name=tomcat state=restarted

Plugin List

You can use ansible-doc -t strategy -l to see the list of available plugins. Use ansible-doc -t strategy <plugin name> to see plugin-specific specific documentation and examples.

maxdepth

1

strategy/*

about_playbooks

An introduction to playbooks

inventory

Ansible inventory plugins

callback

Ansible callback plugins

playbooks_filters

Jinja2 filter plugins

playbooks_tests

Jinja2 test plugins

playbooks_lookups

Jinja2 lookup plugins

User Mailing List

Have a question? Stop by the google group!

irc.freenode.net

#ansible IRC chat channel