0

i'm trying to run playbook which connects with Netbox. But getting error following error..

- name: "Test NetBox prefix module"
  connection: local
  hosts: localhost
  collections:
          - netbox.netbox
  tasks:

    - name: vars
      include_vars:
              dir: vars
    - name: Create prefix within NetBox 
      netbox_prefix:
        netbox_url: "{{ netbox_url }}" 
        netbox_token: "{{ netbox_token }}" 
        data:
          parent: x.x.0.0/16
          prefix_length: 30
        state: present
        first_available: yes

i'm getting following error:

 FAILED! => {"changed": false, "msg": "Failed to establish connection to NetBox API"}

please do helpful....

Mike
  • 61
  • 1
  • 3
  • 1
    Is `netbox_url` accurate? Can you reach the API at that value using `curl`? – larsks Jul 21 '22 at 15:03
  • I don't have an environment to debug this. But anyone who has netbox can start looking from this line - https://github.com/netbox-community/ansible_modules/blob/8ef1932f2a40d1d913429e939d8da0abcd927c9d/plugins/module_utils/netbox_utils.py#L695 – Abhijeet Kasurde Jul 21 '22 at 16:28

0 Answers0