pull/84173/merge^2
Martin Krizek 2 weeks ago
parent e74f67fede
commit 658a2b3bd4

@ -134,6 +134,7 @@ class TaskExecutor:
deprecations = set() deprecations = set()
skipped = True skipped = True
changed = failed = unreachable = False changed = failed = unreachable = False
ignore_errors = ignore_unreachable = True
for item in res['results']: for item in res['results']:
skipped &= item.get('skipped', False) skipped &= item.get('skipped', False)
changed |= item.get('changed', False) changed |= item.get('changed', False)
@ -142,9 +143,9 @@ class TaskExecutor:
if failed_item: if failed_item:
# ignore errors globally only when all failed items ignore errors # ignore errors globally only when all failed items ignore errors
self._task.ignore_errors &= item.pop('_ansible_ignore_errors') ignore_errors &= item.pop('_ansible_ignore_errors')
if unreachable_item: if unreachable_item:
self._task.ignore_unreachable &= item.pop('_ansible_ignore_unreachable') ignore_unreachable &= item.pop('_ansible_ignore_unreachable')
warnings.update(item.pop('warnings', [])) warnings.update(item.pop('warnings', []))
deprecations.update(item.pop('deprecations', [])) deprecations.update(item.pop('deprecations', []))
@ -159,6 +160,9 @@ class TaskExecutor:
else: else:
res['msg'] = 'One or more items failed' if failed else 'All items completed' res['msg'] = 'One or more items failed' if failed else 'All items completed'
self._task.ignore_errors = ignore_errors
self._task.ignore_unreachable = ignore_unreachable
res.update( res.update(
skipped=skipped, skipped=skipped,
changed=changed, changed=changed,

Loading…
Cancel
Save