Skip to content

Commit

Permalink
Don't ignore IPv6 addresses when a single network interface is specif…
Browse files Browse the repository at this point in the history
…ied (#1979)

Don't ignore IPv6 addresses when a single network interface is specified

SUMMARY

When "ipv6_adresses" are used with "network" without specifying "interfaces", the parameter is ignored and no IPv6 adresses get set. I don't believe this is the intended or correct behaviour.

ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ec2_instance
ADDITIONAL INFORMATION

Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: Bikouo Aubin
Reviewed-by: Alina Buzachis
  • Loading branch information
maggu authored May 24, 2024
1 parent b47d1cf commit 0d1a604
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/1979-do-not-ignore-ipv6-addresses.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- ec2_instance - do not ignore IPv6 addresses when a single network interface is specified (https://github.com/ansible-collections/amazon.aws/pull/1979).
3 changes: 3 additions & 0 deletions plugins/modules/ec2_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,9 @@ def build_network_spec(params):
sub = get_default_subnet(default_vpc, availability_zone=module.params.get("availability_zone"))
spec["SubnetId"] = sub["SubnetId"]

if network.get("ipv6_addresses"):
spec["Ipv6Addresses"] = [{"Ipv6Address": a} for a in network.get("ipv6_addresses", [])]

if network.get("private_ip_address"):
spec["PrivateIpAddress"] = network["private_ip_address"]

Expand Down

0 comments on commit 0d1a604

Please sign in to comment.