mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
ec2_group: prioritise current VPC group names over others
This commit is contained in:
@@ -223,7 +223,12 @@ def main():
|
||||
groups = {}
|
||||
for curGroup in ec2.get_all_security_groups():
|
||||
groups[curGroup.id] = curGroup
|
||||
groups[curGroup.name] = curGroup
|
||||
if curGroup.name in groups:
|
||||
# Prioritise groups from the current VPC
|
||||
if vpc_id is None or curGroup.vpc_id == vpc_id:
|
||||
groups[curGroup.name] = curGroup
|
||||
else:
|
||||
groups[curGroup.name] = curGroup
|
||||
|
||||
if curGroup.name == name and (vpc_id is None or curGroup.vpc_id == vpc_id):
|
||||
group = curGroup
|
||||
|
||||
Reference in New Issue
Block a user