Strategy plugins control the flow of play execution by handling task and host scheduling. For more information on using strategy plugins and other ways to control execution order, see Controlling playbook execution: strategies and more.
All 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.
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. By default, Ansible uses the linear plugin. You can change this default in Ansible configuration using an environment variable:
or in the
You can also specify the strategy plugin in the play with the strategy keyword in a play:
- hosts: all
- name: restart_tomcat
You can use
ansible-doc -t strategy -l to see the list of available plugins.
ansible-doc -t strategy <plugin name> to see plugin-specific documentation and examples.
- Ansible playbooks
An introduction to playbooks
- Inventory plugins
- Callback plugins
- Filter plugins
- Test plugins
- Lookup plugins
- User Mailing List
Have a question? Stop by the Google group!
- Real-time chat
How to join Ansible chat channels