From 29a01ea2409a24212ebf61f617658f04ff6bfe85 Mon Sep 17 00:00:00 2001 From: hansmi Date: Sat, 7 Oct 2023 14:24:56 +0200 Subject: [PATCH] Add support for the "ip dhcp-server option" path (#223) Make it possible to manage IPv4 DHCP server options. Signed-off-by: Michael Hanselmann --- .../223-add-ip-dhcp-server-option.yml | 2 ++ plugins/module_utils/_api_data.py | 22 +++++++++++++++++++ plugins/modules/api_info.py | 2 ++ plugins/modules/api_modify.py | 2 ++ 4 files changed, 28 insertions(+) create mode 100644 changelogs/fragments/223-add-ip-dhcp-server-option.yml diff --git a/changelogs/fragments/223-add-ip-dhcp-server-option.yml b/changelogs/fragments/223-add-ip-dhcp-server-option.yml new file mode 100644 index 00000000..49979b73 --- /dev/null +++ b/changelogs/fragments/223-add-ip-dhcp-server-option.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add support for the ``ip dhcp-server option`` and ``ip dhcp-server option sets`` paths (https://github.com/ansible-collections/community.routeros/pull/223). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 32f24480..d5ca137c 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1847,6 +1847,28 @@ def join_path(path): }, ), ), + ('ip', 'dhcp-server', 'option'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name',), + fields={ + 'code': KeyInfo(required=True), + 'name': KeyInfo(), + 'value': KeyInfo(default=''), + 'force': KeyInfo(), + }, + ), + ), + ('ip', 'dhcp-server', 'option', 'sets'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name',), + fields={ + 'name': KeyInfo(required=True), + 'options': KeyInfo(), + }, + ), + ), ('ip', 'dns'): APIData( unversioned=VersionedAPIData( single_value=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 048f4344..cb7da793 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -99,6 +99,8 @@ - ip dhcp-server config - ip dhcp-server lease - ip dhcp-server network + - ip dhcp-server option + - ip dhcp-server option sets - ip dns - ip dns static - ip firewall address-list diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 352f843a..42092972 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -108,6 +108,8 @@ - ip dhcp-server config - ip dhcp-server lease - ip dhcp-server network + - ip dhcp-server option + - ip dhcp-server option sets - ip dns - ip dns static - ip firewall address-list