summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorSloane Hertel <19572925+s-hertel@users.noreply.github.com>2024-10-30 15:35:23 +0100
committerGitHub <noreply@github.com>2024-10-30 15:35:23 +0100
commit03acb22f99e0724f38c01a3dfe62574bc08febca (patch)
tree9aa6078684fb6e205f4420033000ffabc6964f10 /lib
parentAdd a test using ignore_errors as a variable (#84175) (diff)
downloadansible-03acb22f99e0724f38c01a3dfe62574bc08febca.tar.xz
ansible-03acb22f99e0724f38c01a3dfe62574bc08febca.zip
Fix returning unreachable for looped tasks (#84049)
* Fix returning unreachable for looped tasks Add tests for ignore_unreachable and loop
Diffstat (limited to 'lib')
-rw-r--r--lib/ansible/executor/task_executor.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py
index 7299d1a54b..ff1c33871f 100644
--- a/lib/ansible/executor/task_executor.py
+++ b/lib/ansible/executor/task_executor.py
@@ -150,6 +150,7 @@ class TaskExecutor:
if 'unreachable' in item and item['unreachable']:
item_ignore_unreachable = item.pop('_ansible_ignore_unreachable')
if not res.get('unreachable'):
+ res['unreachable'] = True
self._task.ignore_unreachable = item_ignore_unreachable
elif self._task.ignore_unreachable and not item_ignore_unreachable:
self._task.ignore_unreachable = item_ignore_unreachable