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

@ -330,6 +330,12 @@ class TaskExecutor:
if 'ansible_facts' in result:
variables.update(result['ansible_facts'])
# save the notification target in the result, if it was specified, as
# this task may be running in a loop in which case the notification
# may be item-specific, ie. "notify: service {{item}}"
if self._task.notify:
result['ansible_notify'] = self._task.notify
# and return
debug("attempt loop complete, returning result")
return result