From f2bdd9af29f2e7fb58651be2972541a0fbdd82bd Mon Sep 17 00:00:00 2001 From: Piyush Date: Thu, 16 Jul 2015 17:40:43 +0530 Subject: [PATCH] Fix #11369 A result is skipped when all it's children are skipped. This makes it fundamentally different from a result that was changed/failed/unreachable --- lib/ansible/executor/task_result.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/ansible/executor/task_result.py b/lib/ansible/executor/task_result.py index ad209a036c..d633f20736 100644 --- a/lib/ansible/executor/task_result.py +++ b/lib/ansible/executor/task_result.py @@ -40,7 +40,14 @@ class TaskResult: return self._check_key('changed') def is_skipped(self): - return self._check_key('skipped') + if 'results' in self._result: + flag = True + for res in self._result.get('results', []): + if isinstance(res, dict): + flag &= res.get('skipped', False) + return flag + else: + return self._result.get('skipped', False) def is_failed(self): if 'failed_when_result' in self._result or \