From e0f348878a24d532706ae38aec6db52a0f02aeb3 Mon Sep 17 00:00:00 2001 From: Rich Bibby Date: Sun, 27 Oct 2024 11:39:50 +0000 Subject: [PATCH] 1333 feature update netbox device interface template (#1345) * Add new options for interface template creation This commit adds new options for creating interface templates in NetBox. The new options include the ability to specify a label, enable or disable the template, and provide a description. These options were added in version 3.21.0 of the plugin. * added changelog fragment * Update 1333-feature-netbox_device_interface_template.yml new line to fix linting --- ...ature-netbox_device_interface_template.yml | 2 ++ .../netbox_device_interface_template.py | 21 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 changelogs/fragments/1333-feature-netbox_device_interface_template.yml diff --git a/changelogs/fragments/1333-feature-netbox_device_interface_template.yml b/changelogs/fragments/1333-feature-netbox_device_interface_template.yml new file mode 100644 index 00000000..867e3dae --- /dev/null +++ b/changelogs/fragments/1333-feature-netbox_device_interface_template.yml @@ -0,0 +1,2 @@ +minor_changes: + - Add `label`, `description` and `enabled` to `netbox_device_interface_template` (https://github.com/netbox-community/ansible_modules/issues/1333) diff --git a/plugins/modules/netbox_device_interface_template.py b/plugins/modules/netbox_device_interface_template.py index 8fd749c8..27966baa 100644 --- a/plugins/modules/netbox_device_interface_template.py +++ b/plugins/modules/netbox_device_interface_template.py @@ -39,6 +39,12 @@ - Name of the interface template to be created required: true type: str + label: + description: + - The label of the interface template + required: false + type: str + version_added: '3.21.0' type: description: - | @@ -47,11 +53,23 @@ This has to be specified exactly as what is found within UI required: true type: str + enabled: + description: + - Whether or not the interface template to be created should be enabled + required: false + type: bool + version_added: '3.21.0' mgmt_only: description: - This interface template is used only for out-of-band management required: false type: bool + description: + description: + - Description of the interface template + required: false + type: str + version_added: '3.21.0' poe_mode: description: - This interface has PoE ability (NetBox release 3.3 and later) @@ -129,11 +147,14 @@ def main(): options=dict( device_type=dict(required=True, type="raw"), name=dict(required=True, type="str"), + label=dict(required=False, type="str"), type=dict( required=True, type="str", ), + enabled=dict(required=False, type="bool"), mgmt_only=dict(required=False, type="bool"), + description=dict(required=False, type="str"), poe_type=dict(required=False, type="raw"), poe_mode=dict(required=False, type="raw"), ),