Skip to content

Commit 0d4dc6f

Browse files
authored
netbox_device - Add location (#542)
1 parent dac848e commit 0d4dc6f

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

plugins/modules/netbox_device.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,11 @@
8989
- Required if I(state=present) and the device does not exist yet
9090
required: false
9191
type: raw
92+
location:
93+
description:
94+
- The location the device will be associated to (NetBox 2.11+)
95+
required: false
96+
type: raw
9297
rack:
9398
description:
9499
- The name of the rack to assign the device to
@@ -294,6 +299,7 @@ def main():
294299
serial=dict(required=False, type="str"),
295300
asset_tag=dict(required=False, type="str"),
296301
site=dict(required=False, type="raw"),
302+
location=dict(required=False, type="raw"),
297303
rack=dict(required=False, type="raw"),
298304
position=dict(required=False, type="int"),
299305
face=dict(

tests/integration/targets/v2.11/tasks/netbox_device.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
virtual_chassis: "VC1"
6969
vc_position: 3
7070
vc_priority: 15
71+
location: "Test Rack Group"
7172
state: present
7273
register: test_three
7374

@@ -90,6 +91,7 @@
9091
- test_three['device']['virtual_chassis'] == 1
9192
- test_three['device']['vc_position'] == 3
9293
- test_three['device']['vc_priority'] == 15
94+
- test_three['device']['location'] == 1
9395
- test_three['msg'] == "device R1 updated"
9496

9597
- name: "3.1 - Update device name using query_params"

tests/integration/targets/v3.0/tasks/netbox_device.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
virtual_chassis: "VC1"
6969
vc_position: 3
7070
vc_priority: 15
71+
location: "Test Rack Group"
7172
state: present
7273
register: test_three
7374

@@ -90,6 +91,7 @@
9091
- test_three['device']['virtual_chassis'] == 1
9192
- test_three['device']['vc_position'] == 3
9293
- test_three['device']['vc_priority'] == 15
94+
- test_three['device']['location'] == 1
9395
- test_three['msg'] == "device R1 updated"
9496

9597
- name: "3.1 - Update device name using query_params"

0 commit comments

Comments
 (0)