Skip to content

Commit 0215e17

Browse files
authored
Add tenant to netbox_cable (#1027)
1 parent e062ce5 commit 0215e17

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

plugins/modules/netbox_cable.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@
155155
required: false
156156
type: dict
157157
version_added: "3.6.0"
158+
tenant:
159+
description:
160+
- Tenant who the cable will be assigned to
161+
required: false
162+
type: raw
163+
version_added: "3.13.0"
158164
"""
159165

160166
EXAMPLES = r"""
@@ -324,6 +330,7 @@ def main():
324330
comments=dict(required=False, type="str"),
325331
tags=dict(required=False, type="list", elements="raw"),
326332
custom_fields=dict(required=False, type="dict"),
333+
tenant=dict(required=False, type="raw"),
327334
),
328335
),
329336
)

tests/integration/targets/v3.3/tasks/netbox_cable.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
length_unit: m
8383
tags:
8484
- "Schnozzberry"
85+
tenant: "Test Tenant"
8586
state: present
8687
register: test_three
8788

@@ -96,6 +97,7 @@
9697
- test_three['diff']['after']['length'] == 30
9798
- test_three['diff']['after']['length_unit'] == "m"
9899
- test_three['diff']['after']['tags'][0] == 4
100+
- test_three['diff']['after']['tenant'] == 1
99101
- test_three['cable']['termination_a_type'] == "dcim.interface"
100102
- test_three['cable']['termination_a_id'] == 15
101103
- test_three['cable']['termination_b_type'] == "dcim.interface"
@@ -107,6 +109,7 @@
107109
- test_three['cable']['length'] == 30
108110
- test_three['cable']['length_unit'] == "m"
109111
- test_three['cable']['tags'][0] == 4
112+
- test_three['cable']['tenant'] == 1
110113
- test_three['msg'] == "cable dcim.interface Ethernet2/2 <> dcim.interface Ethernet2/1 updated"
111114

112115
- name: "CABLE 4: ASSERT - Delete"

tests/integration/targets/v3.4/tasks/netbox_cable.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
length_unit: m
8383
tags:
8484
- "Schnozzberry"
85+
tenant: "Test Tenant"
8586
state: present
8687
register: test_three
8788

@@ -96,6 +97,7 @@
9697
- test_three['diff']['after']['length'] == 30
9798
- test_three['diff']['after']['length_unit'] == "m"
9899
- test_three['diff']['after']['tags'][0] == 4
100+
- test_three['diff']['after']['tenant'] == 1
99101
- test_three['cable']['termination_a_type'] == "dcim.interface"
100102
- test_three['cable']['termination_a_id'] == 15
101103
- test_three['cable']['termination_b_type'] == "dcim.interface"
@@ -107,6 +109,7 @@
107109
- test_three['cable']['length'] == 30
108110
- test_three['cable']['length_unit'] == "m"
109111
- test_three['cable']['tags'][0] == 4
112+
- test_three['cable']['tenant'] == 1
110113
- test_three['msg'] == "cable dcim.interface Ethernet2/2 <> dcim.interface Ethernet2/1 updated"
111114

112115
- name: "CABLE 4: ASSERT - Delete"

tests/integration/targets/v3.5/tasks/netbox_cable.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
length_unit: m
8383
tags:
8484
- "Schnozzberry"
85+
tenant: "Test Tenant"
8586
state: present
8687
register: test_three
8788

@@ -96,6 +97,7 @@
9697
- test_three['diff']['after']['length'] == 30
9798
- test_three['diff']['after']['length_unit'] == "m"
9899
- test_three['diff']['after']['tags'][0] == 4
100+
- test_three['diff']['after']['tenant'] == 1
99101
- test_three['cable']['termination_a_type'] == "dcim.interface"
100102
- test_three['cable']['termination_a_id'] == 15
101103
- test_three['cable']['termination_b_type'] == "dcim.interface"
@@ -107,6 +109,7 @@
107109
- test_three['cable']['length'] == 30
108110
- test_three['cable']['length_unit'] == "m"
109111
- test_three['cable']['tags'][0] == 4
112+
- test_three['cable']['tenant'] == 1
110113
- test_three['msg'] == "cable dcim.interface Ethernet2/2 <> dcim.interface Ethernet2/1 updated"
111114

112115
- name: "CABLE 4: ASSERT - Delete"

0 commit comments

Comments
 (0)