-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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_group - fix VPC precedence for security group targets #45787
Conversation
Update the dictionary with the preferred values last to get the right order of VPC precedence Fixes ansible#45782
Hi @s-hertel, Thank you for the pullrequest, just so you are aware we have a dedicated Working Group for aws. |
@@ -855,6 +855,9 @@ def group_exists(client, module, vpc_id, group_id, name): | |||
if security_groups: | |||
groups = dict((group['GroupId'], group) for group in all_groups) | |||
groups.update(dict((group['GroupName'], group) for group in all_groups)) | |||
if vpc_id: |
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.
The VPC is used to filter above - but it doesn't only return results matching the VPC, it returns matches that meet at least one of the filters.
) Update the dictionary with the preferred values last to get the right order of VPC precedence Fixes ansible#45782 (cherry picked from commit 8d2df9b)
) Update the dictionary with the preferred values last to get the right order of VPC precedence Fixes ansible#45782 (cherry picked from commit 8d2df9b)
…) (#45815) * ec2_group - fix VPC precedence for security group targets (#45787) Update the dictionary with the preferred values last to get the right order of VPC precedence Fixes #45782 (cherry picked from commit 8d2df9b) * Fix ec2_group for EC2-Classic accounts (#46242) * Fix ec2_group for EC2-Classic accounts * changelog (cherry picked from commit 9efc3dc) * Merge changelogs
SUMMARY
Update the dictionary with the preferred values last to get the right order of VPC precedence
Fixes #45782
This should be backported to 2.6 and 2.7.
ISSUE TYPE
COMPONENT NAME
ec2_group
ANSIBLE VERSION