Validation error when adding a new cable #7856

Closed
opened 2025-12-29 20:29:04 +01:00 by adam · 0 comments
Owner

Originally created by @napaster on GitHub (Apr 4, 2023).

NetBox version

v3.4.6

Python version

3.10

Steps to Reproduce

ansible-playbook tasks/netbox/6_conneted.yml

6_conneted.yml

---
- name: Cable
  become: false
  gather_facts: false
  remote_user: napaster
  no_log: false
  strategy: linear
  serial: 1
  connection: local
  hosts: localhost
  tasks:
    - name: Create cable within NetBox with only required information U1
      netbox.netbox.netbox_cable:
        netbox_url: "{{ netbox_api_endpoint }}"
        netbox_token: "{{ netbox_api_token }}"
        data:
          termination_a_type: dcim.interface
          termination_a:
            device: omsk.opentech.local
            name: gig0
          termination_b_type: dcim.interface
          termination_b:
            device: omsk-krput79-st1.opentech.local-u1
            name: GigabitEthernet1/0/24
        state: present

After that I run the playbook and get:
"msg": "{"all":["Must define A and B terminations when creating a new cable."]}"

  1. Create device omsk.opentech.local
  2. Create an interface on the device named gig0
  3. Create device omsk-krput79-st1.opentech.local-u1.
  4. Create an interface on the omsk-krput79-st1.opentech.local-u1 device with the name GigabitEthernet1/0/24 type 1000base-t

Next, I tried to create a cable with a playbook. The manual cable is created.

Expected Behavior

Cable created successfully

Observed Behavior

"msg": "{"all":["Must define A and B terminations when creating a new cable."]}"

Originally created by @napaster on GitHub (Apr 4, 2023). ### NetBox version v3.4.6 ### Python version 3.10 ### Steps to Reproduce ansible-playbook tasks/netbox/6_conneted.yml 6_conneted.yml ``` --- - name: Cable become: false gather_facts: false remote_user: napaster no_log: false strategy: linear serial: 1 connection: local hosts: localhost tasks: - name: Create cable within NetBox with only required information U1 netbox.netbox.netbox_cable: netbox_url: "{{ netbox_api_endpoint }}" netbox_token: "{{ netbox_api_token }}" data: termination_a_type: dcim.interface termination_a: device: omsk.opentech.local name: gig0 termination_b_type: dcim.interface termination_b: device: omsk-krput79-st1.opentech.local-u1 name: GigabitEthernet1/0/24 state: present ``` After that I run the playbook and get: "msg": "{\"__all__\":[\"Must define A and B terminations when creating a new cable.\"]}" 1. Create device omsk.opentech.local 2. Create an interface on the device named gig0 3. Create device omsk-krput79-st1.opentech.local-u1. 4. Create an interface on the omsk-krput79-st1.opentech.local-u1 device with the name GigabitEthernet1/0/24 type 1000base-t Next, I tried to create a cable with a playbook. The manual cable is created. ### Expected Behavior Cable created successfully ### Observed Behavior "msg": "{\"__all__\":[\"Must define A and B terminations when creating a new cable.\"]}"
adam closed this issue 2025-12-29 20:29:04 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#7856