From af689dece3d5830a4e064b20065700cd84c59a23 Mon Sep 17 00:00:00 2001 From: Jan Brauer Date: Wed, 21 Jan 2015 13:36:36 +0100 Subject: [PATCH] Handle the case where a stack rollback fails. --- lib/ansible/modules/cloud/amazon/cloudformation.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/ansible/modules/cloud/amazon/cloudformation.py b/lib/ansible/modules/cloud/amazon/cloudformation.py index 39b6f81a44..eb49f66805 100644 --- a/lib/ansible/modules/cloud/amazon/cloudformation.py +++ b/lib/ansible/modules/cloud/amazon/cloudformation.py @@ -191,6 +191,11 @@ def stack_operation(cfn, stack_name, operation): events = map(str, list(stack.describe_events())), output = 'Stack %s failed' % operation) break + elif '%s_ROLLBACK_FAILED' % operation == stack.stack_status: + result = dict(changed=True, failed=True, + events = map(str, list(stack.describe_events())), + output = 'Stack %s rollback failed' % operation) + break else: time.sleep(5) return result