From 1a5a8d49dc7954fcdf80aa02dd19e5265d94f8b2 Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Thu, 10 Nov 2022 08:34:48 +0100 Subject: [PATCH 1/8] adding "system ntp *" paths related to ROS7 Signed-off-by: Tomas Herfert --- plugins/module_utils/_api_data.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 5ba3e26d..f34912b8 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1487,6 +1487,37 @@ def join_path(path): 'primary-ntp': KeyInfo(default='0.0.0.0'), 'secondary-ntp': KeyInfo(default='0.0.0.0'), 'server-dns-names': KeyInfo(default=''), + 'servers': KeyInfo(), + 'mode': KeyInfo(), + 'vrf': KeyInfo(), + }, + ), + ('system', 'ntp', 'client','servers'): APIData( + primary_keys=('address', ), + fully_understood=True, + fields={ + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'address': KeyInfo(), + 'auth-key': KeyInfo(), + 'iburst': KeyInfo(), + 'max-poll': KeyInfo(), + 'min-poll': KeyInfo(), + }, + ), + ('system', 'ntp', 'server'): APIData( + single_value=True, + fully_understood=True, + fields={ + 'auth-key': KeyInfo(default='none'), + 'broadcast': KeyInfo(default=False), + 'broadcast-addresses': KeyInfo(default=''), + 'enabled': KeyInfo(default=False), + 'local-clock-stratum': KeyInfo(default=5), + 'manycast': KeyInfo(default=False), + 'multicast': KeyInfo(default=False), + 'use-local-clock': KeyInfo(default=False), + 'vrf': KeyInfo(default='main'), }, ), ('system', 'package', 'update'): APIData( From 820d25eb58b78fed5a7b43639e51060b85d77c96 Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Thu, 10 Nov 2022 08:45:34 +0100 Subject: [PATCH 2/8] changelog Signed-off-by: Tomas Herfert --- changelogs/fragments/122-api.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/122-api.yml diff --git a/changelogs/fragments/122-api.yml b/changelogs/fragments/122-api.yml new file mode 100644 index 00000000..56f236df --- /dev/null +++ b/changelogs/fragments/122-api.yml @@ -0,0 +1,3 @@ +minor_changes: + - api_modify, api_info - support new files and paths available in ROS7 under ``system ntp`` + (https://github.com/ansible-collections/community.routeros/pull/122). From 37bf3cf00d13ca05fc2b5389874ad15d383a8650 Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Thu, 10 Nov 2022 08:46:38 +0100 Subject: [PATCH 3/8] docs Signed-off-by: Tomas Herfert --- plugins/modules/api_info.py | 2 ++ plugins/modules/api_modify.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index b7db4659..a297d630 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -117,6 +117,8 @@ - system leds settings - system note - system ntp client + - system ntp client servers + - system ntp server - system package update - system routerboard settings - system upgrade mirror diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 5b3fc15a..a77fdc14 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -122,6 +122,8 @@ - system leds settings - system note - system ntp client + - system ntp client servers + - system ntp server - system package update - system routerboard settings - system upgrade mirror From f69134a29f58c161f3a6e4ac6df955d939cf4a27 Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Thu, 10 Nov 2022 08:50:06 +0100 Subject: [PATCH 4/8] typo Signed-off-by: Tomas Herfert --- changelogs/fragments/122-api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/122-api.yml b/changelogs/fragments/122-api.yml index 56f236df..e68313d5 100644 --- a/changelogs/fragments/122-api.yml +++ b/changelogs/fragments/122-api.yml @@ -1,3 +1,3 @@ minor_changes: - - api_modify, api_info - support new files and paths available in ROS7 under ``system ntp`` + - api_modify, api_info - support new fields and paths available in ROS7 under ``system ntp`` (https://github.com/ansible-collections/community.routeros/pull/122). From 52fbfaa1bc7b4217e178990e61ae10b084ad6023 Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Thu, 10 Nov 2022 09:56:39 +0100 Subject: [PATCH 5/8] sanity fix Signed-off-by: Tomas Herfert --- plugins/module_utils/_api_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index f34912b8..ab56c24f 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1492,7 +1492,7 @@ def join_path(path): 'vrf': KeyInfo(), }, ), - ('system', 'ntp', 'client','servers'): APIData( + ('system', 'ntp', 'client', 'servers'): APIData( primary_keys=('address', ), fully_understood=True, fields={ From 20137875ac1c0e7b462787d303df48f82e7201c3 Mon Sep 17 00:00:00 2001 From: Tomas Herfert Date: Thu, 10 Nov 2022 17:23:27 +0100 Subject: [PATCH 6/8] setting the correct defaults Signed-off-by: Tomas Herfert --- plugins/module_utils/_api_data.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index ab56c24f..fbaa9c37 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1487,9 +1487,9 @@ def join_path(path): 'primary-ntp': KeyInfo(default='0.0.0.0'), 'secondary-ntp': KeyInfo(default='0.0.0.0'), 'server-dns-names': KeyInfo(default=''), - 'servers': KeyInfo(), - 'mode': KeyInfo(), - 'vrf': KeyInfo(), + 'servers': KeyInfo(default=''), + 'mode': KeyInfo(default='unicast'), + 'vrf': KeyInfo(default='main'), }, ), ('system', 'ntp', 'client', 'servers'): APIData( @@ -1499,10 +1499,10 @@ def join_path(path): 'comment': KeyInfo(can_disable=True, remove_value=''), 'disabled': KeyInfo(default=False), 'address': KeyInfo(), - 'auth-key': KeyInfo(), - 'iburst': KeyInfo(), - 'max-poll': KeyInfo(), - 'min-poll': KeyInfo(), + 'auth-key': KeyInfo(default='none'), + 'iburst': KeyInfo(default=True), + 'max-poll': KeyInfo(default=10), + 'min-poll': KeyInfo(default=6), }, ), ('system', 'ntp', 'server'): APIData( From 726d0cb47a94a2d41d0c250e2e8d3b207e279697 Mon Sep 17 00:00:00 2001 From: Tomas Herfert <68421396+therfert@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:40:29 +0100 Subject: [PATCH 7/8] Apply suggestions from code review Co-authored-by: Felix Fontein --- changelogs/fragments/122-api.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelogs/fragments/122-api.yml b/changelogs/fragments/122-api.yml index e68313d5..981eca19 100644 --- a/changelogs/fragments/122-api.yml +++ b/changelogs/fragments/122-api.yml @@ -1,3 +1,4 @@ minor_changes: - - api_modify, api_info - support new fields and paths available in ROS7 under ``system ntp`` + - api_modify, api_info - support paths ``system ntp client servers`` and ``system ntp server`` available in ROS7, + as well as new fields ``servers``, ``mode``, and ``vf`` for ``system ntp client`` (https://github.com/ansible-collections/community.routeros/pull/122). From 13080449857948feeec9e35da1a3c0b7036836c5 Mon Sep 17 00:00:00 2001 From: Tomas Herfert <68421396+therfert@users.noreply.github.com> Date: Thu, 10 Nov 2022 20:41:14 +0100 Subject: [PATCH 8/8] typo --- changelogs/fragments/122-api.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/122-api.yml b/changelogs/fragments/122-api.yml index 981eca19..399dabec 100644 --- a/changelogs/fragments/122-api.yml +++ b/changelogs/fragments/122-api.yml @@ -1,4 +1,4 @@ minor_changes: - api_modify, api_info - support paths ``system ntp client servers`` and ``system ntp server`` available in ROS7, - as well as new fields ``servers``, ``mode``, and ``vf`` for ``system ntp client`` + as well as new fields ``servers``, ``mode``, and ``vrf`` for ``system ntp client`` (https://github.com/ansible-collections/community.routeros/pull/122).