Skip to content
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

fix: use 'role' instead of 'device_role' with netbox >= 3.6.0 in netbox_device module #1080

Closed

Conversation

floatingstatic
Copy link

@floatingstatic floatingstatic commented Oct 3, 2023

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 with role. This is needed due to breaking changes introduced in 3.6.0 where device_role was renamed to role. Ref: https://github.com/netbox-community/netbox/releases/tag/v3.6.0

Contrast to Current Behavior

This not an attempt to explicitly add a new role parameter or deprecate device_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 pass device_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 later

Drawbacks: 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

  • I have read the comments and followed the CONTRIBUTING.md.
  • I have explained my PR according to the information in the comments or in a linked issue.
  • My PR targets the devel branch.

@floatingstatic
Copy link
Author

Oops apologies I missed #1066 which is much more comprehensive. Closing in favor of that since it is already merged anyway!

Related, when will the new version of this module collection be updated so we can start taking advantage of those changes? Thanks!

@lasag-2511
Copy link

"Unsupported parameters for (netbox.netbox.netbox_device) module: data.role. i still have issues with it

@floatingstatic
Copy link
Author

@lasag-2511 This was fixed in #1066 . Prior to the release 3.15.0 I ended up building from develop as 3.14.0 would not have had the fix. Something like:

git clone https://github.com/netbox-community/ansible_modules
ansible-galaxy collection build .
ansible-galaxy collection install netbox-netbox*.tar.gz

At this point you can just upgrade to version 3.15.0 of the collection and it works fine (at least for me).

@lasag-2511
Copy link

lasag-2511 commented Nov 20, 2023

@lasag-2511 This was fixed in #1066 . Prior to the release 3.15.0 I ended up building from develop as 3.14.0 would not have had the fix. Something like:

git clone https://github.com/netbox-community/ansible_modules
ansible-galaxy collection build .
ansible-galaxy collection install netbox-netbox*.tar.gz

At this point you can just upgrade to version 3.15.0 of the collection and it works fine (at least for me).

thanks it works

@lmas-chwy
Copy link

I installed version 3.16.0 and still have the same error

@floatingstatic
Copy link
Author

floatingstatic commented Feb 9, 2024

@lmas-chwy why not comment on #1061 since you are commenting on a PR I opened that was never merged and in my opinion was properly fixed in in #1066. A PR that was never merged is not an issue that will get any visibility by maintainers. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants