Skip to content

Commit 734f2fc

Browse files
committed
Allow dict parameters for primary_mac_address
Coercing primary_mac_address to str prevents using dict constructs to point to a specific object in netbox, instead always searching for an entry with the plaintext mac. This key for the object is not guaranteed to be unique, resulting in errors when multiple objects are returned. Allowing raw parameters permits the following construct to lookup mac addresses in a different way to get an unique object, for example by id: ```yaml netbox_device_interface: primary_mac_address: id: "{{ mac_address_object_id }}" ``` Fixes: #1413
1 parent 04b4b44 commit 734f2fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

plugins/modules/netbox_device_interface.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
description:
9191
- The primary MAC address of the interface (NetBox 4.2 and later)
9292
required: false
93-
type: str
93+
type: raw
9494
wwn:
9595
description:
9696
- The WWN of the interface
@@ -340,7 +340,7 @@ def main():
340340
bridge=dict(required=False, type="raw"),
341341
mtu=dict(required=False, type="int"),
342342
mac_address=dict(required=False, type="str"),
343-
primary_mac_address=dict(required=False, type="str"),
343+
primary_mac_address=dict(required=False, type="raw"),
344344
wwn=dict(required=False, type="str"),
345345
mgmt_only=dict(required=False, type="bool"),
346346
poe_type=dict(required=False, type="raw"),

0 commit comments

Comments
 (0)