mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-18 06:11:07 -07:00
Reworking internal result flags and making sure include_vars hides vault data
Fixes #10194
This commit is contained in:
parent
eebf437d87
commit
cb262449c7
7 changed files with 30 additions and 27 deletions
|
@ -131,19 +131,19 @@ class ResultProcess(multiprocessing.Process):
|
|||
|
||||
for result_item in result_items:
|
||||
# if this task is notifying a handler, do it now
|
||||
if 'ansible_notify' in result_item:
|
||||
if '_ansible_notify' in result_item:
|
||||
if result.is_changed():
|
||||
# The shared dictionary for notified handlers is a proxy, which
|
||||
# does not detect when sub-objects within the proxy are modified.
|
||||
# So, per the docs, we reassign the list so the proxy picks up and
|
||||
# notifies all other threads
|
||||
for notify in result_item['ansible_notify']:
|
||||
for notify in result_item['_ansible_notify']:
|
||||
if result._task._role:
|
||||
role_name = result._task._role.get_name()
|
||||
notify = "%s : %s" % (role_name, notify)
|
||||
self._send_result(('notify_handler', result, notify))
|
||||
# now remove the notify field from the results, as its no longer needed
|
||||
result_item.pop('ansible_notify')
|
||||
result_item.pop('_ansible_notify')
|
||||
|
||||
if 'add_host' in result_item:
|
||||
# this task added a new host (add_host module)
|
||||
|
|
|
@ -346,7 +346,7 @@ class TaskExecutor:
|
|||
# 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 is not None:
|
||||
result['ansible_notify'] = self._task.notify
|
||||
result['_ansible_notify'] = self._task.notify
|
||||
|
||||
# and return
|
||||
debug("attempt loop complete, returning result")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue