-
Notifications
You must be signed in to change notification settings - Fork 229
[Bug]: nb_inventory.py not working with Netbox 3.2.x #775
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
Comments
It seems that the "Accept: application/json" header is missing in the request update: we investigated the issue and discovered that the request sets the 'content-type' header, which is technically not the right one. The header hat should be set is the (missing) 'Accept', see RFC2616
ansible_modules/plugins/inventory/nb_inventory.py Lines 1865 to 1869 in 5d6cb68
|
Thanks for reporting this. I am not able to reproduce the issue on my own NetBox instance, or the demo instance, both running 3.2.1. I'm using the simplest nb_inventory config I can think of:
|
Please share your |
Also, if this ever worked for you @HardTy, what version NetBox and ansible netbox collections was it working with? |
My suspicion is that Varnish is expecting the Accept header to be set, which is different than what the NetBox http server expects/requires. |
@HardTy how goes it, should this be closed out? |
adding @twink0r since they raised a PR |
I have this problem too, any solution? |
This comment was marked as off-topic.
This comment was marked as off-topic.
This is not the same issue. Follow the collection requirements (install pytz as the output mentions is missing) and you should be fine. |
The most interesting thing is that I have this module installed.
|
I had to create a virtual environment (venv) and only then the installation in this environment works correctly.
Thank you very much for your interest. Regards. |
For anyone else "just" installing ansible following the debian install instructions: What helped for me was to manually install pip and pytz globally: # Original Ansible install worked with this:
apt install ansible
# nb_inventory also needs:
apt install python3-pip
pip install pytz |
Ansible NetBox Collection version
v3.7.0
Ansible version
NetBox version
v3.2.1
Python version
3.9
Steps to Reproduce
Try to get a inventory from Netbox like with
ansible-inventory
command.It is the same behavior with
ansible-playbook
command.Expected Behavior
Get a working Ansible inventory.
Observed Behavior
See "Steps to Reproduce".
The text was updated successfully, but these errors were encountered: