From 61cc8b235614c9fbbe1446e071cf3b46a43c61bf Mon Sep 17 00:00:00 2001 From: Ted Timmons Date: Thu, 30 Nov 2017 06:08:30 -0800 Subject: [PATCH] [cloud] Skip StackPolicy when operating on ChangeSets in CloudFormation module (#33401) Really, the Policy only works on 'create' and 'update'. (rm my outdated comments too) --- lib/ansible/modules/cloud/amazon/cloudformation.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/cloudformation.py b/lib/ansible/modules/cloud/amazon/cloudformation.py index 6675445025c..f0a94dd0eb5 100644 --- a/lib/ansible/modules/cloud/amazon/cloudformation.py +++ b/lib/ansible/modules/cloud/amazon/cloudformation.py @@ -5,13 +5,6 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -# upcoming features: -# - Ted's multifile YAML concatenation -# - changesets (and blocking/waiting for them) -# - finish AWSRetry conversion -# - move create/update code out of main -# - unit tests - ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['stableinterface'], 'supported_by': 'core'} @@ -540,10 +533,9 @@ def main(): stack_params['NotificationARNs'] = [] # can't check the policy when verifying. - if module.params['stack_policy'] is not None and not module.check_mode: + if module.params['stack_policy'] is not None and not module.check_mode and not module.params['create_changeset']: stack_params['StackPolicyBody'] = open(module.params['stack_policy'], 'r').read() - template_parameters = module.params['template_parameters'] stack_params['Parameters'] = [{'ParameterKey':k, 'ParameterValue':str(v)} for k, v in template_parameters.items()]