Some useful things for controlling serial/parallel execution in Ansible.
-
forks=1
can be set so that one host task is executed at a time until completion before the next task is started. -
serial
can be set per-play so that all tasks run to completion on one host at a time. -
Playbook strategies can be set. The default behavior is
linear
. Aserial
strategy is also available. Finally, afree
strategy is available that allows hosts to continue running subsequent tasks before all hosts completed the same task.