-
Notifications
You must be signed in to change notification settings - Fork 134
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
New resource request: netbox_device_oob_ip #538
Comments
This may be best as an option to add an IP address on to the device resource. |
That idea works too. My suggestion was on the grounds of the primary IP |
@tagur87 What is the motivation to handle this differently than a primary IP? I'm considering opening a PR, I just want to understand the reasoning. |
I've found a lot of bugs when multiple resources touch the same object. Don't remember my exact reasons in this case, but might have been related to that. |
I encountered the bugs with this too. What you are describing is a race condition in the update API call.
I still would implement a new resource:
resource "netbox_device" "this" {
[...]
oob_ip_id: # depends on the device_interface which depends on this device
}
resource "netbox_device_interface" "this" {
[...]
device_id = netbox_device.this.id
}
resource "netbox_ip_address" "oob" {
[...]
device_interface_id = netbox_device_interface.this.id
ip_address = "192.168.1.1/24"
} If it's implemented as a string, same problem how to lookup a IP address that dose not jet exists?
resource "netbox_device" "this" {
[...]
}
resource "netbox_device_interface" "this" {
[...]
}
resource "netbox_ip_address" "ipv4" {
[...]
}
resource "netbox_ip_address" "ipv6" {
[...]
}
resource "netbox_ip_address" "oob" {
[...]
}
resource "netbox_device_primary_ip" "ipv4" {
device_id = netbox_device.this.id
ip_address_id = netbox_ip_address.ipv4.id
[...]
}
resource "netbox_device_primary_ip" "ipv6" {
device_id = netbox_device.this.id
ip_address_id = netbox_ip_address.ipv6.id
[...]
depends_on = [netbox_device_primary_ip.ipv4]
}
resource "netbox_device_oob_ip" "oob" {
device_id = netbox_device.this.id
ip_address_id = netbox_ip_address.oob.id
[...]
depends_on = [netbox_device_primary_ip.ipv6]
} This is a feature of Terraform itself not the provider jumping through hoops. The |
Issue Reporting Guide
Hello all,
the latest versions of netbox have a separate field for Out-Of-Band management IP and I would like to be able to set it via code.
Thanks
The text was updated successfully, but these errors were encountered: