From a8f2b8f5ab572d6e932a1f1f035b6a06a0687f0c Mon Sep 17 00:00:00 2001 From: "Rob St. Marie" Date: Wed, 22 Aug 2018 10:54:31 -0700 Subject: [PATCH] CloudFormation: Allow failed changesets to gather stack_outputs (#43509) --- lib/ansible/modules/cloud/amazon/cloudformation.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/cloudformation.py b/lib/ansible/modules/cloud/amazon/cloudformation.py index 9d47c8bcb50..124dd019c1c 100644 --- a/lib/ansible/modules/cloud/amazon/cloudformation.py +++ b/lib/ansible/modules/cloud/amazon/cloudformation.py @@ -382,8 +382,10 @@ def create_changeset(module, stack_params, cfn, events_limit): elif newcs['Status'] == 'FAILED' and "The submitted information didn't contain changes" in newcs['StatusReason']: cfn.delete_change_set(ChangeSetName=cs['Id']) result = dict(changed=False, - output='Stack is already up-to-date, Change Set refused to create due to lack of changes.') - module.exit_json(**result) + output='The created Change Set did not contain any changes to this stack and was deleted.') + # a failed change set does not trigger any stack events so we just want to + # skip any further processing of result and just return it directly + return result else: break # Lets not hog the cpu/spam the AWS API