mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
Make on_file_diff callback item-aware
This commit is contained in:
parent
04d74fd680
commit
14e19c239d
4 changed files with 22 additions and 4 deletions
|
@ -134,7 +134,14 @@ class CallbackModule(CallbackBase):
|
|||
self._display.banner(msg)
|
||||
|
||||
def v2_on_file_diff(self, result):
|
||||
if 'diff' in result._result and result._result['diff']:
|
||||
if result._task.loop and 'results' in result._result:
|
||||
for res in result._result['results']:
|
||||
newres = self._copy_result(result)
|
||||
res['item'] = self._get_item(res)
|
||||
newres._result = res
|
||||
|
||||
self.v2_on_file_diff(newres)
|
||||
elif 'diff' in result._result and result._result['diff']:
|
||||
self._display.display(self._get_diff(result._result['diff']))
|
||||
|
||||
def v2_playbook_item_on_ok(self, result):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue