Open mkurjanski opened 1 year ago
I did notice that the before is an integer "device_asn": 275
while the after is a string "device_asn": "275"
.
A couple of relevant questions:
Hi @eliezerlp - thanks for spotting this. device_asn is an object-type custom field, so the integer references the linked object ID, in my case this is an ID of ipam.asn object (which is an integer in netbox)
So I'm guessing netbox.netbox.netbox_device takes 'custom_fields' which is type dict, but it assumes all keys and values in the dict must be strings? I'm feeding it an integer which is accepted and processed, but it breaks idempotency. I'd need to re-test and check the behaviour when the input custom field value is provided as a string.
Ansible NetBox Collection version
v3.13
Ansible version
NetBox version
v3.4.4
Python version
3.8
Steps to Reproduce
When you use netbox.netbox.netbox_device with state 'present' and 'custom_fields' input parameters defined, the module will always report the 'changed' state, even when the custom_fields already exist and no actual change was done.
Similarly, on the Netbox side there is a new changelog entry created for the device, even though the pre-change and post-change data is the same.
Expected Behavior
netbox.netbox.netbox_device should not report a change in custom field data if there was not real change done
Observed Behavior