netbox-community / ansible_modules

NetBox modules for Ansible using Ansible Collections
GNU General Public License v3.0
333 stars 216 forks source link

[Bug]: Inventory: group_by region also creates sites #960

Open shaderecker opened 1 year ago

shaderecker commented 1 year ago

Ansible NetBox Collection version

v3.11.0

Ansible version

ansible [core 2.14.3]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/runner/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/local/lib/python3.9/site-packages/ansible
  ansible collection location = /runner/requirements_collections:/home/runner/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/local/bin/ansible
  python version = 3.9.16 (main, Dec  8 2022, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

NetBox version

v3.4.6

Python version

3.9

Steps to Reproduce

Inventory file:

plugin: netbox.netbox.nb_inventory
api_endpoint: https://netbox-api.x.x/
validate_certs: False

query_filters:
  - tenant: testing
  - tag: server

group_by:
  - region

Expected Behavior

Result: region_testregion1 region_testregion2

Observed Behavior

Result: region_testregion1 region_testregion2 sites_testsite1 sites_testsite2

sc68cal commented 1 year ago

Can you provide more details about the regions and sites that you have in your NetBox instance?

shaderecker commented 1 year ago

Yes of course. Here are my regions:

image image

And here are my sites:

image image