Skip to content

[Bug]: Ansible Netbox integration doesn't work anymore after upgrading to NetBox 4.0.3 from NetBox 3.6.7  #1265

Closed
@kiaz-github

Description

@kiaz-github

Ansible NetBox Collection version

v3.18.0

Ansible version

ansible [core 2.16.7]
  config file = /etc/ansible/ansible.cfg
  configured module search path = ['/home/chiara/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python3/dist-packages/ansible
  ansible collection location = /home/chiara/.ansible/collections:/usr/share/ansible/collections
  executable location = /usr/bin/ansible
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.0.3
  libyaml = True

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"

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