From f67a59bce63af4d37d09a4c404c7544e7b2491ed Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 17 May 2017 09:41:48 -0500 Subject: [PATCH] Also check the iterator for failed host status in linear strategy When only looking at the failed state of the TaskResult, certain failures cause the linear strategy to fail out sooner than it should and not execute the always portion of blocks. Fixes #24301 (cherry picked from commit f217dae938dd451d32c54643ae98020cc592e63d) --- lib/ansible/plugins/strategy/linear.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/plugins/strategy/linear.py b/lib/ansible/plugins/strategy/linear.py index 801d7c80582..4b0f781c5d5 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -385,7 +385,7 @@ class StrategyModule(StrategyBase): failed_hosts = [] unreachable_hosts = [] for res in results: - if res.is_failed(): + if res.is_failed() and iterator.is_failed(res._host): failed_hosts.append(res._host.name) elif res.is_unreachable(): unreachable_hosts.append(res._host.name)