Skip to content

Commit

Permalink
elb_classic_lb: fix - resolve security_group_ids when providing secur…
Browse files Browse the repository at this point in the history
…ity_group_names (#592)

elb_classic_lb: fix - resolve security_group_ids when providing security_group_names

SUMMARY

Fix failed to resolve security_group_ids when providing security_group_names.
Fix broken tasks in integration tests.
Fixes #589.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

elb_classic_lb

Reviewed-by: Mark Chappell <None>
Reviewed-by: None <None>
  • Loading branch information
mandar242 committed Dec 21, 2021
1 parent a6edc99 commit a2be6da
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
bugfixes:
- elb_classic_lb - handle security_group_ids when providing security_group_names and fix broken tasks in integration test (https://github.com/ansible-collections/amazon.aws/pull/592).
4 changes: 2 additions & 2 deletions plugins/modules/elb_classic_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def __init__(self, module):
if security_group_names:
# Use the subnets attached to the VPC to find which VPC we're in and
# limit the search
if self.elb.get('Subnets'):
if self.elb.get('Subnets', None):
subnets = set(self.elb.get('Subnets') + list(self.subnets or []))
else:
subnets = set(self.subnets)
Expand Down Expand Up @@ -2042,7 +2042,7 @@ def _get_vpc_from_subnets(self, subnets):
if len(vpc_ids) > 1:
self.module.fail_json("Subnets for an ELB may not span multiple VPCs",
subnets=subnet_details, vpc_ids=vpc_ids)
vpc_id = vpc_ids.pop()
return vpc_ids.pop()

@AWSRetry.jittered_backoff()
def _describe_subnets(self, subnet_ids):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
- name: Wait for instance a
ec2_instance:
name: "ansible-test-{{ tiny_prefix }}-elb-a"
instance_ids:
- "{{ instance_a }}"
vpc_subnet_id: "{{ subnet_a }}"
instance_type: t2.micro
wait: true
Expand All @@ -27,6 +29,8 @@
- name: Wait for instance b
ec2_instance:
name: "ansible-test-{{ tiny_prefix }}-elb-b"
instance_ids:
- "{{ instance_b }}"
vpc_subnet_id: "{{ subnet_b }}"
instance_type: t2.micro
wait: true
Expand Down

0 comments on commit a2be6da

Please sign in to comment.