Strategies

Strategies are a way to control play execution. By default, plays run with a linear strategy, in which all hosts will run each task before any host starts the next task, using the number of forks (default 5) to parallelize.

The serial directive can ‘batch’ this behaviour to a subset of the hosts, which then run tocompletion of the play before the next ‘batch’ starts.

A second strategy ships with Ansible - free - which allows each host to run until the end ofthe play as fast as it can.:

  1. - hosts: all
  2. strategy: free
  3. tasks:
  4. ...

Strategy Plugins

The strategies are implemented as plugins. In the future, newexecution strategies can be added, either locally by users or to Ansible itself bya code contribution.

One example is debug strategy. See Playbook Debugger for details.

See also