Closed dauphinpasdroit closed 1 year ago
pynetbox
7.x is only compatible with NetBox 3.3+, so the non-NetBox 3.3+ compatible features were removed in 7.0.1. The private_key
argument for pynetbox.api()
was one such feature (only usable with NetBox 2.11 and older).
If you need the private key for use in older NetBox, you need to use some older pynetbox
version.
Or, maybe the plugin you are using needs some update.
Thank you for your answer.
I use pynetbox through Ansible with the netbox collection. To be more specific, I use the netbox.netbox.nb_lookup module. I use the last version of the collection.
The thing that I don't understand, it's that I don't use the private_key
feature at all.
I rolled back the pynetbox version to 7.0.0 so it's working now, but I'm not sure to fully understand everything here.
I'd recommend you to search for peer assistance among other users of that plugin, and to notify the module author that legacy features (private_key
) don't work with current pynetbox
anymore, so they may want to release update as well.
@alphaxr6 same issue here... I'm going to have a look at the list of issues for ansible collection
@alphaxr6 as a very very dirty workaround, you can edit netbox/plugins/lookup/nb_lookup.py and comment out this lines:
# "secret-roles": {"endpoint": netbox.secrets.secret_roles},
# "secrets": {"endpoint": netbox.secrets.secrets},
and
netbox = pynetbox.api(
netbox_api_endpoint,
token=netbox_api_token if netbox_api_token else None,
#private_key=netbox_private_key,
#private_key_file=netbox_private_key_file,
)
I opened a bug report in netbox ansible collection repository. Feel free to add more information :)
Thank you @equinoxefr
I saw that the bug was known and netbox collection for ansible team is working on it. I'll close this topic.
Thank you for your help all :)
Hello,
Since the 7.0.1 release, I encounter this error message:
fatal: [localhost]: FAILED! => {"msg": "An unhandled exception occurred while running the lookup plugin 'netbox.netbox.nb_lookup'. Error was a , original message: __init__() got an unexpected keyword argument 'private_key'"}
With the version 7.0.0 it works perfectly fine.
It seems like to be a bug from the new release.