From 6986e2fc25861db213f96fc499ab59c1ed401c43 Mon Sep 17 00:00:00 2001 From: hansmi Date: Mon, 5 Aug 2024 20:46:28 +0200 Subject: [PATCH] Support name and is-responder properties on Wireguard peers (#304) From the RouterOS 7.15 changelog: ``` *) wireguard - added option to mark peer as responder only; *) wireguard - added peer "name" field and display it in logs; ``` --- changelogs/fragments/304-wireguard-name-responder.yml | 2 ++ plugins/module_utils/_api_data.py | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 changelogs/fragments/304-wireguard-name-responder.yml diff --git a/changelogs/fragments/304-wireguard-name-responder.yml b/changelogs/fragments/304-wireguard-name-responder.yml new file mode 100644 index 00000000..e3330829 --- /dev/null +++ b/changelogs/fragments/304-wireguard-name-responder.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add support for the ``name`` and ``is-responder`` properties under the ``interface wireguard peers`` path introduced in RouterOS 7.15 (https://github.com/ansible-collections/community.routeros/pull/304). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 3401d64b..9cdb810b 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2340,6 +2340,10 @@ def join_path(path): 'preshared-key': KeyInfo(can_disable=True, remove_value=''), 'public-key': KeyInfo(), }, + versioned_fields=[ + ([('7.15', '>=')], 'name', KeyInfo()), + ([('7.15', '>=')], 'is-responder', KeyInfo()), + ], ), ), ('interface', 'wireless'): APIData(