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 2 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
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 is not None and self.elb.get('Subnets'):
mandar242 marked this conversation as resolved.
Show resolved Hide resolved
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,7 @@
- name: Wait for instance a
ec2_instance:
name: "ansible-test-{{ tiny_prefix }}-elb-a"
image_id: "{{ images_info.images | sort(attribute='creation_date') | reverse | first | json_query('image_id') }}"
mandar242 marked this conversation as resolved.
Show resolved Hide resolved
vpc_subnet_id: "{{ subnet_a }}"
instance_type: t2.micro
wait: true
Expand All @@ -27,6 +28,7 @@
- name: Wait for instance b
ec2_instance:
name: "ansible-test-{{ tiny_prefix }}-elb-b"
image_id: "{{ images_info.images | sort(attribute='creation_date') | reverse | first | json_query('image_id') }}"
vpc_subnet_id: "{{ subnet_b }}"
instance_type: t2.micro
wait: true
Expand Down