Skip to content

[Bug]: inventory plugin does not support netbox running on path-based endpoints #1408

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

Open
lanefu opened this issue Apr 13, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@lanefu
Copy link

lanefu commented Apr 13, 2025

Ansible NetBox Collection version

v3.21.0

Ansible version

ansible [core 2.18.4]
  config file = /Users/lane/GIT/LANECLOUD/tmp/netbox-ansible_modules/ansible.cfg
  configured module search path = ['/Users/lane/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/lane/GIT/LANECLOUD/lanecloud_infra/venv/lib/python3.12/site-packages/ansible
  ansible collection location = /Users/lane/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/lane/GIT/LANECLOUD/lanecloud_infra/venv/bin/ansible
  python version = 3.12.4 (main, Jul  7 2024, 16:39:30) [Clang 15.0.0 (clang-1500.3.9.4)] (/Users/lane/GIT/LANECLOUD/lanecloud_infra/venv/bin/python3)
  jinja version = 3.1.6
  libyaml = True

NetBox version

v3.5.5

Python version

3.11

Steps to Reproduce

Deploy netbox in a not-root path.. such as https://myserver.example.com/netbox/ and query with inventory plugin

Expected Behavior

Normal inventory result set

Observed Behavior

Empty result set. The inventory plugin queries net box's OpenAPI endpoint, and composes the API paths from the OpenAPI output. However, the inventory plugin doesn't factor in the full url of the netbox server when querying the API. It always assumes netbox is running at the root context.. aka server.example.com/ and composes the inventory API points accordingly, ignoring any subpath such as /netbox/

Other components are aware of the base path, it seems to just be the inventory plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant