fix: use 'role' instead of 'device_role' with netbox >= 3.6.0 in netbox_device module #1080
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.
Related Issue
I have the same issue as what this PR was attempting to address:
#1062
New Behavior
When talking to Netbox >= 3.6.0 replace
device_role
parameters sent to the netbox API withrole
. This is needed due to breaking changes introduced in 3.6.0 wheredevice_role
was renamed torole
. Ref: https://github.com/netbox-community/netbox/releases/tag/v3.6.0Contrast to Current Behavior
This not an attempt to explicitly add a new
role
parameter or deprecatedevice_role
as a parameter. Instead this is a short-term fix for those of us who are using netbox >= 3.6 and want to continue to use this ansible collection with no changes to parameters passed. So basically we continue to passdevice_role
as a parameter even though this is technically no longer valid for for NB >= 3.6. This ensures backwards compatibility and no change in behavior for those on newer releases....
Discussion: Benefits and Drawbacks
Benefits: allows the
netbox_device
module to work with NB 3.6 and laterDrawbacks: doesn't solve the problem of how to address this breaking change with a new parameter (
role
) to the ansible module directly while maintaining backwards comat. I defer to the collection authors for consensus on this (also happy to help if you can provide some guidance on how you would like this to work).Changes to the Documentation
N/A for now
Proposed Release Note Entry
Make 'device_role' parameter compatible with Netbox >= 3.6.0 in netbox_device module
Double Check
devel
branch.