There are 4 strategies that can be used.
The ansible-doc command can be used to display documentation on the each strategy.
ansible-doc -t strategy --snippet free
Let's consider the scenario where Ansible is being used to perform two (or more) tasks on managed nodes (e.g. target systems). For example, let's say the file module is being used to create two directories, /tmp/foo and /tmp/bar.
--- - hosts: all tasks: - name: mkdir /tmp/foo file: path: /tmp/foo state: directory - name: mkdir /tmp/bar file: path: /tmp/bar state: directory ...
By default, Ansible uses the linear strategy, which means that each task is performed against all of the managed nodes before moving onto the next task. Let's say you have 5 managed nodes in your inventory, server1 through server5. In this example, this would mean that the /tmp/foo directory would be created on server1 through server5 before moving onto the task to create the /tmp/bar directory on server1 through server5.
With the free strategy, each managed node will go through each task in the playbook independently, with the goal being for each managed node to complete the playbook as quickly as possible.
To use the free strategy, you could include strategy: free in your playbook.
--- - hosts: all strategy: free
Or you could set the the strategy to free in ansible.cfg, which would make free the default strategy for all playbooks.
strategy = free
Or you could set the ANSIBLE_STRATEGY environmental variable to free for your current shell.