Commit 19fb4f86 by Petr Svoboda

Fail cloudformation operation when it is not completed successfully

When cloudformation operation is successfully submitted but some step
during stack creation or update fails, operation result should be
failed=True.
parent 9b5fb9ad
......@@ -141,12 +141,12 @@ def stack_operation(cfn, stack_name, operation):
output = 'Stack %s complete' % operation)
break
if '%s_ROLLBACK_COMPLETE' % operation == stack.stack_status:
result = dict(changed=True,
result = dict(changed=True, failed=True,
events = map(str, list(stack.describe_events())),
output = 'Problem with %s. Rollback complete' % operation)
break
elif '%s_FAILED' % operation == stack.stack_status:
result = dict(changed=False,
result = dict(changed=True, failed=True,
events = map(str, list(stack.describe_events())),
output = 'Stack %s failed' % operation)
break
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment