Making task includes dynamic and fixing many other bugs

Dynamic task includes still need some work, this is a rough first version.
* doesn't work with handler sections of playbooks yet
* when using include + with*, the insertion order is backwards
* fix potential for task lists to be unsynchronized when using the linear
  strategy, as the include conditional could be predicated on an inventory
  variable
This commit is contained in:
James Cammarata 2015-02-12 18:11:08 +00:00 committed by vagrant
parent 62a6378c4a
commit 995aa8e24b
15 changed files with 153 additions and 292 deletions

View file

@ -50,14 +50,17 @@ class CallbackModule(CallbackBase):
def runner_on_ok(self, task, result):
if result._result.get('changed', False):
if result._task.action == 'include':
msg = 'included: %s for %s' % (result._task.args.get('_raw_params'), result._host.name)
color = 'cyan'
elif result._result.get('changed', False):
msg = "changed: [%s]" % result._host.get_name()
color = 'yellow'
else:
msg = "ok: [%s]" % result._host.get_name()
color = 'green'
if (self._display._verbosity > 0 or 'verbose_always' in result._result) and result._task.action != 'setup':
if (self._display._verbosity > 0 or 'verbose_always' in result._result) and result._task.action not in ('setup', 'include'):
indent = None
if 'verbose_always' in result._result:
indent = 4