From 91ff31817f7eb33a5d8323fd6adf77fe884a9133 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Wed, 16 Aug 2023 23:27:10 +0200 Subject: [PATCH] Add "interface ppp-client" to API data The default values match those of RouterOS 7.11 on a Mikrotik RB924i-2nD-BT5&BG77 ("Knot"). Upstream documentation: https://help.mikrotik.com/docs/display/ROS/PPP Signed-off-by: Michael Hanselmann --- .../fragments/199-add-interface-pppclient.yml | 2 ++ plugins/module_utils/_api_data.py | 30 +++++++++++++++++++ plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + 4 files changed, 34 insertions(+) create mode 100644 changelogs/fragments/199-add-interface-pppclient.yml diff --git a/changelogs/fragments/199-add-interface-pppclient.yml b/changelogs/fragments/199-add-interface-pppclient.yml new file mode 100644 index 00000000..989ec9c8 --- /dev/null +++ b/changelogs/fragments/199-add-interface-pppclient.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add support for the ``interface ppp-client`` path (https://github.com/ansible-collections/community.routeros/pull/199). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index ad6ef966..6d6089d3 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -298,6 +298,36 @@ def join_path(path): 'use-peer-dns': KeyInfo(), }, ), + ('interface', 'ppp-client'): APIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'add-default-route': KeyInfo(default=True), + 'allow': KeyInfo(default='pap,chap,mschap1,mschap2'), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'data-channel': KeyInfo(default=0), + 'default-route-distance': KeyInfo(default=1), + 'dial-command': KeyInfo(), + 'dial-on-demand': KeyInfo(default=True), + 'disabled': KeyInfo(default=True), + 'info-channel': KeyInfo(default=0), + 'keepalive-timeout': KeyInfo(default=30), + 'max-mru': KeyInfo(default=1500), + 'max-mtu': KeyInfo(default=1500), + 'modem-init': KeyInfo(default=''), + 'mrru': KeyInfo(default='disabled'), + 'name': KeyInfo(), + 'null-modem': KeyInfo(default=False), + 'password': KeyInfo(default=''), + 'phone': KeyInfo(default=''), + 'pin': KeyInfo(default=''), + 'port': KeyInfo(), + 'profile': KeyInfo(default='default'), + 'running': KeyInfo(default=False), + 'use-peer-dns': KeyInfo(default=True), + 'user': KeyInfo(default=''), + }, + ), ('interface', 'pppoe-client'): APIData( fully_understood=True, primary_keys=('name', ), diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 31db39ee..7be10c5c 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -72,6 +72,7 @@ - interface list - interface list member - interface ovpn-server server + - interface ppp-client - interface pppoe-client - interface pptp-server server - interface sstp-server server diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index d5c319bd..3e66a987 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -77,6 +77,7 @@ - interface list - interface list member - interface ovpn-server server + - interface ppp-client - interface pppoe-client - interface pptp-server server - interface sstp-server server