From 78e4f176e61673b4f52ad952e96ed431dd4b7148 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Thu, 19 Nov 2015 08:29:15 -0500 Subject: [PATCH] Return skipped/failed async results directly Fixes #13205 --- lib/ansible/executor/task_executor.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/ansible/executor/task_executor.py b/lib/ansible/executor/task_executor.py index fb1e57d4ce..27e11bed79 100644 --- a/lib/ansible/executor/task_executor.py +++ b/lib/ansible/executor/task_executor.py @@ -405,6 +405,8 @@ class TaskExecutor: # the async_wrapper module returns dumped JSON via its stdout # response, so we parse it here and replace the result try: + if 'skipped' in result and result['skipped'] or 'failed' in result and result['failed']: + return result result = json.loads(result.get('stdout')) except (TypeError, ValueError) as e: return dict(failed=True, msg="The async task did not return valid JSON: %s" % str(e))