diff --git a/changelogs/fragments/226-support-for-WifiWave2.yml b/changelogs/fragments/226-support-for-WifiWave2.yml new file mode 100644 index 0000000..fd98793 --- /dev/null +++ b/changelogs/fragments/226-support-for-WifiWave2.yml @@ -0,0 +1,2 @@ +minor_changes: + - 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 28b0f06..3abd0f1 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -44,7 +44,7 @@ class APIData(object): # 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 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 @@ -1468,6 +1468,304 @@ PATHS = { }, ), ), + ('interface', 'wifiwave2'): APIData( + versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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', 'aaa'): APIData( + versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', VersionedAPIData( + 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.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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', 'interworking'): APIData( + versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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', 'steering'): APIData( + versioned=[ + ('7.13', '>=', 'RouterOS 7.13 uses WiFi package'), + ('7.8', '>=', 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, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 315c75f..2b5a2c9 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -78,6 +78,18 @@ options: - 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 diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 07ec5b0..2b5229b 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -87,6 +87,18 @@ options: - 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 @@ -1096,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 unversioned and not isinstance(unversioned, str) and get_backend(unversioned) is not None: return True return False