New feature: add new meta action end_play

This feature also cleans up and extends the meta subsystem:
* Allows for some meta actions (noop, clear_facts, clear_host_errors,
  and end_play) to operate on a per-host basis, meaning they can work
  with the free strategy as expected.
* Allows for conditionals on meta tasks.
* Fixes a bug where (for the linear strategy) metas were not treated
  as a run_once task, meaning every host in inventory would run the
  meta task.

Fixes #1476
This commit is contained in:
James Cammarata 2016-07-08 16:08:38 -05:00
commit 78b8f81cab
3 changed files with 59 additions and 21 deletions

View file

@ -214,7 +214,10 @@ class StrategyModule(StrategyBase):
continue
if task.action == 'meta':
self._execute_meta(task, play_context, iterator)
# for the linear strategy, we run meta tasks just once and for
# all hosts currently being iterated over rather than one host
results.extend(self._execute_meta(task, play_context, iterator))
run_once = True
else:
# handle step if needed, skip meta actions as they are used internally
if self._step and choose_step: