-
Notifications
You must be signed in to change notification settings - Fork 398
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
ec2_asg: Add purge_tags to AutoScalingGroups. #960
Merged
softwarefactory-project-zuul
merged 11 commits into
ansible-collections:main
from
mandar242:ec2_asg_tags
Mar 11, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
2f972ba
WIP: describe asg tags
mandar242 d718135
WIP: handle basic add, delete, list tags cases
mandar242 4de12e4
Fix redundant code for add/remove tags
mandar242 2da9096
Add integration tests to test tag operations
mandar242 3cbda28
Sanity fixes, changelogs fragment
mandar242 046c440
Handle non-existing tags removal
mandar242 8452d4a
Remove list_tags, remove_tags
mandar242 6d606d0
Fix changelogs fragment
mandar242 3d01096
Modified tests based on feedback
mandar242 43d67eb
Add more tests
mandar242 4c32a8f
Handle remove all tags, move tag related tests to single file
mandar242 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
minor_changes: | ||
- ec2_asg - add support for ``purge_tags`` to ec2_asg (https://github.com/ansible-collections/community.aws/pull/960). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Forgive me for commenting on an already merged PR, but I just found out about this from a complete breakage of all ansible AWS services that use tags.
Why was
default=True
chosen, for a new field that no one was using previously, deemed a good idea?Now, everything that touches any asset that uses tags MUST now add a
purge_tags: False
just to leave things as they are??Otherwise all tags are deleted???
Existing use case to scale in/out an ASG, and touch nothing else:
Now, the above and strips all tags as well.
Given that most ASG tags are used to propagate context information to the ec2 instances, this now destroys all context information for the ASG and the instances it creates have no information about the runtime context.
How is that the "principle of least surprising behavior"?
This now requires adding the purge_tags: False everywhere where tags could be impacted.
This is the ONLY case where one has to specify a non-default option just to say: "leave alone".
Note also that
is NOT backwards compatible, because that field didn't exist in previous versions, so you need 2 different cases depending on which side of this version you fall on.
Given that the
purge_tags
things seems to have propagated to many AWS assets, all in slightly different releases, one needs to account for this on a case by case basis depending on when thepurge_tags
was introduced into each module.Now, if the default had been
purge_tags=False
, none of this would be an issue.There would have been no changes required as the new behavior would match the old.
Am I the only one complaining about this? I can't believe this didn't hit more people.
Does no use use ansible to alter "only what is specified" and expect the rest to remain as-is?
I can't decide now whether to walk away from ansible as an AWS "minor edit" tool or, try deal with this "maybe we'll change something that destroys something else later, that you can't know about until it happens.