From b70b4a72b3d810bd41c70e79c816833e0d112f05 Mon Sep 17 00:00:00 2001 From: hansmi Date: Mon, 28 Jul 2025 22:33:24 +0200 Subject: [PATCH] Set mangle passthrough default for RouterOS 7.19 (#382) The behaviour of the `passthrough` property in `ip/firewall/mangle` has changed in RouterOS 7.19: ``` *) firewall - always show "passthrough" when exporting mangle table; ``` Per the documentation at [1] the default is `true`. [1] https://help.mikrotik.com/docs/spaces/ROS/pages/48660587/Mangle --- changelogs/fragments/382-mangle-passthrough.yml | 2 ++ plugins/module_utils/_api_data.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/382-mangle-passthrough.yml diff --git a/changelogs/fragments/382-mangle-passthrough.yml b/changelogs/fragments/382-mangle-passthrough.yml new file mode 100644 index 0000000..2123dfa --- /dev/null +++ b/changelogs/fragments/382-mangle-passthrough.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - set ``passthrough`` default in ``ip firewall mangle`` to ``true`` for RouterOS 7.19 and newer (https://github.com/ansible-collections/community.routeros/pull/382). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index cf8aed8..ceef7e4 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -3151,6 +3151,10 @@ PATHS = { unversioned=VersionedAPIData( fully_understood=True, stratify_keys=('chain', ), + versioned_fields=[ + ([('7.19', '<')], 'passthrough', KeyInfo(can_disable=True)), + ([('7.19', '>=')], 'passthrough', KeyInfo(default=True)), + ], fields={ 'action': KeyInfo(), 'address-list': KeyInfo(can_disable=True), @@ -3202,7 +3206,6 @@ PATHS = { 'p2p': KeyInfo(can_disable=True), 'packet-mark': KeyInfo(can_disable=True), 'packet-size': KeyInfo(can_disable=True), - 'passthrough': KeyInfo(can_disable=True), 'per-connection-classifier': KeyInfo(can_disable=True), 'port': KeyInfo(can_disable=True), 'priority': KeyInfo(can_disable=True),