Skip to content

Commit

Permalink
ec2_vpc_net: handle ipv6_cidr: false and no Ipv6CidrBlockAssociationS…
Browse files Browse the repository at this point in the history
…et in vpc (#2374)

SUMMARY


Fixes: #2363
This PR handles the case in which the vpc does not have ipv6 set and the task to modify it has ipv6_cidr: false
ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Bikouo Aubin
Reviewed-by: Alina Buzachis
Reviewed-by: Helen Bailey <[email protected]>
  • Loading branch information
GomathiselviS authored Nov 6, 2024
1 parent cbf4d8a commit f4ff421
Show file tree
Hide file tree
Showing 3 changed files with 256 additions and 147 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/handle_vpc_ipv6_false.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
bugfixes:
- ec2_vpc_net - handle ipv6_cidr ``false`` and no Ipv6CidrBlockAssociationSet in vpc (https://github.com/ansible-collections/amazon.aws/pull/2374).
3 changes: 3 additions & 0 deletions plugins/modules/ec2_vpc_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,9 @@ def wait_for_vpc_ipv6_state(module, connection, vpc_id, ipv6_assoc_state):
current_value = get_vpc(module, connection, vpc_id)
if current_value:
ipv6_set = current_value.get("Ipv6CidrBlockAssociationSet")
# "ipv6_cidr": false and no Ipv6CidrBlockAssociationSet
if not ipv6_set and not ipv6_assoc_state:
return
if ipv6_set:
if ipv6_assoc_state:
# At least one 'Amazon' IPv6 CIDR block must be associated.
Expand Down
Loading

0 comments on commit f4ff421

Please sign in to comment.