Skip to content

Commit

Permalink
Adds to #767: Add various new NetBox 3.2 parameters (#768)
Browse files Browse the repository at this point in the history
* Add VRF on netbox_vm_interface
* Add link parameter to netbox_contact
* Add enabled to netbox_custom_link
* Add service_id to netbox_provider_network
* Add min_vid and max_vid to netbox_vlan_group
* Add speed, duplex and VRF to device_interface
* Add choices to duplex parameter
* Add cluster_types to netbox_config_context
* Add object_type to netbox_custom_field
  • Loading branch information
rodvand authored Apr 17, 2022
1 parent 0e45745 commit 0e3d35c
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 3 deletions.
2 changes: 2 additions & 0 deletions plugins/module_utils/netbox_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@
"cluster_group": "cluster_groups",
"cluster_groups": "cluster_groups",
"cluster_type": "cluster_types",
"cluster_types": "cluster_types",
"config_context": "config_contexts",
"contact_groups": "contact_groups",
"dcim.consoleport": "console_ports",
Expand Down Expand Up @@ -361,6 +362,7 @@
"roles",
"device_types",
"platforms",
"cluster_types",
"cluster_groups",
"clusters",
"tenant_groups",
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/netbox_config_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@
required: false
type: list
elements: str
cluster_types:
description:
- List of cluster_types to which configuration context applies
required: false
type: list
elements: str
cluster_groups:
description:
- List of cluster_groups to which configuration context applies
Expand Down Expand Up @@ -194,6 +200,7 @@ def main():
roles=dict(required=False, type="list", elements="str"),
device_types=dict(required=False, type="list", elements="str"),
platforms=dict(required=False, type="list", elements="str"),
cluster_types=dict(required=False, type="list", elements="str"),
cluster_groups=dict(required=False, type="list", elements="str"),
clusters=dict(required=False, type="list", elements="str"),
tenant_groups=dict(required=False, type="list", elements="str"),
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/netbox_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
- Group assignment for the contact
required: false
type: raw
link:
description:
- URL associated with the contact
required: false
type: str
version_added: "3.7.0"
tags:
description:
- Any tags that the contact may need to be associated with
Expand Down Expand Up @@ -156,6 +162,7 @@ def main():
address=dict(required=False, type="str"),
comments=dict(required=False, type="str"),
contact_group=dict(required=False, type="raw"),
link=dict(required=False, type="str"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
),
Expand Down
39 changes: 37 additions & 2 deletions plugins/modules/netbox_custom_field.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,25 @@
description:
- The type of custom field
required: false
type: raw
choices:
- text
- longtext
- integer
- boolean
- date
- url
- json
- select
- multiselect
- object
- multiobject
type: str
object_type:
description:
- The object type of the custom field (if any)
required: false
type: str
version_added: "3.7.0"
name:
description:
- Name of the custom field
Expand Down Expand Up @@ -165,7 +183,24 @@ def main():
required=True,
options=dict(
content_types=dict(required=False, type="list", elements="raw"),
type=dict(required=False, type="raw"),
type=dict(
required=False,
choices=[
"text",
"longtext",
"integer",
"boolean",
"date",
"url",
"json",
"select",
"multiselect",
"object",
"multiobject",
],
type="str",
),
object_type=dict(required=False, type="str"),
name=dict(required=True, type="str"),
label=dict(required=False, type="str"),
description=dict(required=False, type="str"),
Expand Down
9 changes: 8 additions & 1 deletion plugins/modules/netbox_custom_link.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,13 @@
description:
- Open link in new window
required: false
type: bool
type: bool
enabled:
description:
- Enable/disable custom link
required: false
type: bool
version_added: "3.7.0"
required: true
"""

Expand Down Expand Up @@ -140,6 +146,7 @@ def main():
group_name=dict(required=False, type="str"),
button_class=dict(required=False, type="raw"),
new_window=dict(required=False, type="bool"),
enabled=dict(required=False, type="bool"),
),
)
)
Expand Down
27 changes: 27 additions & 0 deletions plugins/modules/netbox_device_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,28 @@
- The mode of the interface
required: false
type: raw
vrf:
description:
- The VRF of the interface
required: false
type: raw
version_added: "3.7.0"
speed:
description:
- The speed of the interface
required: false
type: int
version_added: "3.7.0"
duplex:
description:
- The duplex of the interface
required: false
choices:
- half
- full
- auto
type: str
version_added: "3.7.0"
parent_interface:
description:
- The device's parent interface
Expand Down Expand Up @@ -286,6 +308,11 @@ def main():
mgmt_only=dict(required=False, type="bool"),
description=dict(required=False, type="str"),
mode=dict(required=False, type="raw"),
vrf=dict(required=False, type="raw"),
speed=dict(required=False, type="int"),
duplex=dict(
required=False, choices=["half", "full", "auto"], type="str"
),
parent_interface=dict(required=False, type="raw"),
untagged_vlan=dict(required=False, type="raw"),
tagged_vlans=dict(required=False, type="raw"),
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/netbox_provider_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
- Comments related to the provider network
required: false
type: str
service_id:
description:
- Arbitrary service ID
required: false
type: str
version_added: "3.7.0"
tags:
description:
- Any tags that the provdier_network may need to be associated with
Expand Down Expand Up @@ -138,6 +144,7 @@ def main():
name=dict(required=True, type="str"),
description=dict(required=False, type="str"),
comments=dict(required=False, type="str"),
service_id=dict(required=False, type="str"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
),
Expand Down
14 changes: 14 additions & 0 deletions plugins/modules/netbox_vlan_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,18 @@
required: false
type: str
version_added: "3.1.0"
min_vid:
description:
- Lowest permissible ID of a child VLAN
required: false
type: int
version_added: "3.7.0"
max_vid:
description:
- Highest permissible ID of a child VLAN
required: false
type: int
version_added: "3.7.0"
tags:
description:
- The tags to add/update
Expand Down Expand Up @@ -178,6 +190,8 @@ def main():
],
),
scope=dict(required=False, type="raw"),
min_vid=dict(required=False, type="int"),
max_vid=dict(required=False, type="int"),
description=dict(required=False, type="str"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
Expand Down
7 changes: 7 additions & 0 deletions plugins/modules/netbox_vm_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@
- A list of tagged VLANS to be assigned to interface. Mode must be set to either C(Tagged) or C(Tagged All)
required: false
type: raw
vrf:
description:
- VRF the interface is associated with
required: false
type: raw
version_added: "3.7.0"
tags:
description:
- Any tags that the prefix may need to be associated with
Expand Down Expand Up @@ -209,6 +215,7 @@ def main():
parent_vm_interface=dict(required=False, type="raw"),
untagged_vlan=dict(required=False, type="raw"),
tagged_vlans=dict(required=False, type="raw"),
vrf=dict(required=False, type="raw"),
tags=dict(required=False, type="list", elements="raw"),
custom_fields=dict(required=False, type="dict"),
),
Expand Down

0 comments on commit 0e3d35c

Please sign in to comment.