ansible.plugins.strategy package

class ansible.plugins.strategy.StrategyBase(tqm)[source]

Bases: object

This is the base class for strategy plugins, which contains some common code useful to all strategies like running handlers, cleanup actions, etc.

run(iterator, play_context, result=True)[source]
get_hosts_remaining(play)[source]
get_failed_hosts(play)[source]
add_tqm_variables(vars, play)[source]

Base class method to add extra variables/information to the list of task vars sent through the executor engine regarding the task queue manager state.

run_handlers(iterator, play_context)[source]

Runs handlers on those hosts which have been notified.

Submodules

ansible.plugins.strategy.debug module

class ansible.plugins.strategy.debug.NextAction(result=3)[source]

Bases: object

The next action after an interpreter’s exit.

REDO = 1
CONTINUE = 2
EXIT = 3
class ansible.plugins.strategy.debug.StrategyModule(tqm)[source]

Bases: ansible.plugins.strategy.linear.StrategyModule

class ansible.plugins.strategy.debug.Debugger(strategy_module, results, next_action)[source]

Bases: cmd.Cmd

prompt = '(debug) '
prompt_continuous = '> '
cmdloop()[source]
do_EOF(args)[source]
do_quit(args)[source]
do_q(args)
do_continue(args)[source]
do_c(args)
do_redo(args)[source]
do_r(args)
evaluate(args)[source]
do_p(args)[source]
execute(args)[source]
default(line)[source]

ansible.plugins.strategy.free module

class ansible.plugins.strategy.free.StrategyModule(tqm)[source]

Bases: ansible.plugins.strategy.StrategyBase

run(iterator, play_context)[source]

The “free” strategy is a bit more complex, in that it allows tasks to be sent to hosts as quickly as they can be processed. This means that some hosts may finish very quickly if run tasks result in little or no work being done versus other systems.

The algorithm used here also tries to be more “fair” when iterating through hosts by remembering the last host in the list to be given a task and starting the search from there as opposed to the top of the hosts list again, which would end up favoring hosts near the beginning of the list.

ansible.plugins.strategy.linear module

class ansible.plugins.strategy.linear.StrategyModule(tqm)[source]

Bases: ansible.plugins.strategy.StrategyBase

run(iterator, play_context)[source]

The linear strategy is simple - get the next task and queue it for all hosts, then wait for the queue to drain before moving on to the next task