Skip to content

Commit 1ec620f

Browse files
committed
feat: add serial to vm
1 parent ab593ba commit 1ec620f

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- Add `serial` to `netbox_virtual_machine` module (https://github.com/netbox-community/ansible_modules/issues/1309)

plugins/modules/netbox_virtual_machine.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@
6464
- The platform of the virtual machine
6565
required: false
6666
type: raw
67+
serial:
68+
description:
69+
- Serial number of the virtual machine
70+
required: false
71+
type: str
72+
version_added: "3.20.0"
6773
primary_ip4:
6874
description:
6975
- Primary IPv4 address assigned to the virtual machine
@@ -177,6 +183,16 @@
177183
memory: 8
178184
disk: 8
179185
state: present
186+
187+
- name: Update virtual machine within NetBox with serial number
188+
netbox_virtual_machine:
189+
netbox_url: http://netbox.local
190+
netbox_token: thisIsMyToken
191+
data:
192+
name: Test Virtual Machine
193+
cluster: test cluster
194+
serial: 1234abc
195+
state: present
180196
"""
181197

182198
RETURN = r"""
@@ -219,6 +235,7 @@ def main():
219235
vcpus=dict(required=False, type="float"),
220236
tenant=dict(required=False, type="raw"),
221237
platform=dict(required=False, type="raw"),
238+
serial=dict(required=False, type="str"),
222239
primary_ip4=dict(required=False, type="raw"),
223240
primary_ip6=dict(required=False, type="raw"),
224241
memory=dict(required=False, type="int"),

0 commit comments

Comments
 (0)