-
Notifications
You must be signed in to change notification settings - Fork 343
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
Update ec2_vpc_net.py to allow setting ipv6_cidr: false
in task.
#1808
Conversation
Module will fail if `ipv6_cidr: false` is set in task. This change fixes that bug.
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 5m 21s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking the time to submit this PR.
If the option ipv6_cidr: false (which is the default), is used with this module
That's not entirely correct and hasn't been since release 3.2.0 (April 2022), the current default is None
, ie no change should be made. The documentation now says Default value is C(false) when creating a new VPC.
because the default Amazon behaviour is not to associate an IPv6 CIDR. This wording is possibly confusing and can be found on line 64 if you have a better description.
It would be helpful if you could provide more information about the steps you're using to reproduce the issue.
We have integration tests for this module ( tests/integration/targets/ec2_vpc_net/tasks/main.yml ) which don't trigger the issue you're describing. It would be helpful if your PR could include an update to these tests which trigger the issue you're describing. Additionally please include a changelog fragment (https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to)
@@ -384,7 +384,7 @@ def wait_for_vpc_ipv6_state(module, connection, vpc_id, ipv6_assoc_state): | |||
If ipv6_assoc_state is False, wait for VPC to be dissociated from all Amazon-provided IPv6 CIDR blocks. | |||
""" | |||
|
|||
if ipv6_assoc_state is None: | |||
if not ipv6_assoc_state: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change would mean that we don't wait for disassociations to complete, which would be the wrong behaviour. I suspect the bad behaviour is somewhere in the logic around line 410
Module will fail if
ipv6_cidr: false
is set in task. This change fixes that bug.SUMMARY
Module will fail if
ipv6_cidr: false
is set in task. This change fixes that bug.ISSUE TYPE
COMPONENT NAME
ec2_vpc_net
ADDITIONAL INFORMATION
If the option
ipv6_cidr: false
(which is the default), is used with this module,the module fails with the following error:
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to wait for IPv6 CIDR association"}
One can comment that line out, but that does not solve the problem of having a set of VMs to create,
some of which will need IPV6 and some of which will not.
Before:
After: