Handle notifications when coupled with a loop

Fixes #11606
This commit is contained in:
James Cammarata 2015-07-17 12:02:26 -04:00
parent 319812542f
commit 5abdd3b821
3 changed files with 28 additions and 14 deletions

View file

@ -23,7 +23,13 @@ class ActionModule(ActionBase):
def run(self, tmp=None, task_vars=dict()):
#vv("REMOTE_MODULE %s %s" % (module_name, module_args), host=conn.host)
return self._execute_module(tmp, task_vars=task_vars)
results = self._execute_module(tmp, task_vars=task_vars)
# Remove special fields from the result, which can only be set
# internally by the executor engine. We do this only here in
# the 'normal' action, as other action plugins may set this.
for field in ('ansible_facts', 'ansible_notify'):
if field in results:
results.pop(field)
return results