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

Closed
opened 2025-12-29 21:22:51 +01:00 by adam · 3 comments
Owner

Originally created by @kiaz-github on GitHub (Jun 5, 2024).

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"

Originally created by @kiaz-github on GitHub (Jun 5, 2024). ### 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"`
adam closed this issue 2025-12-29 21:22:51 +01:00
Author
Owner

@mto2 commented on GitHub (Jun 5, 2024):

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

@mto2 commented on GitHub (Jun 5, 2024): I believe this is directly related to this [https://github.com/netbox-community/pynetbox/issues/612](https://github.com/netbox-community/pynetbox/issues/612)
Author
Owner

@kiaz-github commented on GitHub (Jun 6, 2024):

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

@kiaz-github commented on GitHub (Jun 6, 2024): https://github.com/netbox-community/pynetbox/pull/613 fixed the problem for me, thank you.
Author
Owner

@DanSheps commented on GitHub (Jun 6, 2024):

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.

@DanSheps commented on GitHub (Jun 6, 2024): 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#9797