Open marinus81 opened 1 year ago
So https://netbox.domain.at/api/secrets/get-session-key/?preserve_key=True
404's - that sounds like an issue with your netbox installation. Please report this issue to them.
I see documentation here where the URL is http://netbox/api/plugins/netbox_secretstore/secrets/get-session-key/
- is there a version mismatch between your lookup plugin version and the secrets plugin installed in your netbox?
Hi @sc68cal thanks for your response. In my understanding (but this predates my involvement with NetBox so I might have history wrong) is that secrets used to be functionality of core NetBox. However in version 3.0.0 of NetBox this feature was removed from NetBox core and "transformed" into a plugin.
After a bit of further investigation it seems this is a limitation of the pynetbox python library: https://github.com/netbox-community/pynetbox/pull/430 where it was decided to not support the secrets plugin currently. IMO this currently renders the secret functionality in nb_lookup useless for NetBox >= 3.0.0.
If confirmed by somebody with more experience in Netbox I'd volunteer to update the documentation with this limitation?
@marinus81 Ah yes, thanks for the refresher. I had forgotten about that detail
We discussed some parts of this also in #495, where I did not really want to deal with managing a plugin either. My intention was to punt this over to pynetbox
to handle since it's really where it would need to be. So, I think if pynetbox
is not willing to handle the plugin, I don't think we can either.
In fact we should probably put some sort of error in our code about trying to use the lookup on that API endpoint with NetBox >= 3.0.0 that it is not supported. @rodvand ?
We should at least remove any example using the nb_lookup feature to lookup secrets...
Adding @hollow since they raised a PR.
Ansible NetBox Collection version
v.3.9.0
Ansible version
NetBox version
v3.3.7
Python version
3.8
Steps to Reproduce
Expected Behavior
Lookup plugin uses netbox-secretstore plugin URL to get decrypted secret
Observed Behavior