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

elb_classic_lb: fix - resolve security_group_ids when providing security_group_names #592

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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