Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added the OnFailure option to the AWS CloudFormation module #52431

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
6 participants
@nathandines
Copy link

nathandines commented Feb 17, 2019

SUMMARY

Added the capability to define the OnFailure parameter for the CreateStack operation. This enables faster turnaround on CloudFormation template development as the stacks will clean up after themselves when configured (if configuring it to DELETE)

OnFailure is incompatible with DisableRollback, but I've covered that with some parameter validation in create_stack. This is a backwards compatible change.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

cloudformation

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 17, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 17, 2019

@nathandines, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@thecopy

This comment has been minimized.

Copy link

thecopy commented Feb 26, 2019

+1 This is greatly helpful. I work in an environment where i can commit to the branch which gets deployed to production and staging through CI, but i cannot personally with my role/user delete ROLLBACK_COMPLETED stacks. So currently i have to pollute the git commit log with "aws cloudformation" scripts to remove stacks

@ansibot ansibot added the stale_ci label Feb 26, 2019

@nathandines nathandines force-pushed the nathandines:feature/cloudformation-onfailure branch from 841c6ed to 170e9b7 Feb 26, 2019

@ansibot ansibot removed the stale_ci label Feb 26, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

ansibot commented Feb 26, 2019

The test ansible-test sanity --test pylint [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/cloudformation.py:540:201: bad-whitespace Exactly one space required after comma             console_url = 'https://%(region)s.console.aws.amazon.com/cloudformation/home?region=%(region)s#/stack/detail?stackId=%(stack_name)s' % {'region':region, 'stack_name': stack_name.replace('/','%2F') }                                                                                                                                                                                                          ^
lib/ansible/modules/cloud/amazon/cloudformation.py:540:209: bad-whitespace No space allowed before bracket             console_url = 'https://%(region)s.console.aws.amazon.com/cloudformation/home?region=%(region)s#/stack/detail?stackId=%(stack_name)s' % {'region':region, 'stack_name': stack_name.replace('/','%2F') }                                                                                                                                                                                                                  ^

The test ansible-test sanity --test pep8 [explain] failed with 4 errors:

lib/ansible/modules/cloud/amazon/cloudformation.py:540:157: E231 missing whitespace after ':'
lib/ansible/modules/cloud/amazon/cloudformation.py:540:161: E501 line too long (210 > 160 characters)
lib/ansible/modules/cloud/amazon/cloudformation.py:540:202: E231 missing whitespace after ','
lib/ansible/modules/cloud/amazon/cloudformation.py:540:209: E202 whitespace before '}'

click here for bot help

@nathandines nathandines force-pushed the nathandines:feature/cloudformation-onfailure branch 2 times, most recently from 0764e30 to bdce070 Feb 26, 2019

@ansibot ansibot removed the ci_verified label Feb 26, 2019

@nathandines nathandines force-pushed the nathandines:feature/cloudformation-onfailure branch from bdce070 to 8065d15 Feb 26, 2019

@ansibot ansibot added core_review and removed needs_revision labels Feb 26, 2019

@nathandines nathandines force-pushed the nathandines:feature/cloudformation-onfailure branch 4 times, most recently from 435c601 to 2164154 Feb 26, 2019

@nathandines

This comment has been minimized.

Copy link
Author

nathandines commented Feb 28, 2019

I know things are probably pretty busy with the 2.8-alpha1 core feature freeze coming up in mid-March.

Any chance I could get a review on this @tedder? Really hoping to squeeze it into 2.8 :)

@tedder

This comment has been minimized.

Copy link
Contributor

tedder commented Feb 28, 2019

That's really legit, especially with the tests. They certainly give more confidence in it. I'm not in a position where I can do much smoke testing of Ansible anymore- @thecopy since you were interested in this, can you try it out? Otherwise paging @jsmartin to look at it.

@AndrewHendry

This comment has been minimized.

Copy link

AndrewHendry commented Mar 1, 2019

Another vote for this feature. The ability to auto cleanup failed branch based stacks will be great for our workflows. Tested fine locally for me.

@nathandines

This comment has been minimized.

Copy link
Author

nathandines commented Mar 4, 2019

@tedder @jsmartin, any traction on this? Seems like it’s been tested successfully

@nathandines

This comment has been minimized.

Copy link
Author

nathandines commented Mar 6, 2019

@ryansb would you be able to review this?

@ansibot ansibot added the stale_ci label Mar 14, 2019

@nathandines nathandines force-pushed the nathandines:feature/cloudformation-onfailure branch from 2164154 to f9a5ad2 Mar 14, 2019

@ansibot ansibot removed the stale_ci label Mar 14, 2019

@ansibot ansibot added the stale_ci label Mar 22, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.