Allow IPv6 with NetworkInterfaceIPConfiguration - #582
Merged
xuzhang3 merged 1 commit intoAug 6, 2021
Conversation
Collaborator
|
@imrejonk Thanks for your contribution. Can you add test cases for the newly added feature? Thank you very much! |
Contributor
Author
|
No problem, I'll add some test cases next week. I just got service principal authentication working for ansible-test and am now doing some trial runs with the existing integration tests. |
imrejonk
force-pushed
the
networkinterface-ipconfig-ipv6
branch
from
July 22, 2021 13:50
b2de5fb to
e22c298
Compare
Contributor
Author
|
@Fred-sun I've modified the Some things to note:
Let me know if this is sufficient, and if not, what types of additional tests you would like to see. |
Fred-sun
reviewed
Jul 24, 2021
The ip_configurations parameter of the azure_rm_networkinterface module
did not allow specifying the IP version, causing the Azure REST API to
default to IPv4. Trying to add a public IPv6 address to the network
interface would cause this error:
```
Error creating or updating network interface mynic - Azure Error: IPVersionForPublicIpAndNicIpConfigurationMustMatch
Message: IP version for publicIPAddress '/subscriptions/[..]/resourceGroups/ansible/providers/Microsoft.Network/publicIPAddresses/mypublicipv6address', version 'IPv6' and network
interface ipConfiguration '/subscriptions/[..]/resourceGroups/ansible/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/myipv6config', version 'IPv4' must match.
```
The Azure Python SDK however does allow for a parameter called
`private_ip_address_version` [0]. This commit implements that parameter
for the azure_rm_networkinterface module.
[1] https://docs.microsoft.com/en-us/python/api/azure-mgmt-network/azure.mgmt.network.v2020_06_01.models.networkinterfaceipconfiguration?view=azure-python
imrejonk
force-pushed
the
networkinterface-ipconfig-ipv6
branch
from
July 26, 2021 11:44
e22c298 to
af28e0a
Compare
Contributor
Author
|
@Fred-sun here you go, style issues fixed. |
Collaborator
Contributor
|
LGTM |
Fred-sun
pushed a commit
to Fred-sun/ansible_collections_azure
that referenced
this pull request
Aug 11, 2021
) The ip_configurations parameter of the azure_rm_networkinterface module did not allow specifying the IP version, causing the Azure REST API to default to IPv4. Trying to add a public IPv6 address to the network interface would cause this error: ``` Error creating or updating network interface mynic - Azure Error: IPVersionForPublicIpAndNicIpConfigurationMustMatch Message: IP version for publicIPAddress '/subscriptions/[..]/resourceGroups/ansible/providers/Microsoft.Network/publicIPAddresses/mypublicipv6address', version 'IPv6' and network interface ipConfiguration '/subscriptions/[..]/resourceGroups/ansible/providers/Microsoft.Network/networkInterfaces/mynic/ipConfigurations/myipv6config', version 'IPv4' must match. ``` The Azure Python SDK however does allow for a parameter called `private_ip_address_version` [0]. This commit implements that parameter for the azure_rm_networkinterface module. [1] https://docs.microsoft.com/en-us/python/api/azure-mgmt-network/azure.mgmt.network.v2020_06_01.models.networkinterfaceipconfiguration?view=azure-python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SUMMARY
The ip_configurations parameter of the azure_rm_networkinterface module did not allow specifying the IP version, causing the Azure REST API to default to IPv4. Trying to add a public IPv6 address to the network interface would cause this error:
The Azure Python SDK however does allow for a parameter called
private_ip_address_version. This commit implements that parameter for the azure_rm_networkinterface module.ISSUE TYPE
COMPONENT NAME
azure_rm_networkinterface
ADDITIONAL INFORMATION
You can now do this:
And I can remove an ugly workaround involving an Ansible
commandtask that just called azure-cli to add IPv6 configurations to network interfaces 😊