netbox-community / netbox

The premier source of truth powering network automation. Open source under Apache 2. Try NetBox Cloud free: https://netboxlabs.com/free-netbox-cloud/
http://netboxlabs.com/oss/netbox/
Apache License 2.0
16.15k stars 2.58k forks source link

Ansible Netbox integration doesn't work anymore after upgrading to NetBox 4.0.3 from NetBox 3.6.7 #16414

Closed kiaz-github closed 5 months ago

kiaz-github commented 5 months ago

Deployment Type

Self-hosted

NetBox Version

v4.0.3

Python Version

3.10

Steps to Reproduce

      - name: "Netbox: create/update sites"
        netbox.netbox.netbox_site:
          netbox_url: "{{ nb_url }}"
          netbox_token: "{{ nb_token }}"
          validate_certs: no
          data:
            name: "RIZ-{{ item.Kuerzel }}-{{ item.ID }}"
            status: active
            site_group: "riz"
            tenant: "RIZ"
            time_zone: "Europe/Zurich"
            physical_address: "{{ item.Hauptstandort }} \n {{ item.Adresse }} \n {{ item.PLZ }} {{ item.Ort }}"
            comments: "NSN: {{ item.Anschlussnummer }}"
          state: present
        loop: "{{ standort.list }}"
        when:
          - item.ID.startswith('10')
          - item.Status in "{{ site_valid_status_list }}"
        tags:
          - create_site
      This playbook worked before the upgrade.

Expected Behavior

The connection to the NeBox API works and the Ansible Playbook is executed.

Observed Behavior

"Failed to establish connection to NetBox API"

mto2 commented 5 months ago

I believe this is directly related to this https://github.com/netbox-community/pynetbox/issues/612

kiaz-github commented 5 months ago

https://github.com/netbox-community/pynetbox/pull/613 fixed the problem for me, thank you.

DanSheps commented 5 months ago

Thank you for submitting your bug report. Unfortunately, this bug falls outside the scope of NetBox and is related to either a third party tool or plugin. If you have further issues with this software please direct your questions/reports to the appropriate repository for that tool.