terraform-provider-netbox
terraform-provider-netbox copied to clipboard
Add custom fields for prefix
Add support for custom_fields in prefix resource. Solution taken from https://github.com/smutel/terraform-provider-netbox, it should fix also issues mentioned in https://github.com/e-breuninger/terraform-provider-netbox/pull/143. If this approach is acceptable, I can enhance the PR also for the rest of the resources.
Tests passed ok.
Custom fields should be defined using blocks:
custom_field {
name = "testfield"
type = "text"
value = "tesval"
}
custom_field {
name = "name"
type = "text"
value = "testname1"
}
Hello,
I'm not sure but i think that this code can be reused to solved my issue on virtual machine. My issue is a bug in custom field integration on virtual machine resource.
Issue: https://github.com/e-breuninger/terraform-provider-netbox/issues/203
Regards,
Hello,
I'm not sure but i think that this code can be reused to solved my issue on virtual machine. My issue is a bug in custom field integration on virtual machine resource.
Issue: #203
Regards,
Hi, I have tested multiple choice cf with
custom_field {
name = "test"
type = "multiple"
value = "value1,value2"
}
and is working ok.
I not saw that you apply custom fields on all resources. It's perfect.
Thank you.
@fbreckle Can you merge this PR for next release ?
Because the custom field is a very important feature and it's very cool.
Thank you, Regards
Hi,
Thank you for your PR!
Just chiming in quickly to say that I saw this MR. I do not personally use custom fields (CFs) and am currently not really aware how they work in NetBox. This means reviewing this will take some time.
I have to say that I am not a big fan of having to repeat the type when using the CFs, but I am not sure if it is possible to get around that.
Some patience, please!
Adding some global tests for each custom_field type could be a good idea to avoid surprises. And the PR title is a little bit confusing as you added the new schema to virtual machines, sites, locations, prefixes, etc. 😅
Can you confirm the behaviour :
- if the field is defined in TF but not exists in netbox : FAILURE
correct
- if a field is not defined in TF but exists in netbox TF refresh will skip it and not see any change
correct
- it supports other opbject ID (from a datasource) as reference if netbox type is "Object"
object type is not supported now
Adding some global tests for each custom_field type could be a good idea to avoid surprises. And the PR title is a little bit confusing as you added the new schema to virtual machines, sites, locations, prefixes, etc. 😅
I will add tests for other supported types.
Hi all, any update on this?
Hi, any chance to have this feature soon?
I will no longer be participating on this PR. I have migrated my use case to different Netbox provider.