Skip to content

[Bug]: interfaces pagination issue #1472

@l0l1l2l3l2l1l0l

Description

@l0l1l2l3l2l1l0l

Ansible NetBox Collection version

v3.21.0

Ansible version

ansible [core 2.14.18]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/root/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3.9/site-packages/ansible
  ansible collection location = /root/.ansible/collections:/usr/share/ansible/collections
  executable location = /bin/ansible
  python version = 3.9.18 (main, Jan 24 2024, 00:00:00) [GCC 11.4.1 20231218 (Red Hat 11.4.1-3)] (/usr/bin/python3)
  jinja version = 3.1.2
  libyaml = True

NetBox version

v4.3.2

Python version

3.9

Steps to Reproduce

  1. install netbox with https
  2. make a lot of devices like 100 , each with 10 or more ports -> more than 1000 interfaces of the default
  3. setup inventory file
  • interfaces: True
  • fetch_all: False
  • timeout: 6000
  1. sync dynamic inventory

Expected Behavior

the hosts and interfaces synced to ansible system
with small number of interfaces

Observed Behavior

if there are a lot of interfaces, the code of this link has issue

[Issue - possibly a bug]
On the first loop, no issue,
but on the second loop, the result from _fetch_information function shows http rather than https,
and I believe the code is limited to http use only.
-> this makes api call always fail when netbox is only available with https

To track the whole code flow

  1. https://github.com/netbox-community/ansible_modules/blob/devel/plugins/inventory/nb_inventory.py#L1417-L1427
  2. https://github.com/netbox-community/ansible_modules/blob/devel/plugins/inventory/nb_inventory.py#L519-L555
  3. https://github.com/netbox-community/ansible_modules/blob/devel/plugins/inventory/nb_inventory.py#L501-L515
  4. https://github.com/netbox-community/ansible_modules/blob/devel/plugins/inventory/nb_inventory.py#L430-L499

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions