From f217dae938dd451d32c54643ae98020cc592e63d 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 --- 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 b21cb68df4..f4f385e297 100644 --- a/lib/ansible/plugins/strategy/linear.py +++ b/lib/ansible/plugins/strategy/linear.py @@ -399,7 +399,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)