From 79731ce49183ff04909e247fb81d07dcdb5aef70 Mon Sep 17 00:00:00 2001 From: James Cammarata Date: Wed, 14 May 2014 16:04:37 -0500 Subject: [PATCH] Evaluate changed_when only if task is not skipped Fixes #7405 --- lib/ansible/runner/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/runner/__init__.py b/lib/ansible/runner/__init__.py index 39e8a9378ab..adc9b7bcbd1 100644 --- a/lib/ansible/runner/__init__.py +++ b/lib/ansible/runner/__init__.py @@ -900,7 +900,7 @@ class Runner(object): if (module_name == 'async_status' and "finished" in data) or module_name != 'async_status': if changed_when is not None and 'skipped' not in data: data['changed'] = utils.check_conditional(changed_when, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars) - if failed_when is not None: + if failed_when is not None and 'skipped' not in data: data['failed_when_result'] = data['failed'] = utils.check_conditional(failed_when, self.basedir, inject, fail_on_undefined=self.error_on_undefined_vars) if is_chained: