netbox-community / ansible_modules

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

[Bug]: Failed to establish connection to NetBox API #1240

Closed xibriz closed 4 months ago

xibriz commented 4 months ago

Ansible NetBox Collection version

v3.18.0

Ansible version

ansible [core 2.16.6]
  python version = 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0] (/usr/bin/python3)
  jinja version = 3.1.3
  libyaml = True

NetBox version

v4.0.2

Python version

3.10

Steps to Reproduce

The following task works fine in Netbox v3.7.2 but not in v4.0.2:

- name: Create site
  netbox.netbox.netbox_site:
    netbox_url: URL
    netbox_token: TOKEN
    data:
      name: Test
      slug: test
    state: present

Expected Behavior

TASK [Create site] *** ok: [localhost]

Observed Behavior

TASK [Create site] *** fatal: [localhost]: FAILED! => {"changed": false, "msg": "Failed to establish connection to NetBox API"}

xibriz commented 4 months ago

Related to https://github.com/netbox-community/pynetbox/issues/612