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

[Bug]: Inventory Plugin with Custom Field Query Filter is not working as expected #1365

Open
cryptolukas opened this issue Jan 10, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@cryptolukas
Copy link

Ansible NetBox Collection version

3.20.0

Ansible version

ansible [core 2.18.1]
  configured module search path = ['/home/lukas/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.13/site-packages/ansible
  ansible collection location = /home/lukas/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.13.1 (main, Dec  4 2024, 18:05:56) [GCC 14.2.1 20240910] (/usr/bin/python)
  jinja version = 3.1.5
  libyaml = True

NetBox version

v3.7.8

Python version

3.10

Steps to Reproduce

Create a custom field foo as text with default search matching

assign the custom field to a virtual machine object and set a value to bar

virtualization | interface
ipam | IP address
virtualization | virtual machine

Create a nb inventory like

plugin: netbox.netbox.nb_inventory
api_endpoint: https://netboxexample.com
validate_certs: true
query_filters:
  - cf_foo: bar

Expected Behavior

Result should be ansible inventory contains all virtual machines with the assigned custom field foo and value bar.

Observed Behavior

The filter is not working and i get all devices back.

The API call is working as expected
api/virtualization/virtual-machines/\?limit=0\&cf_foo\=bar\&exclude\=config_context

@cryptolukas cryptolukas added the bug Something isn't working label Jan 10, 2025
@sc68cal sc68cal changed the title [Bug]: Inventory Plugin with Custom Field Qery Filter is not working as expected [Bug]: Inventory Plugin with Custom Field Query Filter is not working as expected Jan 14, 2025
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