From 9322486ac3fd6c219b884fdf67403425fdcf445d Mon Sep 17 00:00:00 2001 From: Ted Timmons Date: Thu, 26 Oct 2017 09:32:48 -0700 Subject: [PATCH] Exclude stack policy when running in check mode. (#31940) Fixes #31931 --- lib/ansible/modules/cloud/amazon/cloudformation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/amazon/cloudformation.py b/lib/ansible/modules/cloud/amazon/cloudformation.py index ca9f5ed755f..1584cd6fc9f 100644 --- a/lib/ansible/modules/cloud/amazon/cloudformation.py +++ b/lib/ansible/modules/cloud/amazon/cloudformation.py @@ -539,7 +539,8 @@ def main(): else: stack_params['NotificationARNs'] = [] - if module.params['stack_policy'] is not None: + # can't check the policy when verifying. + if module.params['stack_policy'] is not None and not module.check_mode: stack_params['StackPolicyBody'] = open(module.params['stack_policy'], 'r').read()