-
Notifications
You must be signed in to change notification settings - Fork 315
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
unable to create secondary ip for a NIC using azure_rm_networkinterface module #1284
Comments
@venkateshm2012 Thanks for your questions! To use a module from Azure collection, you should reference the full namespace or collection name, you can try like the follow.
|
Same issue for me. I don't want to delete or change the existing primary or secondary interfaces. I just want to add an additional secondary Name with a dynamic IP. However it seems like it wants to update the primary? So not sure what I am missing, or is it the case that you have to respecify all ip_configurations for all interfaces. error message reported. "Deletion and renaming of primary IP Configuration is not supported" ansible play
error message during run of task.
ansible collection. |
So, after some exploration, I've discovered an important caveat: the approach of directly adding IP configurations using a loop can lead to unintended behavior. It seems that this method overwrites existing configurations rather than adding new ones. In my scenario, I needed to set up multiple secondary IP addresses on a network interface, but this method condensed them into a single entry, which was definitely not the desired outcome. To illustrate a more effective strategy, consider the following setup using a predefined ipConfig variable:
Once ipConfig is established, you can proceed to assign the IP addresses as demonstrated below:
Avoid the temptation to employ a loop in the manner shown below, as it will lead to unintended overwriting of entries:
This method feels quite cumbersome, especially compared to other options like PowerShell, where a single call can effortlessly add an IP address. I'm left wondering if I've overlooked a more efficient approach here. I'm curious if this behavior is intentional and if there's a rationale behind it. If anyone has insights or suggestions, I'd be eager to hear them. |
@morley461 I see! I will recheck it! Thank you very much! |
This comment was marked as off-topic.
This comment was marked as off-topic.
@venkateshm2012 @morley461 Sorry, we can't do the same as #1488 for the time being. Currently, the SDK of the network adapter does not support updating the ip_configuration information of the network adapter, and only supports re-creation. Therefore, if you want to configure multiple ip_configuration information for the NIC, perform the following operations. Thank you!
|
@venkateshm2012 @morley461 If the SDK supports updates, we will import them as soon as possible. Thank you! |
SUMMARY
unable to create secondary ip for a NIC
ISSUE TYPE
COMPONENT NAME
azure_rm_networkinterface module
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
STEPS TO REPRODUCE
EXPECTED RESULTS
I want to attach a new IPconfiguration on the NIC(MY_NIC) , in other words i need to attach secondary IP for the NIC.
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: