Skip to content

Commit 8c85ca8

Browse files
Enhancement: netbox_inventory_item - Add discovered field and update query to allow serial (#229)
1 parent ba67d9d commit 8c85ca8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

plugins/modules/netbox_inventory_item.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@
7878
- The description of the inventory item
7979
required: false
8080
type: str
81+
discovered:
82+
description:
83+
- Set the discovery flag for the inventory item
84+
required: false
85+
type: bool
8186
tags:
8287
description:
8388
- Any tags that the device may need to be associated with
@@ -178,6 +183,7 @@ def main():
178183
serial=dict(required=False, type="str"),
179184
asset_tag=dict(required=False, type="str"),
180185
description=dict(required=False, type="str"),
186+
discovered=dict(required=False, type="bool", default=False),
181187
tags=dict(required=False, type="list"),
182188
),
183189
),

tests/integration/targets/latest/tasks/netbox_inventory_item.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
serial: "1234"
5555
asset_tag: "1234"
5656
description: "New SFP"
57+
discovered: True
5758
tags:
5859
- Schnozzberry
5960
state: present
@@ -69,6 +70,7 @@
6970
- test_three['diff']['after']['manufacturer'] == 1
7071
- test_three['diff']['after']['part_id'] == "10G-SFP+"
7172
- test_three['diff']['after']['tags'][0] == "Schnozzberry"
73+
- test_three['diff']['after']['discovered'] == True
7274
- test_three['inventory_item']['name'] == "10G-SFP+"
7375
- test_three['inventory_item']['device'] == 1
7476
- test_three['inventory_item']['asset_tag'] == "1234"
@@ -77,6 +79,7 @@
7779
- test_three['inventory_item']['manufacturer'] == 1
7880
- test_three['inventory_item']['part_id'] == "10G-SFP+"
7981
- test_three['inventory_item']['tags'][0] == "Schnozzberry"
82+
- test_three['inventory_item']['discovered'] == True
8083
- test_three['msg'] == "inventory_item 10G-SFP+ updated"
8184

8285
- name: "INVENTORY_ITEM 4: ASSERT - Delete"

0 commit comments

Comments
 (0)