From 437c240d382aa095ddff26056ab421c3f3e1a6a7 Mon Sep 17 00:00:00 2001 From: Yuri Timenkov Date: Sat, 30 Sep 2023 15:22:04 +0200 Subject: [PATCH 1/8] Support for WifiWave2. Added configuration profiles to configure Mikrotik APs which have only WifiWave2 package. --- plugins/module_utils/_api_data.py | 121 ++++++++++++++++++++++++++++++ plugins/modules/api_modify.py | 5 ++ 2 files changed, 126 insertions(+) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 28b0f061..4ac3941f 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1708,6 +1708,127 @@ def join_path(path): }, ), ), + ('interface', 'wifiwave2'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + required_one_of=[['default-name', 'master-interface']], + fields={ + 'aaa': KeyInfo(), + 'arp-timeout': KeyInfo(default='auto'), + 'arp': KeyInfo(default='enabled'), + 'channel': KeyInfo(), + 'configuration': KeyInfo(), + 'datapath': KeyInfo(), + 'default-name': KeyInfo(), + 'disable-running-check': KeyInfo(default=False), + 'interworking': KeyInfo(), + 'l2mtu': KeyInfo(default=1600), + 'mac-address': KeyInfo(), + 'master-interface': KeyInfo(), + 'mtu': KeyInfo(default=1500), + 'name': KeyInfo(), + 'security': KeyInfo(), + 'steering': KeyInfo(), + }, + ), + ), + ('interface', 'wifiwave2', 'security'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'authentication-types': KeyInfo(), + 'connect-group': KeyInfo(can_disable=True), + 'connect-priority': KeyInfo(), + 'dh-groups': KeyInfo(), + 'disable-pmkid': KeyInfo(default=False), + 'eap-accounting': KeyInfo(default=False), + 'eap-anonymous-identity': KeyInfo(), + 'eap-certificate-mode': KeyInfo(default='dont-verify-certificate'), + 'eap-methods': KeyInfo(), + 'eap-password': KeyInfo(), + 'eap-tls-certificate': KeyInfo(), + 'eap-username': KeyInfo(), + 'encryption': KeyInfo(default='ccmp'), + 'ft-mobility-domain': KeyInfo(default=0xADC4), + 'ft-nas-identifier': KeyInfo(), + 'ft-over-ds': KeyInfo(default=False), + 'ft-preserve-vlanid': KeyInfo(default=True), + 'ft-r0-key-lifetime': KeyInfo(default='600000s'), + 'ft-reassociation-deadline': KeyInfo(default='20s'), + 'ft': KeyInfo(default=False), + 'group-encryption': KeyInfo(default='ccmp'), + 'group-key-update': KeyInfo(default='24h'), + 'management-encryption': KeyInfo(default='cmac'), + 'management-protection': KeyInfo(), + 'name': KeyInfo(), + 'owe-transition-interface': KeyInfo(), + 'passphrase': KeyInfo(default=''), + 'sae-anti-clogging-threshold': KeyInfo(can_disable=True), + 'sae-max-failure-rate': KeyInfo(can_disable=True), + 'sae-pwe': KeyInfo(default='both'), + 'wps': KeyInfo(default='push-button'), + }, + ), + ), + ('interface', 'wifiwave2', 'configuration'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'aaa': KeyInfo(), + 'antenna-gain': KeyInfo(), + 'beacon-interval': KeyInfo(default=100), + 'chains': KeyInfo(), + 'channel': KeyInfo(), + 'country': KeyInfo(default='United States'), + 'datapath': KeyInfo(), + 'dtim-period': KeyInfo(default=1), + 'hide-ssid': KeyInfo(default=False), + 'interworking': KeyInfo(), + 'manager': KeyInfo(), + 'mode': KeyInfo(default='ap'), + 'name': KeyInfo(), + 'security': KeyInfo(), + 'security': KeyInfo(), + 'ssid': KeyInfo(), + 'steering': KeyInfo(), + 'tx-chains': KeyInfo(), + 'tx-power': KeyInfo(), + }, + ), + ), + ('interface', 'wifiwave2', 'channel'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'band': KeyInfo(), + 'frequency': KeyInfo(), + 'name': KeyInfo(), + 'secondary-frequency': KeyInfo(), + 'skip-dfs-channels': KeyInfo(default='disabled'), + 'width': KeyInfo(), + }, + ), + ), + ('interface', 'wifiwave2', 'datapath'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'bridge': KeyInfo(), + 'bridge-cost': KeyInfo(), + 'bridge-horizon': KeyInfo(), + 'client-isolation': KeyInfo(default=False), + 'interface-list': KeyInfo(), + 'name': KeyInfo(), + 'openflow-switch': KeyInfo(), + 'vlan-id': KeyInfo(), + }, + ), + ), ('iot', 'modbus'): APIData( unversioned=VersionedAPIData( single_value=True, diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 07ec5b01..f0788cb6 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -95,6 +95,11 @@ - interface wireless security-profiles - interface wireless sniffer - interface wireless snooper + - interface wifiwave2 + - interface wifiwave2 channel + - interface wifiwave2 configuration + - interface wifiwave2 datapath + - interface wifiwave2 security - iot modbus - ip accounting - ip accounting web-access From 268608350adfe00990474138002e3b995f10f407 Mon Sep 17 00:00:00 2001 From: Yuri Timenkov Date: Sun, 3 Dec 2023 13:08:50 +0100 Subject: [PATCH 2/8] Addressed review comments 1. Sorted lexicographically new entries 2. Added versioning --- plugins/module_utils/_api_data.py | 251 ++++++++++++++++-------------- 1 file changed, 130 insertions(+), 121 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 4ac3941f..3371bbd6 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1468,6 +1468,136 @@ def join_path(path): }, ), ), + ('interface', 'wifiwave2'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + required_one_of=[['default-name', 'master-interface']], + fields={ + 'aaa': KeyInfo(), + 'arp-timeout': KeyInfo(default='auto'), + 'arp': KeyInfo(default='enabled'), + 'channel': KeyInfo(), + 'configuration': KeyInfo(), + 'datapath': KeyInfo(), + 'default-name': KeyInfo(), + 'disable-running-check': KeyInfo(default=False), + 'interworking': KeyInfo(), + 'l2mtu': KeyInfo(default=1600), + 'mac-address': KeyInfo(), + 'master-interface': KeyInfo(), + 'mtu': KeyInfo(default=1500), + 'name': KeyInfo(), + 'security': KeyInfo(), + 'steering': KeyInfo(), + }, + )), + ], + ), + ('interface', 'wifiwave2', 'channel'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'band': KeyInfo(), + 'frequency': KeyInfo(), + 'name': KeyInfo(), + 'secondary-frequency': KeyInfo(), + 'skip-dfs-channels': KeyInfo(default='disabled'), + 'width': KeyInfo(), + }, + )), + ], + ), + ('interface', 'wifiwave2', 'configuration'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'aaa': KeyInfo(), + 'antenna-gain': KeyInfo(), + 'beacon-interval': KeyInfo(default=100), + 'chains': KeyInfo(), + 'channel': KeyInfo(), + 'country': KeyInfo(default='United States'), + 'datapath': KeyInfo(), + 'dtim-period': KeyInfo(default=1), + 'hide-ssid': KeyInfo(default=False), + 'interworking': KeyInfo(), + 'manager': KeyInfo(), + 'mode': KeyInfo(default='ap'), + 'name': KeyInfo(), + 'security': KeyInfo(), + 'ssid': KeyInfo(), + 'steering': KeyInfo(), + 'tx-chains': KeyInfo(), + 'tx-power': KeyInfo(), + }, + )), + ], + ), + ('interface', 'wifiwave2', 'datapath'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'bridge': KeyInfo(), + 'bridge-cost': KeyInfo(), + 'bridge-horizon': KeyInfo(), + 'client-isolation': KeyInfo(default=False), + 'interface-list': KeyInfo(), + 'name': KeyInfo(), + 'openflow-switch': KeyInfo(), + 'vlan-id': KeyInfo(), + }, + )), + ], + ), + ('interface', 'wifiwave2', 'security'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'authentication-types': KeyInfo(), + 'connect-group': KeyInfo(can_disable=True), + 'connect-priority': KeyInfo(), + 'dh-groups': KeyInfo(), + 'disable-pmkid': KeyInfo(default=False), + 'eap-accounting': KeyInfo(default=False), + 'eap-anonymous-identity': KeyInfo(), + 'eap-certificate-mode': KeyInfo(default='dont-verify-certificate'), + 'eap-methods': KeyInfo(), + 'eap-password': KeyInfo(), + 'eap-tls-certificate': KeyInfo(), + 'eap-username': KeyInfo(), + 'encryption': KeyInfo(default='ccmp'), + 'ft-mobility-domain': KeyInfo(default=0xADC4), + 'ft-nas-identifier': KeyInfo(), + 'ft-over-ds': KeyInfo(default=False), + 'ft-preserve-vlanid': KeyInfo(default=True), + 'ft-r0-key-lifetime': KeyInfo(default='600000s'), + 'ft-reassociation-deadline': KeyInfo(default='20s'), + 'ft': KeyInfo(default=False), + 'group-encryption': KeyInfo(default='ccmp'), + 'group-key-update': KeyInfo(default='24h'), + 'management-encryption': KeyInfo(default='cmac'), + 'management-protection': KeyInfo(), + 'name': KeyInfo(), + 'owe-transition-interface': KeyInfo(), + 'passphrase': KeyInfo(default=''), + 'sae-anti-clogging-threshold': KeyInfo(can_disable=True), + 'sae-max-failure-rate': KeyInfo(can_disable=True), + 'sae-pwe': KeyInfo(default='both'), + 'wps': KeyInfo(default='push-button'), + }, + )), + ], + ), ('interface', 'wireguard'): APIData( unversioned=VersionedAPIData( fully_understood=True, @@ -1708,127 +1838,6 @@ def join_path(path): }, ), ), - ('interface', 'wifiwave2'): APIData( - unversioned=VersionedAPIData( - fully_understood=True, - primary_keys=('name', ), - required_one_of=[['default-name', 'master-interface']], - fields={ - 'aaa': KeyInfo(), - 'arp-timeout': KeyInfo(default='auto'), - 'arp': KeyInfo(default='enabled'), - 'channel': KeyInfo(), - 'configuration': KeyInfo(), - 'datapath': KeyInfo(), - 'default-name': KeyInfo(), - 'disable-running-check': KeyInfo(default=False), - 'interworking': KeyInfo(), - 'l2mtu': KeyInfo(default=1600), - 'mac-address': KeyInfo(), - 'master-interface': KeyInfo(), - 'mtu': KeyInfo(default=1500), - 'name': KeyInfo(), - 'security': KeyInfo(), - 'steering': KeyInfo(), - }, - ), - ), - ('interface', 'wifiwave2', 'security'): APIData( - unversioned=VersionedAPIData( - fully_understood=True, - primary_keys=('name', ), - fields={ - 'authentication-types': KeyInfo(), - 'connect-group': KeyInfo(can_disable=True), - 'connect-priority': KeyInfo(), - 'dh-groups': KeyInfo(), - 'disable-pmkid': KeyInfo(default=False), - 'eap-accounting': KeyInfo(default=False), - 'eap-anonymous-identity': KeyInfo(), - 'eap-certificate-mode': KeyInfo(default='dont-verify-certificate'), - 'eap-methods': KeyInfo(), - 'eap-password': KeyInfo(), - 'eap-tls-certificate': KeyInfo(), - 'eap-username': KeyInfo(), - 'encryption': KeyInfo(default='ccmp'), - 'ft-mobility-domain': KeyInfo(default=0xADC4), - 'ft-nas-identifier': KeyInfo(), - 'ft-over-ds': KeyInfo(default=False), - 'ft-preserve-vlanid': KeyInfo(default=True), - 'ft-r0-key-lifetime': KeyInfo(default='600000s'), - 'ft-reassociation-deadline': KeyInfo(default='20s'), - 'ft': KeyInfo(default=False), - 'group-encryption': KeyInfo(default='ccmp'), - 'group-key-update': KeyInfo(default='24h'), - 'management-encryption': KeyInfo(default='cmac'), - 'management-protection': KeyInfo(), - 'name': KeyInfo(), - 'owe-transition-interface': KeyInfo(), - 'passphrase': KeyInfo(default=''), - 'sae-anti-clogging-threshold': KeyInfo(can_disable=True), - 'sae-max-failure-rate': KeyInfo(can_disable=True), - 'sae-pwe': KeyInfo(default='both'), - 'wps': KeyInfo(default='push-button'), - }, - ), - ), - ('interface', 'wifiwave2', 'configuration'): APIData( - unversioned=VersionedAPIData( - fully_understood=True, - primary_keys=('name', ), - fields={ - 'aaa': KeyInfo(), - 'antenna-gain': KeyInfo(), - 'beacon-interval': KeyInfo(default=100), - 'chains': KeyInfo(), - 'channel': KeyInfo(), - 'country': KeyInfo(default='United States'), - 'datapath': KeyInfo(), - 'dtim-period': KeyInfo(default=1), - 'hide-ssid': KeyInfo(default=False), - 'interworking': KeyInfo(), - 'manager': KeyInfo(), - 'mode': KeyInfo(default='ap'), - 'name': KeyInfo(), - 'security': KeyInfo(), - 'security': KeyInfo(), - 'ssid': KeyInfo(), - 'steering': KeyInfo(), - 'tx-chains': KeyInfo(), - 'tx-power': KeyInfo(), - }, - ), - ), - ('interface', 'wifiwave2', 'channel'): APIData( - unversioned=VersionedAPIData( - fully_understood=True, - primary_keys=('name', ), - fields={ - 'band': KeyInfo(), - 'frequency': KeyInfo(), - 'name': KeyInfo(), - 'secondary-frequency': KeyInfo(), - 'skip-dfs-channels': KeyInfo(default='disabled'), - 'width': KeyInfo(), - }, - ), - ), - ('interface', 'wifiwave2', 'datapath'): APIData( - unversioned=VersionedAPIData( - fully_understood=True, - primary_keys=('name', ), - fields={ - 'bridge': KeyInfo(), - 'bridge-cost': KeyInfo(), - 'bridge-horizon': KeyInfo(), - 'client-isolation': KeyInfo(default=False), - 'interface-list': KeyInfo(), - 'name': KeyInfo(), - 'openflow-switch': KeyInfo(), - 'vlan-id': KeyInfo(), - }, - ), - ), ('iot', 'modbus'): APIData( unversioned=VersionedAPIData( single_value=True, From 669787594f8ecaec4919e088fdc2347c323987f7 Mon Sep 17 00:00:00 2001 From: Yuri Timenkov Date: Sun, 3 Dec 2023 17:57:12 +0100 Subject: [PATCH 3/8] Added few related paths --- plugins/module_utils/_api_data.py | 159 +++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 3371bbd6..e4252b14 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1495,6 +1495,86 @@ def join_path(path): )), ], ), + ('interface', 'wifiwave2', 'aaa'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + single_value=True, + fully_understood=True, + primary_keys=('name', ), + fields={ + 'called-format': KeyInfo(can_disable=True), + 'calling-format': KeyInfo(can_disable=True), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=True), + 'interim-update': KeyInfo(can_disable=True), + 'mac-caching': KeyInfo(can_disable=True), + 'name': KeyInfo(), + 'nas-identifier': KeyInfo(can_disable=True), + 'password-format': KeyInfo(can_disable=True), + 'username-format': KeyInfo(can_disable=True), + }, + )), + ], + ), + ('interface', 'wifiwave2', 'access-list'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + fields={ + 'action': KeyInfo(can_disable=True), + 'allow-signal-out-of-range': KeyInfo(can_disable=True), + 'client-isolation': KeyInfo(can_disable=True), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=True), + 'interface': KeyInfo(can_disable=True), + 'mac-address': KeyInfo(can_disable=True), + 'mac-address-mask': KeyInfo(can_disable=True), + 'passphrase': KeyInfo(can_disable=True), + 'radius-accounting': KeyInfo(can_disable=True), + 'signal-range': KeyInfo(can_disable=True), + 'ssid-regexp': KeyInfo(), + 'time': KeyInfo(can_disable=True), + 'vlan-id': KeyInfo(can_disable=True), + }, + )), + ], + ), + ('interface', 'wifiwave2', 'cap'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + single_value=True, + fully_understood=True, + fields={ + 'caps-man-addresses': KeyInfo(default=''), + 'caps-man-certificate-common-names': KeyInfo(default=''), + 'caps-man-names': KeyInfo(default=''), + 'certificate': KeyInfo(default='none'), + 'discovery-interfaces': KeyInfo(default=''), + 'enabled': KeyInfo(default=False), + 'lock-to-caps-man': KeyInfo(default=False), + 'slaves-datapath': KeyInfo(), + 'slaves-static': KeyInfo(), + }, + )), + ], + ), + ('interface', 'wifiwave2', 'capsman'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + single_value=True, + fully_understood=True, + fields={ + 'ca-certificate': KeyInfo(default=''), + 'certificate': KeyInfo(default='none'), + 'enabled': KeyInfo(default=False), + 'package-path': KeyInfo(default=''), + 'require-peer-certificate': KeyInfo(default=False), + 'upgrade-policy': KeyInfo(default='none'), + 'interfaces': KeyInfo(default=''), + }, + )), + ], + ), ('interface', 'wifiwave2', 'channel'): APIData( versioned=[ ('7.11', '>=', VersionedAPIData( @@ -1556,7 +1636,68 @@ def join_path(path): }, )), ], - ), + ), + ('interface', 'wifiwave2', 'interworking'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + '3gpp-info': KeyInfo(), + 'authentication-types': KeyInfo(), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'connection-capabilities': KeyInfo(), + 'disabled': KeyInfo(default=False), + 'domain-names': KeyInfo(), + 'esr': KeyInfo(), + 'hessid': KeyInfo(), + 'hotspot20': KeyInfo(), + 'hotspot20-dgaf': KeyInfo(), + 'internet': KeyInfo(), + 'ipv4-availability': KeyInfo(), + 'ipv6-availability': KeyInfo(), + 'name': KeyInfo(), + 'network-type': KeyInfo(), + 'operational-classes': KeyInfo(), + 'operator-names': KeyInfo(), + 'realms': KeyInfo(), + 'roaming-ois': KeyInfo(), + 'uesa': KeyInfo(), + 'venue': KeyInfo(), + 'venue-names': KeyInfo(), + 'wan-at-capacity': KeyInfo(), + 'wan-downlink': KeyInfo(), + 'wan-downlink-load': KeyInfo(), + 'wan-measurement-duration': KeyInfo(), + 'wan-status': KeyInfo(), + 'wan-symmetric': KeyInfo(), + 'wan-uplink': KeyInfo(), + 'wan-uplink-load': KeyInfo(), + }, + )), + ], + ), + ('interface', 'wifiwave2', 'provisioning'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('action', ), + fields={ + 'action': KeyInfo(default='none'), + 'address-ranges': KeyInfo(), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'common-name-regexp': KeyInfo(), + 'disabled': KeyInfo(default=False), + 'identity-regexp': KeyInfo(), + 'master-configuration': KeyInfo(), + 'name-format': KeyInfo(), + 'radio-mac': KeyInfo(), + 'slave-configurations': KeyInfo(), + 'supported-bands': KeyInfo(), + }, + )), + ], + ), ('interface', 'wifiwave2', 'security'): APIData( versioned=[ ('7.11', '>=', VersionedAPIData( @@ -1598,6 +1739,22 @@ def join_path(path): )), ], ), + ('interface', 'wifiwave2', 'security'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'name': KeyInfo(), + 'neighbor-group': KeyInfo(), + 'rrm': KeyInfo(), + 'wnm': KeyInfo(), + }, + )), + ], + ), ('interface', 'wireguard'): APIData( unversioned=VersionedAPIData( fully_understood=True, From da42acd5a1baf2de0ffe64338338b5454e511d1b Mon Sep 17 00:00:00 2001 From: Yuri Timenkov Date: Sun, 3 Dec 2023 18:06:42 +0100 Subject: [PATCH 4/8] Fixed typos --- .../fragments/226-support-for-WifiWave2.yml | 2 ++ plugins/module_utils/_api_data.py | 3 +-- plugins/modules/api_modify.py | 17 ++++++++++++----- 3 files changed, 15 insertions(+), 7 deletions(-) create mode 100644 changelogs/fragments/226-support-for-WifiWave2.yml diff --git a/changelogs/fragments/226-support-for-WifiWave2.yml b/changelogs/fragments/226-support-for-WifiWave2.yml new file mode 100644 index 00000000..9ced1a84 --- /dev/null +++ b/changelogs/fragments/226-support-for-WifiWave2.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_modify Added support for ``/interface/wifiwave2`` (https://github.com/ansible-collections/community.routeros/pull/226). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index e4252b14..6eb8336b 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1498,7 +1498,6 @@ def join_path(path): ('interface', 'wifiwave2', 'aaa'): APIData( versioned=[ ('7.11', '>=', VersionedAPIData( - single_value=True, fully_understood=True, primary_keys=('name', ), fields={ @@ -1739,7 +1738,7 @@ def join_path(path): )), ], ), - ('interface', 'wifiwave2', 'security'): APIData( + ('interface', 'wifiwave2', 'steering'): APIData( versioned=[ ('7.11', '>=', VersionedAPIData( fully_understood=True, diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index f0788cb6..13994076 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -87,6 +87,18 @@ - interface sstp-server server - interface vlan - interface vrrp + - interface wifiwave2 + - interface wifiwave2 aaa + - interface wifiwave2 access-list + - interface wifiwave2 cap + - interface wifiwave2 capsman + - interface wifiwave2 channel + - interface wifiwave2 configuration + - interface wifiwave2 datapath + - interface wifiwave2 interworking + - interface wifiwave2 provisioning + - interface wifiwave2 security + - interface wifiwave2 steering - interface wireguard - interface wireguard peers - interface wireless @@ -95,11 +107,6 @@ - interface wireless security-profiles - interface wireless sniffer - interface wireless snooper - - interface wifiwave2 - - interface wifiwave2 channel - - interface wifiwave2 configuration - - interface wifiwave2 datapath - - interface wifiwave2 security - iot modbus - ip accounting - ip accounting web-access From 732200efbaeddcf185977d9ea6967405b70fe241 Mon Sep 17 00:00:00 2001 From: Yuri Timenkov Date: Mon, 4 Dec 2023 05:26:24 +0100 Subject: [PATCH 5/8] Lowered min version --- plugins/module_utils/_api_data.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 6eb8336b..af8094b5 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1470,7 +1470,7 @@ def join_path(path): ), ('interface', 'wifiwave2'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), required_one_of=[['default-name', 'master-interface']], @@ -1497,7 +1497,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'aaa'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), fields={ @@ -1517,7 +1517,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'access-list'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, fields={ 'action': KeyInfo(can_disable=True), @@ -1540,7 +1540,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'cap'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( single_value=True, fully_understood=True, fields={ @@ -1559,7 +1559,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'capsman'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( single_value=True, fully_understood=True, fields={ @@ -1576,7 +1576,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'channel'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), fields={ @@ -1592,7 +1592,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'configuration'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), fields={ @@ -1620,7 +1620,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'datapath'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), fields={ @@ -1638,7 +1638,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'interworking'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), fields={ @@ -1678,7 +1678,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'provisioning'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('action', ), fields={ @@ -1699,7 +1699,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'security'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), fields={ @@ -1740,7 +1740,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'steering'): APIData( versioned=[ - ('7.11', '>=', VersionedAPIData( + ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), fields={ From 09331da9589bdad8096ec2a15d01cf625bdb4279 Mon Sep 17 00:00:00 2001 From: Yuri Timenkov Date: Mon, 4 Dec 2023 05:27:03 +0100 Subject: [PATCH 6/8] Added wifiwave2 interfaces --- plugins/modules/api_info.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 315c75f8..2b5a2c90 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -78,6 +78,18 @@ - interface sstp-server server - interface vlan - interface vrrp + - interface wifiwave2 + - interface wifiwave2 aaa + - interface wifiwave2 access-list + - interface wifiwave2 cap + - interface wifiwave2 capsman + - interface wifiwave2 channel + - interface wifiwave2 configuration + - interface wifiwave2 datapath + - interface wifiwave2 interworking + - interface wifiwave2 provisioning + - interface wifiwave2 security + - interface wifiwave2 steering - interface wireguard - interface wireguard peers - interface wireless From 6037553900a2b189c54fbf079d9efed27eb7286d Mon Sep 17 00:00:00 2001 From: Yuri Timenkov Date: Sat, 9 Dec 2023 07:55:47 +0100 Subject: [PATCH 7/8] Added upper version limit to WifiWave2 According to the documentation, new RouterOS version uses another package. --- plugins/module_utils/_api_data.py | 14 +++++++++++++- plugins/modules/api_modify.py | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index af8094b5..22cc9df9 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -44,7 +44,7 @@ def __init__(self, # Mark as 'fully understood' if it is for at least one version self.fully_understood = False for dummy, dummy, unversioned in self.versioned: - if unversioned.fully_understood: + if not isinstance(unversioned, str) and unversioned.fully_understood: self.fully_understood = True break self._current = None if self.needs_version else self.unversioned @@ -1470,6 +1470,7 @@ def join_path(path): ), ('interface', 'wifiwave2'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), @@ -1497,6 +1498,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'aaa'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), @@ -1517,6 +1519,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'access-list'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, fields={ @@ -1540,6 +1543,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'cap'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( single_value=True, fully_understood=True, @@ -1559,6 +1563,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'capsman'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( single_value=True, fully_understood=True, @@ -1576,6 +1581,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'channel'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), @@ -1592,6 +1598,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'configuration'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), @@ -1620,6 +1627,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'datapath'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), @@ -1638,6 +1646,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'interworking'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), @@ -1678,6 +1687,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'provisioning'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('action', ), @@ -1699,6 +1709,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'security'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), @@ -1740,6 +1751,7 @@ def join_path(path): ), ('interface', 'wifiwave2', 'steering'): APIData( versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), ('7.8', '>=', VersionedAPIData( fully_understood=True, primary_keys=('name', ), diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 13994076..5ecd8b10 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -1108,7 +1108,7 @@ def has_backend(versioned_path_info): if versioned_path_info.versioned is not None: for dummy, dummy, unversioned in versioned_path_info.versioned: - if get_backend(unversioned) is not None: + if not isinstance(unversioned, str) and get_backend(unversioned) is not None: return True return False From 103efe124aa3e387f6e4f6f053522648d9cca967 Mon Sep 17 00:00:00 2001 From: Yuri Timenkov Date: Wed, 13 Dec 2023 20:54:31 +0100 Subject: [PATCH 8/8] Addressed review comments --- changelogs/fragments/226-support-for-WifiWave2.yml | 2 +- plugins/module_utils/_api_data.py | 2 +- plugins/modules/api_modify.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/changelogs/fragments/226-support-for-WifiWave2.yml b/changelogs/fragments/226-support-for-WifiWave2.yml index 9ced1a84..fd987939 100644 --- a/changelogs/fragments/226-support-for-WifiWave2.yml +++ b/changelogs/fragments/226-support-for-WifiWave2.yml @@ -1,2 +1,2 @@ minor_changes: - - api_modify Added support for ``/interface/wifiwave2`` (https://github.com/ansible-collections/community.routeros/pull/226). + - api_modify, api_info - added support for ``interface wifiwave2`` (https://github.com/ansible-collections/community.routeros/pull/226). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 22cc9df9..3abd0f10 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -44,7 +44,7 @@ def __init__(self, # Mark as 'fully understood' if it is for at least one version self.fully_understood = False for dummy, dummy, unversioned in self.versioned: - if not isinstance(unversioned, str) and unversioned.fully_understood: + if unversioned and not isinstance(unversioned, str) and unversioned.fully_understood: self.fully_understood = True break self._current = None if self.needs_version else self.unversioned diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 5ecd8b10..2b5229b6 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -1108,7 +1108,7 @@ def has_backend(versioned_path_info): if versioned_path_info.versioned is not None: for dummy, dummy, unversioned in versioned_path_info.versioned: - if not isinstance(unversioned, str) and get_backend(unversioned) is not None: + if unversioned and not isinstance(unversioned, str) and get_backend(unversioned) is not None: return True return False