diff --git a/changelogs/fragments/137-api.yml b/changelogs/fragments/137-api.yml new file mode 100644 index 00000000..8372c297 --- /dev/null +++ b/changelogs/fragments/137-api.yml @@ -0,0 +1,5 @@ +--- +minor_changes: + - api_info, api_modify - support API paths ``interface ethernet poe``, ``interface gre6``, ``interface vrrp`` and also support all previously missing fields of entries in ``ip dhcp-server`` (https://github.com/ansible-collections/community.routeros/pull/137). +bugfixes: + - api_modify - ``address-pool`` field of entries in API path ``ip dhcp-server`` is not required anymore (https://github.com/ansible-collections/community.routeros/pull/137). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 133048cf..04f1f2be 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -199,6 +199,21 @@ def join_path(path): 'tx-flow-control': KeyInfo(default='off'), }, ), + ('interface', 'ethernet', 'poe'): APIData( + fixed_entries=True, + fully_understood=True, + primary_keys=('name', ), + fields={ + 'name': KeyInfo(), + 'poe-out': KeyInfo(default='auto-on'), + 'poe-priority': KeyInfo(default=10), + 'poe-voltage': KeyInfo(default='auto'), + 'power-cycle-interval': KeyInfo(default='none'), + 'power-cycle-ping-address': KeyInfo(can_disable=True), + 'power-cycle-ping-enabled': KeyInfo(default=False), + 'power-cycle-ping-timeout': KeyInfo(can_disable=True), + } + ), ('interface', 'gre'): APIData( fully_understood=True, primary_keys=('name', ), @@ -217,6 +232,22 @@ def join_path(path): 'remote-address': KeyInfo(required=True), }, ), + ('interface', 'gre6'): APIData( + fully_understood=True, + primary_keys=('name',), + fields={ + 'clamp-tcp-mss': KeyInfo(default=True), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'dscp': KeyInfo(default='inherit'), + 'ipsec-secret': KeyInfo(can_disable=True), + 'keepalive': KeyInfo(default='10s,10', can_disable=True), + 'local-address': KeyInfo(default='::'), + 'mtu': KeyInfo(default='auto'), + 'name': KeyInfo(), + 'remote-address': KeyInfo(required=True), + }, + ), ('interface', 'list'): APIData( primary_keys=('name', ), fully_understood=True, @@ -292,6 +323,33 @@ def join_path(path): 'vlan-id': KeyInfo(required=True), }, ), + ('interface', 'vrrp'): APIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'arp': KeyInfo(default='enabled'), + 'arp-timeout': KeyInfo(default='auto'), + 'authentication': KeyInfo(default='none'), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'group-master': KeyInfo(default=''), + 'interface': KeyInfo(required=True), + 'interval': KeyInfo(default='1s'), + 'mtu': KeyInfo(default=1500), + 'name': KeyInfo(), + 'on-backup': KeyInfo(default=''), + 'on-fail': KeyInfo(default=''), + 'on-master': KeyInfo(default=''), + 'password': KeyInfo(default=''), + 'preemption-mode': KeyInfo(default=True), + 'priority': KeyInfo(default=100), + 'remote-address': KeyInfo(), + 'sync-connection-tracking': KeyInfo(default=False), + 'v3-protocol': KeyInfo(default='ipv4'), + 'version': KeyInfo(default=3), + 'vrid': KeyInfo(default=1), + }, + ), ('interface', 'wireless', 'security-profiles'): APIData( unknown_mechanism=True, # primary_keys=('default', ), @@ -504,13 +562,27 @@ def join_path(path): fully_understood=True, primary_keys=('name', ), fields={ - 'address-pool': KeyInfo(required=True), + 'address-pool': KeyInfo(default='static-only'), + 'allow-dual-stack-queue': KeyInfo(can_disable=True, remove_value=True), + 'always-broadcast': KeyInfo(can_disable=True, remove_value=False), 'authoritative': KeyInfo(default=True), + 'bootp-lease-time': KeyInfo(default='forever'), + 'bootp-support': KeyInfo(can_disable=True, remove_value='static'), + 'client-mac-limit': KeyInfo(can_disable=True, remove_value='unlimited'), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'conflict-detection': KeyInfo(can_disable=True, remove_value=True), + 'delay-threshold': KeyInfo(can_disable=True, remove_value='none'), + 'dhcp-option-set': KeyInfo(can_disable=True, remove_value='none'), 'disabled': KeyInfo(default=False), + 'insert-queue-before': KeyInfo(can_disable=True, remove_value='first'), 'interface': KeyInfo(required=True), 'lease-script': KeyInfo(default=''), 'lease-time': KeyInfo(default='10m'), 'name': KeyInfo(), + 'parent-queue': KeyInfo(can_disable=True, remove_value='none'), + 'relay': KeyInfo(can_disable=True, remove_value='0.0.0.0'), + 'server-address': KeyInfo(can_disable=True, remove_value='0.0.0.0'), + 'use-framed-as-classless': KeyInfo(can_disable=True, remove_value=True), 'use-radius': KeyInfo(default=False), }, ), diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 958d5dc8..e354fda9 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -61,9 +61,11 @@ - interface detect-internet - interface eoip - interface ethernet + - interface ethernet poe - interface ethernet switch - interface ethernet switch port - interface gre + - interface gre6 - interface l2tp-server server - interface list - interface list member @@ -72,6 +74,7 @@ - interface pptp-server server - interface sstp-server server - interface vlan + - interface vrrp - interface wireless align - interface wireless cap - interface wireless sniffer diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index c8f0d742..45d7f652 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -66,9 +66,11 @@ - interface detect-internet - interface eoip - interface ethernet + - interface ethernet poe - interface ethernet switch - interface ethernet switch port - interface gre + - interface gre6 - interface l2tp-server server - interface list - interface list member @@ -77,6 +79,7 @@ - interface pptp-server server - interface sstp-server server - interface vlan + - interface vrrp - interface wireless align - interface wireless cap - interface wireless sniffer