From 85415c0a553566ba1c9dd29c16b9c8e2cf5a5ec8 Mon Sep 17 00:00:00 2001 From: Shnaidman Shaul Date: Sun, 3 Sep 2023 00:40:21 +0300 Subject: [PATCH] Fix device_role to role breaking change in NetBox module Updated the Ansible NetBox module to accommodate recent changes in the NetBox API where `device_role` has been renamed to `role`. Also made corresponding adjustments in the pynetbox library to ensure compatibility. --- plugins/modules/netbox_device.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/modules/netbox_device.py b/plugins/modules/netbox_device.py index 403194046..5b382d81d 100644 --- a/plugins/modules/netbox_device.py +++ b/plugins/modules/netbox_device.py @@ -40,7 +40,7 @@ - Required if I(state=present) and the device does not exist yet required: false type: raw - device_role: + role: description: - Required if I(state=present) and the device does not exist yet required: false @@ -190,7 +190,7 @@ data: name: Test Device device_type: C9410R - device_role: Core Switch + role: Core Switch site: Main state: present @@ -201,7 +201,7 @@ data: name: "" device_type: C9410R - device_role: Core Switch + role: Core Switch site: Main state: present @@ -220,7 +220,7 @@ data: name: Another Test Device device_type: C9410R - device_role: Core Switch + role: Core Switch site: Main local_context_data: bgp: "65000" @@ -276,7 +276,7 @@ def main(): options=dict( name=dict(required=True, type="str"), device_type=dict(required=False, type="raw"), - device_role=dict(required=False, type="raw"), + role=dict(required=False, type="raw"), tenant=dict(required=False, type="raw"), platform=dict(required=False, type="raw"), serial=dict(required=False, type="str"),