diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index 2571b325885..beceef18481 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -465,7 +465,7 @@ class TaskExecutor: result['failed_when_result'] = result['failed'] = failed_when_result else: failed_when_result = False - result['failed'] = False + result['failed'] = result.get('failed', False) return failed_when_result if 'ansible_facts' in result: