From d1db4bec9210ac12678f7f814eb4bf24809831df Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 24 Apr 2025 20:38:56 +0200 Subject: [PATCH 01/31] Adjust EE tests. (#366) --- tests/ee/roles/filter_quoting/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/ee/roles/filter_quoting/tasks/main.yml b/tests/ee/roles/filter_quoting/tasks/main.yml index e7a2d29..c80af59 100644 --- a/tests/ee/roles/filter_quoting/tasks/main.yml +++ b/tests/ee/roles/filter_quoting/tasks/main.yml @@ -22,7 +22,7 @@ assert: that: - >- - result.msg == "Unexpected end of string during escaped parameter" + "Unexpected end of string during escaped parameter" in result.msg - name: "Test quote_argument filter" assert: From e52978b6d262cfb1772b6c2d6b6d6a33de428a43 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 24 Apr 2025 22:48:23 +0200 Subject: [PATCH 02/31] Fix info on blanket license statement for changelog fragments. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2d6aec1..59d2aa4 100644 --- a/README.md +++ b/README.md @@ -208,4 +208,4 @@ See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/commu Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.routeros/blob/main/LICENSES/BSD-2-Clause.txt). -All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `.reuse/dep5`. This conforms to the [REUSE specification](https://reuse.software/spec/). +All files have a machine readable `SDPX-License-Identifier:` comment denoting its respective license(s) or an equivalent entry in an accompanying `.license` file. Only changelog fragments (which will not be part of a release) are covered by a blanket statement in `REUSE.toml`. This conforms to the [REUSE specification](https://reuse.software/spec/). From 3af45c33f1b1e008cf59e9adbbb73068b39170be Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 26 Apr 2025 09:07:00 +0200 Subject: [PATCH 03/31] Add yamllint to antsibull-nox and add config files. --- .gitignore | 1 + .yamllint | 53 +++++++++++++++++++++++++++++++++++++++++++++ .yamllint-docs | 54 ++++++++++++++++++++++++++++++++++++++++++++++ .yamllint-examples | 54 ++++++++++++++++++++++++++++++++++++++++++++++ antsibull-nox.toml | 10 ++++----- 5 files changed, 166 insertions(+), 6 deletions(-) create mode 100644 .yamllint create mode 100644 .yamllint-docs create mode 100644 .yamllint-examples diff --git a/.gitignore b/.gitignore index 8e398ff..728531b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ /tests/output/ /changelogs/.plugin-cache.yaml +/tests/integration/inventory # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/.yamllint b/.yamllint new file mode 100644 index 0000000..a6707e2 --- /dev/null +++ b/.yamllint @@ -0,0 +1,53 @@ +--- +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later +# SPDX-FileCopyrightText: 2025 Felix Fontein + +extends: default + +ignore: | + /changelogs/ + +rules: + line-length: + max: 300 + level: error + document-start: + present: true + document-end: false + truthy: + level: error + allowed-values: + - 'true' + - 'false' + indentation: + spaces: 2 + indent-sequences: true + key-duplicates: enable + trailing-spaces: enable + new-line-at-end-of-file: disable + hyphens: + max-spaces-after: 1 + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true + comments: + min-spaces-from-content: 1 + comments-indentation: false diff --git a/.yamllint-docs b/.yamllint-docs new file mode 100644 index 0000000..de8947d --- /dev/null +++ b/.yamllint-docs @@ -0,0 +1,54 @@ +--- +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later +# SPDX-FileCopyrightText: 2025 Felix Fontein + +extends: default + +ignore: | + /changelogs/ + +rules: + line-length: + max: 160 + level: error + document-start: + present: false + document-end: + present: false + truthy: + level: error + allowed-values: + - 'true' + - 'false' + indentation: + spaces: 2 + indent-sequences: true + key-duplicates: enable + trailing-spaces: enable + new-line-at-end-of-file: disable + hyphens: + max-spaces-after: 1 + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true + comments: + min-spaces-from-content: 1 + comments-indentation: false diff --git a/.yamllint-examples b/.yamllint-examples new file mode 100644 index 0000000..062ac5a --- /dev/null +++ b/.yamllint-examples @@ -0,0 +1,54 @@ +--- +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later +# SPDX-FileCopyrightText: 2025 Felix Fontein + +extends: default + +ignore: | + /changelogs/ + +rules: + line-length: + max: 160 + level: error + document-start: + present: true + document-end: + present: false + truthy: + level: error + allowed-values: + - 'true' + - 'false' + indentation: + spaces: 2 + indent-sequences: true + key-duplicates: enable + trailing-spaces: enable + new-line-at-end-of-file: disable + hyphens: + max-spaces-after: 1 + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true + comments: + min-spaces-from-content: 1 + comments-indentation: false diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 541f4e7..d95dfed 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -10,16 +10,14 @@ [sessions] [sessions.lint] -# https://ansible.readthedocs.io/projects/antsibull-nox/config-file/#basic-linting-sessions - -# disable reformatting for now run_isort = false run_black = false - -# disable most linters run_flake8 = false run_pylint = false -run_yamllint = false +run_yamllint = true +yamllint_config = ".yamllint" +yamllint_config_plugins = ".yamllint-docs" +yamllint_config_plugins_examples = ".yamllint-examples" run_mypy = false [sessions.docs_check] From 08152376de116e7d933d19ee25318f7a2eb222ae Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 26 Apr 2025 09:21:32 +0200 Subject: [PATCH 04/31] Fix linting errors. --- .github/workflows/docs-pr.yml | 2 +- .github/workflows/docs-push.yml | 2 +- .github/workflows/ee.yml | 2 +- galaxy.yml | 2 +- plugins/filter/join.yml | 1 + plugins/filter/list_to_dict.yml | 1 + plugins/filter/quote_argument.yml | 4 +++- plugins/filter/quote_argument_value.yml | 4 +++- plugins/filter/split.yml | 4 +++- plugins/modules/api.py | 1 + plugins/modules/api_facts.py | 1 + plugins/modules/api_find_and_modify.py | 1 + plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + plugins/modules/command.py | 1 + plugins/modules/facts.py | 1 + tests/integration/requirements.yml | 2 +- 17 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/docs-pr.yml b/.github/workflows/docs-pr.yml index 7d35e5c..63135a1 100644 --- a/.github/workflows/docs-pr.yml +++ b/.github/workflows/docs-pr.yml @@ -7,7 +7,7 @@ name: Collection Docs concurrency: group: docs-pr-${{ github.head_ref }} cancel-in-progress: true -on: +'on': pull_request_target: types: [opened, synchronize, reopened, closed] diff --git a/.github/workflows/docs-push.yml b/.github/workflows/docs-push.yml index 80f62f5..3d2c2b1 100644 --- a/.github/workflows/docs-push.yml +++ b/.github/workflows/docs-push.yml @@ -7,7 +7,7 @@ name: Collection Docs concurrency: group: docs-push-${{ github.sha }} cancel-in-progress: true -on: +'on': push: branches: - main diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml index b04d197..5b45972 100644 --- a/.github/workflows/ee.yml +++ b/.github/workflows/ee.yml @@ -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later name: execution environment -on: +'on': # Run CI against all pushes (direct commits, also merged PRs), Pull Requests push: branches: diff --git a/galaxy.yml b/galaxy.yml index 2bd801f..b943229 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -16,7 +16,7 @@ authors: description: Modules and plugins for MikroTik RouterOS license: - GPL-3.0-or-later -#license_file: COPYING +# license_file: COPYING tags: - network - mikrotik diff --git a/plugins/filter/join.yml b/plugins/filter/join.yml index 9ff8a50..f25d739 100644 --- a/plugins/filter/join.yml +++ b/plugins/filter/join.yml @@ -20,6 +20,7 @@ DOCUMENTATION: - Felix Fontein (@felixfontein) EXAMPLES: | + --- - name: Join arguments for a RouterOS CLI command ansible.builtin.set_fact: arguments: "{{ ['foo=bar', 'comment=foo is bar'] | community.routeros.join }}" diff --git a/plugins/filter/list_to_dict.yml b/plugins/filter/list_to_dict.yml index 6e7992d..7b7c5b1 100644 --- a/plugins/filter/list_to_dict.yml +++ b/plugins/filter/list_to_dict.yml @@ -30,6 +30,7 @@ DOCUMENTATION: - Felix Fontein (@felixfontein) EXAMPLES: | + --- - name: Convert a list to a dictionary ansible.builtin.set_fact: dictionary: "{{ ['foo=bar', 'comment=foo is bar'] | community.routeros.list_to_dict }}" diff --git a/plugins/filter/quote_argument.yml b/plugins/filter/quote_argument.yml index 26a1f04..477a15e 100644 --- a/plugins/filter/quote_argument.yml +++ b/plugins/filter/quote_argument.yml @@ -19,9 +19,11 @@ DOCUMENTATION: - Felix Fontein (@felixfontein) EXAMPLES: | + --- - name: Quote a RouterOS CLI command argument ansible.builtin.set_fact: - quoted: "{{ 'comment=this is a "comment"' | community.routeros.quote_argument }}" + quoted: >- + {{ 'comment=this is a "comment"' | community.routeros.quote_argument }} # Should result in 'comment="this is a \"comment\""' RETURN: diff --git a/plugins/filter/quote_argument_value.yml b/plugins/filter/quote_argument_value.yml index 839895b..b4da246 100644 --- a/plugins/filter/quote_argument_value.yml +++ b/plugins/filter/quote_argument_value.yml @@ -19,9 +19,11 @@ DOCUMENTATION: - Felix Fontein (@felixfontein) EXAMPLES: | + --- - name: Quote a RouterOS CLI command argument's value ansible.builtin.set_fact: - quoted: "{{ 'this is a "comment"' | community.routeros.quote_argument_value }}" + quoted: >- + {{ 'this is a "comment"' | community.routeros.quote_argument_value }} # Should result in '"this is a \"comment\""' RETURN: diff --git a/plugins/filter/split.yml b/plugins/filter/split.yml index 5fc4b30..cb4ba88 100644 --- a/plugins/filter/split.yml +++ b/plugins/filter/split.yml @@ -19,9 +19,11 @@ DOCUMENTATION: - Felix Fontein (@felixfontein) EXAMPLES: | + --- - name: Split command into list of arguments ansible.builtin.set_fact: - argument_list: "{{ 'foo=bar comment="foo is bar" baz' | community.routeros.split }}" + argument_list: >- + {{ 'foo=bar comment="foo is bar" baz' | community.routeros.split }} # Should result in ['foo=bar', 'comment=foo is bar', 'baz'] RETURN: diff --git a/plugins/modules/api.py b/plugins/modules/api.py index 4e42912..d3ec089 100644 --- a/plugins/modules/api.py +++ b/plugins/modules/api.py @@ -164,6 +164,7 @@ seealso: """ EXAMPLES = r""" +--- - name: Get example - ip address print community.routeros.api: hostname: "{{ hostname }}" diff --git a/plugins/modules/api_facts.py b/plugins/modules/api_facts.py index b6d1261..41c9a4e 100644 --- a/plugins/modules/api_facts.py +++ b/plugins/modules/api_facts.py @@ -55,6 +55,7 @@ seealso: """ EXAMPLES = r""" +--- - name: Collect all facts from the device community.routeros.api_facts: hostname: 192.168.88.1 diff --git a/plugins/modules/api_find_and_modify.py b/plugins/modules/api_find_and_modify.py index 817451c..2d465e8 100644 --- a/plugins/modules/api_find_and_modify.py +++ b/plugins/modules/api_find_and_modify.py @@ -83,6 +83,7 @@ seealso: """ EXAMPLES = r""" +--- - name: Rename bridge from 'bridge' to 'my-bridge' community.routeros.api_find_and_modify: hostname: "{{ hostname }}" diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index b94e987..bd36955 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -324,6 +324,7 @@ seealso: """ EXAMPLES = r""" +--- - name: Get IP addresses community.routeros.api_info: hostname: "{{ hostname }}" diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 1fb4dae..2c1b012 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -360,6 +360,7 @@ seealso: """ EXAMPLES = r""" +--- - name: Setup DHCP server networks # Ensures that we have exactly two DHCP server networks (in the specified order) community.routeros.api_modify: diff --git a/plugins/modules/command.py b/plugins/modules/command.py index 90f9733..50abe49 100644 --- a/plugins/modules/command.py +++ b/plugins/modules/command.py @@ -77,6 +77,7 @@ seealso: """ EXAMPLES = r""" +--- - name: Run command on remote devices community.routeros.command: commands: /system routerboard print diff --git a/plugins/modules/facts.py b/plugins/modules/facts.py index 7b169b7..e75d609 100644 --- a/plugins/modules/facts.py +++ b/plugins/modules/facts.py @@ -42,6 +42,7 @@ seealso: """ EXAMPLES = r""" +--- - name: Collect all facts from the device community.routeros.facts: gather_subset: all diff --git a/tests/integration/requirements.yml b/tests/integration/requirements.yml index 6a22736..559c301 100644 --- a/tests/integration/requirements.yml +++ b/tests/integration/requirements.yml @@ -4,4 +4,4 @@ # SPDX-License-Identifier: GPL-3.0-or-later collections: -- ansible.netcommon + - ansible.netcommon From 5b81c157fe8b83ced876ca61545b51ab996c2064 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 26 Apr 2025 12:22:44 +0200 Subject: [PATCH 05/31] Add reformat commit to .git-blame-ignore-revs. --- .git-blame-ignore-revs | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .git-blame-ignore-revs diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 0000000..9623a78 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,6 @@ +# Copyright (c) Ansible Project +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later + +# Reformat YAML: https://github.com/ansible-collections/community.routeros/pull/369 +08152376de116e7d933d19ee25318f7a2eb222ae From f5b952751e4fbaaf84997ec2a809fac3ca60d8e9 Mon Sep 17 00:00:00 2001 From: Michael Jenny Date: Thu, 29 May 2025 14:58:38 +0200 Subject: [PATCH 06/31] Update _api_data.py (#371) * Update _api_data.py Add /interface/bridge property "port-cost-mode" which is supported since RouterOS 7.13. See changelog for details: https://mikrotik.com/download/changelogs * Create 371-add-bridge-port-cost-mode.yml * Update changelogs/fragments/371-add-bridge-port-cost-mode.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- changelogs/fragments/371-add-bridge-port-cost-mode.yml | 3 +++ plugins/module_utils/_api_data.py | 1 + 2 files changed, 4 insertions(+) create mode 100644 changelogs/fragments/371-add-bridge-port-cost-mode.yml diff --git a/changelogs/fragments/371-add-bridge-port-cost-mode.yml b/changelogs/fragments/371-add-bridge-port-cost-mode.yml new file mode 100644 index 0000000..5ec9177 --- /dev/null +++ b/changelogs/fragments/371-add-bridge-port-cost-mode.yml @@ -0,0 +1,3 @@ +--- +minor_changes: + - api_info, api_modify - add ``port-cost-mode`` to ``interface bridge`` which is supported since RouterOS 7.13 (https://github.com/ansible-collections/community.routeros/pull/371). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 222155d..e95d599 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -281,6 +281,7 @@ PATHS = { versioned_fields=[ ([('7.0', '<')], 'ingress-filtering', KeyInfo(default=False)), ([('7.0', '>=')], 'ingress-filtering', KeyInfo(default=True)), + ([('7.13', '>=')], 'port-cost-mode', KeyInfo(default='long')), ([('7.16', '>=')], 'forward-reserved-addresses', KeyInfo(default=False)), ([('7.16', '>=')], 'max-learned-entries', KeyInfo(default='auto')), ], From bfd6b0bb13423f284dab60eeb43b43ec8048e5c6 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 29 May 2025 14:59:45 +0200 Subject: [PATCH 07/31] Prepare 3.7.0. --- changelogs/fragments/3.7.0.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3.7.0.yml diff --git a/changelogs/fragments/3.7.0.yml b/changelogs/fragments/3.7.0.yml new file mode 100644 index 0000000..512efc9 --- /dev/null +++ b/changelogs/fragments/3.7.0.yml @@ -0,0 +1 @@ +release_summary: Feature release. diff --git a/galaxy.yml b/galaxy.yml index b943229..b9f4453 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.6.0 +version: 3.7.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From ab1026504c08c5bb1844cbcde7505b40b79261b2 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 31 May 2025 16:50:52 +0200 Subject: [PATCH 08/31] Allow to ignore dynamic and builtin entries. (#373) --- ...73-api_find_and_modify-dynamic-builtin.yml | 2 + plugins/modules/api_find_and_modify.py | 48 +++++++++++-- .../modules/test_api_find_and_modify.py | 72 +++++++++++++++++++ 3 files changed, 118 insertions(+), 4 deletions(-) create mode 100644 changelogs/fragments/373-api_find_and_modify-dynamic-builtin.yml diff --git a/changelogs/fragments/373-api_find_and_modify-dynamic-builtin.yml b/changelogs/fragments/373-api_find_and_modify-dynamic-builtin.yml new file mode 100644 index 0000000..20e7a6b --- /dev/null +++ b/changelogs/fragments/373-api_find_and_modify-dynamic-builtin.yml @@ -0,0 +1,2 @@ +minor_changes: + - "api_find_and_modify - allow to control whether ``dynamic`` and/or ``builtin`` entries are ignored with the new ``ignore_dynamic`` and ``ignore_builtin`` options (https://github.com/ansible-collections/community.routeros/issues/372, https://github.com/ansible-collections/community.routeros/pull/373)." diff --git a/plugins/modules/api_find_and_modify.py b/plugins/modules/api_find_and_modify.py index 2d465e8..acdd125 100644 --- a/plugins/modules/api_find_and_modify.py +++ b/plugins/modules/api_find_and_modify.py @@ -75,6 +75,22 @@ options: - Whether to allow that no match is found. - If not specified, this value is induced from whether O(require_matches_min) is 0 or larger. type: bool + ignore_dynamic: + description: + - Whether to ignore dynamic entries. + - By default, they are considered. If set to V(true), they are not considered. + - It is generally recommended to set this to V(true) unless when you really need to modify dynamic entries. + type: bool + default: false + version_added: 3.7.0 + ignore_builtin: + description: + - Whether to ignore builtin entries. + - By default, they are considered. If set to V(true), they are not considered. + - It is generally recommended to set this to V(true) unless when you really need to modify builtin entries. + type: bool + default: false + version_added: 3.7.0 seealso: - module: community.routeros.api - module: community.routeros.api_facts @@ -94,6 +110,10 @@ EXAMPLES = r""" name: bridge values: name: my-bridge + # Always ignore dynamic and builtin entries + # (not relevant for this path, but generally recommended) + ignore_dynamic: true + ignore_builtin: true - name: Change IP address to 192.168.1.1 for interface bridge - assuming there is only one community.routeros.api_find_and_modify: @@ -105,10 +125,14 @@ EXAMPLES = r""" interface: bridge values: address: "192.168.1.1/24" - # If there are zero entries, or more than one: fail! We expected that - # exactly one is configured. + # If there are zero entries, or more than one: fail! We expected that + # exactly one is configured. require_matches_min: 1 require_matches_max: 1 + # Always ignore dynamic and builtin entries + # (not relevant for this path, but generally recommended) + ignore_dynamic: true + ignore_builtin: true """ RETURN = r""" @@ -185,6 +209,17 @@ def compose_api_path(api, path): return api_path +def filter_entries(entries, ignore_dynamic=False, ignore_builtin=False): + result = [] + for entry in entries: + if ignore_dynamic and entry.get('dynamic', False): + continue + if ignore_builtin and entry.get('builtin', False): + continue + result.append(entry) + return result + + DISABLED_MEANS_EMPTY_STRING = ('comment', ) @@ -196,6 +231,8 @@ def main(): require_matches_min=dict(type='int', default=0), require_matches_max=dict(type='int'), allow_no_matches=dict(type='bool'), + ignore_dynamic=dict(type='bool', default=False), + ignore_builtin=dict(type='bool', default=False), ) module_args.update(api_argument_spec()) @@ -223,6 +260,9 @@ def main(): if key in values: module.fail_json(msg='`values` must not contain both "{key}" and "!{key}"!'.format(key=key)) + ignore_dynamic = module.params['ignore_dynamic'] + ignore_builtin = module.params['ignore_builtin'] + check_has_library(module) api = create_api(module) @@ -230,7 +270,7 @@ def main(): api_path = compose_api_path(api, path) - old_data = list(api_path) + old_data = filter_entries(list(api_path), ignore_dynamic=ignore_dynamic, ignore_builtin=ignore_builtin) new_data = [entry.copy() for entry in old_data] # Find matching entries @@ -299,7 +339,7 @@ def main(): error=to_native(e), ) ) - new_data = list(api_path) + new_data = filter_entries(list(api_path), ignore_dynamic=ignore_dynamic, ignore_builtin=ignore_builtin) # Produce return value more = {} diff --git a/tests/unit/plugins/modules/test_api_find_and_modify.py b/tests/unit/plugins/modules/test_api_find_and_modify.py index fe5e180..e700f9d 100644 --- a/tests/unit/plugins/modules/test_api_find_and_modify.py +++ b/tests/unit/plugins/modules/test_api_find_and_modify.py @@ -94,6 +94,52 @@ START_IP_FIREWALL_FILTER = [ START_IP_FIREWALL_FILTER_OLD_DATA = massage_expected_result_data(START_IP_FIREWALL_FILTER, ('ip', 'firewall', 'filter'), keep_all=True) +START_IP_SERVICE = [ + # I removed all entryes not for 'api' and 'api-ssl' + { + "certificate": None, + "tls-version": None, + ".id": "*7", + "address": "", + "disabled": True, + "dynamic": False, + "invalid": True, + "name": "api", + "port": 8728, + "proto": "tcp", + "vrf": "main" + }, + { + ".id": "*9", + "address": "192.168.1.0/24", + "certificate": "mycert", + "dynamic": False, + "invalid": False, + "name": "api-ssl", + "port": 8729, + "proto": "tcp", + "tls-version": "only-1.2", + "vrf": "main" + }, + { + "address": None, + "certificate": None, + "max-sessions": None, + "tls-version": None, + ".id": "*13", + "connection": True, + "dynamic": True, + "invalid": False, + "local": "192.168.1.1", + "name": "api-ssl", + "port": 8729, + "proto": "tcp", + "remote": "192.168.1.2:12346" + } +] + +START_IP_SERVICE_OLD_DATA = massage_expected_result_data(START_IP_SERVICE, ('ip', 'service'), keep_all=True) + class TestRouterosApiFindAndModifyModule(ModuleTestCase): @@ -685,3 +731,29 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): ]) self.assertEqual(result['match_count'], 3) self.assertEqual(result['modify_count'], 2) + + @patch('ansible_collections.community.routeros.plugins.modules.api_find_and_modify.compose_api_path', + new=create_fake_path(('ip', 'service'), START_IP_SERVICE)) + def test_change_ignore_dynamic(self): + with self.assertRaises(AnsibleExitJson) as exc: + args = self.config_module_args.copy() + args.update({ + 'path': 'ip service', + 'find': { + 'name': 'api-ssl', + }, + 'values': { + 'address': '192.168.1.0/24', + }, + 'ignore_dynamic': True, + '_ansible_diff': True, + }) + with set_module_args(args): + self.module.main() + + result = exc.exception.args[0] + self.assertEqual(result['changed'], False) + self.assertEqual(result['old_data'], [entry for entry in START_IP_SERVICE_OLD_DATA if entry["dynamic"] is False]) + self.assertEqual(result['new_data'], [entry for entry in START_IP_SERVICE_OLD_DATA if entry["dynamic"] is False]) + self.assertEqual(result['match_count'], 1) + self.assertEqual(result['modify_count'], 0) From 221a697af9dc92238922d105384e69ce36f9906f Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 31 May 2025 16:57:51 +0200 Subject: [PATCH 09/31] Release 3.7.0. --- CHANGELOG.md | 273 ++++++++++-------- CHANGELOG.rst | 14 + changelogs/changelog.yaml | 15 + changelogs/fragments/3.7.0.yml | 1 - .../371-add-bridge-port-cost-mode.yml | 3 - ...73-api_find_and_modify-dynamic-builtin.yml | 2 - 6 files changed, 174 insertions(+), 134 deletions(-) delete mode 100644 changelogs/fragments/3.7.0.yml delete mode 100644 changelogs/fragments/371-add-bridge-port-cost-mode.yml delete mode 100644 changelogs/fragments/373-api_find_and_modify-dynamic-builtin.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 136ba21..294687e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,150 +2,153 @@ **Topics** -- v3\.6\.0 +- v3\.7\.0 - Release Summary - Minor Changes -- v3\.5\.0 +- v3\.6\.0 - Release Summary - Minor Changes -- v3\.4\.0 +- v3\.5\.0 - Release Summary - Minor Changes - - Bugfixes -- v3\.3\.0 +- v3\.4\.0 - Release Summary - Minor Changes -- v3\.2\.0 + - Bugfixes +- v3\.3\.0 - Release Summary - Minor Changes -- v3\.1\.0 +- v3\.2\.0 - Release Summary - Minor Changes +- v3\.1\.0 + - Release Summary + - Minor Changes - Bugfixes - v3\.0\.0 - - Release Summary + - Release Summary - Breaking Changes / Porting Guide - Removed Features \(previously deprecated\) - v2\.20\.0 - - Release Summary - - Minor Changes -- v2\.19\.0 - Release Summary - Minor Changes -- v2\.18\.0 +- v2\.19\.0 - Release Summary - Minor Changes +- v2\.18\.0 + - Release Summary + - Minor Changes - Deprecated Features - Bugfixes - v2\.17\.0 - - Release Summary - - Minor Changes -- v2\.16\.0 - Release Summary - Minor Changes -- v2\.15\.0 +- v2\.16\.0 - Release Summary - Minor Changes -- v2\.14\.0 +- v2\.15\.0 - Release Summary - Minor Changes -- v2\.13\.0 +- v2\.14\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.12\.0 +- v2\.13\.0 - Release Summary - Minor Changes -- v2\.11\.0 + - Bugfixes +- v2\.12\.0 - Release Summary - Minor Changes -- v2\.10\.0 +- v2\.11\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.9\.0 +- v2\.10\.0 - Release Summary - Minor Changes + - Bugfixes +- v2\.9\.0 + - Release Summary + - Minor Changes - Bugfixes - v2\.8\.3 - - Release Summary + - Release Summary - Known Issues - v2\.8\.2 - - Release Summary + - Release Summary - Bugfixes - v2\.8\.1 - - Release Summary + - Release Summary - Bugfixes - v2\.8\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v2\.7\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.6\.0 + - Bugfixes +- v2\.7\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.5\.0 + - Bugfixes +- v2\.6\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.4\.0 + - Bugfixes +- v2\.5\.0 - Release Summary - Minor Changes + - Bugfixes +- v2\.4\.0 + - Release Summary + - Minor Changes - Bugfixes - Known Issues - v2\.3\.1 - - Release Summary + - Release Summary - Known Issues - v2\.3\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - Bugfixes - v2\.2\.1 - - Release Summary + - Release Summary - Bugfixes - v2\.2\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - Bugfixes - New Modules - v2\.1\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - Bugfixes - New Modules - v2\.0\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - Breaking Changes / Porting Guide - Bugfixes - New Plugins - Filter - v1\.2\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v1\.1\.0 - Release Summary - Minor Changes -- v1\.0\.1 + - Bugfixes +- v1\.1\.0 - Release Summary + - Minor Changes +- v1\.0\.1 + - Release Summary - Bugfixes - v1\.0\.0 - - Release Summary + - Release Summary - Bugfixes - v0\.1\.1 - - Release Summary + - Release Summary - Bugfixes - v0\.1\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - -## v3\.6\.0 + +## v3\.7\.0 ### Release Summary @@ -155,12 +158,11 @@ Feature release\. ### Minor Changes -* api\_info\, api\_modify \- add mdns\-repeat\-ifaces to ip dns for RouterOS 7\.16 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/358](https\://github\.com/ansible\-collections/community\.routeros/pull/358)\)\. -* api\_info\, api\_modify \- field name change in routing bgp connection path implemented by RouterOS 7\.19 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/360](https\://github\.com/ansible\-collections/community\.routeros/pull/360)\)\. -* api\_info\, api\_modify \- rename is\-responder property in interface wireguard peers to responder for RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/364](https\://github\.com/ansible\-collections/community\.routeros/pull/364)\)\. +* api\_find\_and\_modify \- allow to control whether dynamic and/or builtin entries are ignored with the new ignore\_dynamic and ignore\_builtin options \([https\://github\.com/ansible\-collections/community\.routeros/issues/372](https\://github\.com/ansible\-collections/community\.routeros/issues/372)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/373](https\://github\.com/ansible\-collections/community\.routeros/pull/373)\)\. +* api\_info\, api\_modify \- add port\-cost\-mode to interface bridge which is supported since RouterOS 7\.13 \([https\://github\.com/ansible\-collections/community\.routeros/pull/371](https\://github\.com/ansible\-collections/community\.routeros/pull/371)\)\. - -## v3\.5\.0 + +## v3\.6\.0 ### Release Summary @@ -170,17 +172,32 @@ Feature release\. ### Minor Changes +* api\_info\, api\_modify \- add mdns\-repeat\-ifaces to ip dns for RouterOS 7\.16 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/358](https\://github\.com/ansible\-collections/community\.routeros/pull/358)\)\. +* api\_info\, api\_modify \- field name change in routing bgp connection path implemented by RouterOS 7\.19 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/360](https\://github\.com/ansible\-collections/community\.routeros/pull/360)\)\. +* api\_info\, api\_modify \- rename is\-responder property in interface wireguard peers to responder for RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/364](https\://github\.com/ansible\-collections/community\.routeros/pull/364)\)\. + + +## v3\.5\.0 + + +### Release Summary + +Feature release\. + + +### Minor Changes + * api\_info\, api\_modify \- change default for /ip/cloud/ddns\-enabled for RouterOS 7\.17 and newer from yes to auto \([https\://github\.com/ansible\-collections/community\.routeros/pull/350](https\://github\.com/ansible\-collections/community\.routeros/pull/350)\)\. ## v3\.4\.0 - + ### Release Summary Feature and bugfix release\. - + ### Minor Changes * api\_info\, api\_modify \- add support for the ip dns forwarders path implemented by RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/343](https\://github\.com/ansible\-collections/community\.routeros/pull/343)\)\. @@ -193,12 +210,12 @@ Feature and bugfix release\. ## v3\.3\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add missing attribute require\-message\-auth for the radius path which exists since RouterOS version 7\.15 \([https\://github\.com/ansible\-collections/community\.routeros/issues/338](https\://github\.com/ansible\-collections/community\.routeros/issues/338)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/339](https\://github\.com/ansible\-collections/community\.routeros/pull/339)\)\. @@ -209,12 +226,12 @@ Feature release\. ## v3\.2\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add support for the routing filter community\-list path implemented by RouterOS 7 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/331](https\://github\.com/ansible\-collections/community\.routeros/pull/331)\)\. @@ -222,12 +239,12 @@ Feature release\. ## v3\.1\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add missing fields comment\, next\-pool to ip pool path \([https\://github\.com/ansible\-collections/community\.routeros/pull/327](https\://github\.com/ansible\-collections/community\.routeros/pull/327)\)\. @@ -240,7 +257,7 @@ Bugfix and feature release\. ## v3\.0\.0 - + ### Release Summary Major release that drops support for End of Life Python versions and fixes check mode for community\.routeros\.command\. @@ -258,12 +275,12 @@ Major release that drops support for End of Life Python versions and fixes check ## v2\.20\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add new parameters from the RouterOS 7\.16 release \([https\://github\.com/ansible\-collections/community\.routeros/pull/323](https\://github\.com/ansible\-collections/community\.routeros/pull/323)\)\. @@ -274,12 +291,12 @@ Feature release\. ## v2\.19\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add support for the ip dns adlist path implemented by RouterOS 7\.15 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/310](https\://github\.com/ansible\-collections/community\.routeros/pull/310)\)\. @@ -291,12 +308,12 @@ Feature release\. ## v2\.18\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info \- allow to restrict the output by limiting fields to specific values with the new restrict option \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\. @@ -320,12 +337,12 @@ Feature release\. ## v2\.17\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add system health settings path \([https\://github\.com/ansible\-collections/community\.routeros/pull/294](https\://github\.com/ansible\-collections/community\.routeros/pull/294)\)\. @@ -335,12 +352,12 @@ Feature release\. ## v2\.16\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add missing path /ppp secret \([https\://github\.com/ansible\-collections/community\.routeros/pull/286](https\://github\.com/ansible\-collections/community\.routeros/pull/286)\)\. @@ -349,12 +366,12 @@ Feature release\. ## v2\.15\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- Add RouterOS 7\.x support to /mpls ldp path \([https\://github\.com/ansible\-collections/community\.routeros/pull/271](https\://github\.com/ansible\-collections/community\.routeros/pull/271)\)\. @@ -371,12 +388,12 @@ Feature release\. ## v2\.14\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add read\-only fields installed\-version\, latest\-version and status in system package update \([https\://github\.com/ansible\-collections/community\.routeros/pull/263](https\://github\.com/ansible\-collections/community\.routeros/pull/263)\)\. @@ -386,12 +403,12 @@ Feature release\. ## v2\.13\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_info\, api\_modify \- make path user group modifiable and add comment attribute \([https\://github\.com/ansible\-collections/community\.routeros/issues/256](https\://github\.com/ansible\-collections/community\.routeros/issues/256)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/257](https\://github\.com/ansible\-collections/community\.routeros/pull/257)\)\. @@ -405,12 +422,12 @@ Bugfix and feature release\. ## v2\.12\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add interface ovpn\-client path \([https\://github\.com/ansible\-collections/community\.routeros/issues/242](https\://github\.com/ansible\-collections/community\.routeros/issues/242)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/244](https\://github\.com/ansible\-collections/community\.routeros/pull/244)\)\. @@ -424,12 +441,12 @@ Feature release\. ## v2\.11\.0 - + ### Release Summary Feature and bugfix release\. - + ### Minor Changes * api\_info\, api\_modify \- add missing DoH parameters doh\-max\-concurrent\-queries\, doh\-max\-server\-connections\, and doh\-timeout to the ip dns path \([https\://github\.com/ansible\-collections/community\.routeros/issues/230](https\://github\.com/ansible\-collections/community\.routeros/issues/230)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/235](https\://github\.com/ansible\-collections/community\.routeros/pull/235)\) @@ -444,12 +461,12 @@ Feature and bugfix release\. ## v2\.10\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_info \- add new include\_read\_only option to select behavior for read\-only values\. By default these are not returned \([https\://github\.com/ansible\-collections/community\.routeros/pull/213](https\://github\.com/ansible\-collections/community\.routeros/pull/213)\)\. @@ -481,12 +498,12 @@ Bugfix and feature release\. ## v2\.9\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add path caps\-man channel and enable path caps\-man manager interface \([https\://github\.com/ansible\-collections/community\.routeros/issues/193](https\://github\.com/ansible\-collections/community\.routeros/issues/193)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/194](https\://github\.com/ansible\-collections/community\.routeros/pull/194)\)\. @@ -500,7 +517,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -521,7 +538,7 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - + ### Release Summary Bugfix release\. @@ -534,7 +551,7 @@ Bugfix release\. ## v2\.8\.1 - + ### Release Summary Bugfix release\. @@ -547,12 +564,12 @@ Bugfix release\. ## v2\.8\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_modify \- adapt data for API paths ip dhcp\-server network \([https\://github\.com/ansible\-collections/community\.routeros/pull/156](https\://github\.com/ansible\-collections/community\.routeros/pull/156)\)\. @@ -572,12 +589,12 @@ Bugfix and feature release\. ## v2\.7\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_modify\, api\_info \- support API paths ip arp\, ip firewall raw\, ipv6 firewall raw \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\. @@ -590,12 +607,12 @@ Bugfix and feature release\. ## v2\.6\.0 - + ### Release Summary Regular bugfix and feature release\. - + ### Minor Changes * api\_modify\, api\_info \- add field regexp to ip dns static \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\. @@ -610,12 +627,12 @@ Regular bugfix and feature release\. ## v2\.5\.0 - + ### Release Summary Feature and bugfix release\. - + ### 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](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\. @@ -628,12 +645,12 @@ Feature and bugfix release\. ## v2\.4\.0 - + ### Release Summary Feature release improving the api\* modules\. - + ### Minor Changes * api\* modules \- Add new option force\_no\_cert to connect with ADH ciphers \([https\://github\.com/ansible\-collections/community\.routeros/pull/124](https\://github\.com/ansible\-collections/community\.routeros/pull/124)\)\. @@ -672,7 +689,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -685,12 +702,12 @@ Maintenance release with improved documentation\. ## v2\.3\.0 - + ### Release Summary Feature and bugfix release\. - + ### Minor Changes * The collection repository conforms to the [REUSE specification](https\://reuse\.software/spec/) except for the changelog fragments \([https\://github\.com/ansible\-collections/community\.routeros/pull/108](https\://github\.com/ansible\-collections/community\.routeros/pull/108)\)\. @@ -705,7 +722,7 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. @@ -719,12 +736,12 @@ Bugfix release\. ## v2\.2\.0 - + ### Release Summary New feature release\. - + ### Minor Changes * All software licenses are now in the LICENSES/ directory of the collection root\. Moreover\, SPDX\-License\-Identifier\: is used to declare the applicable license for every file that is not automatically generated \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\. @@ -743,12 +760,12 @@ New feature release\. ## v2\.1\.0 - + ### Release Summary Feature and bugfix release with new modules\. - + ### Minor Changes * Added a community\.routeros\.api module defaults group\. Use with group/community\.routeros\.api to provide options for all API\-based modules \([https\://github\.com/ansible\-collections/community\.routeros/pull/89](https\://github\.com/ansible\-collections/community\.routeros/pull/89)\)\. @@ -772,12 +789,12 @@ Feature and bugfix release with new modules\. ## v2\.0\.0 - + ### Release Summary A new major release with breaking changes in the behavior of community\.routeros\.api and community\.routeros\.command\. - + ### Minor Changes * api \- make validation of WHERE for query more strict \([https\://github\.com/ansible\-collections/community\.routeros/pull/53](https\://github\.com/ansible\-collections/community\.routeros/pull/53)\)\. @@ -813,12 +830,12 @@ A new major release with breaking changes in the behavior of community\.ro ## v1\.2\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * Avoid internal ansible\-core module\_utils in favor of equivalent public API available since at least Ansible 2\.9 \([https\://github\.com/ansible\-collections/community\.routeros/pull/38](https\://github\.com/ansible\-collections/community\.routeros/pull/38)\)\. @@ -834,12 +851,12 @@ Bugfix and feature release\. ## v1\.1\.0 - + ### Release Summary This release allow dashes in usernames for SSH\-based modules\. - + ### Minor Changes * command \- added support for a dash \(\-\) in username \([https\://github\.com/ansible\-collections/community\.routeros/pull/18](https\://github\.com/ansible\-collections/community\.routeros/pull/18)\)\. @@ -848,7 +865,7 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. @@ -861,7 +878,7 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. @@ -874,7 +891,7 @@ This is the first production \(non\-prerelease\) release of community\.rou ## v0\.1\.1 - + ### Release Summary Small improvements and bugfixes over the initial release\. @@ -887,12 +904,12 @@ Small improvements and bugfixes over the initial release\. ## v0\.1\.0 - + ### Release Summary The community\.routeros continues the work on the Ansible RouterOS modules from their state in community\.network 1\.2\.0\. The changes listed here are thus relative to the modules community\.network\.routeros\_\*\. - + ### Minor Changes * facts \- now also collecting data about BGP and OSPF \([https\://github\.com/ansible\-collections/community\.network/pull/101](https\://github\.com/ansible\-collections/community\.network/pull/101)\)\. diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 744afef..627304d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,20 @@ Community RouterOS Release Notes .. contents:: Topics +v3.7.0 +====== + +Release Summary +--------------- + +Feature release. + +Minor Changes +------------- + +- api_find_and_modify - allow to control whether ``dynamic`` and/or ``builtin`` entries are ignored with the new ``ignore_dynamic`` and ``ignore_builtin`` options (https://github.com/ansible-collections/community.routeros/issues/372, https://github.com/ansible-collections/community.routeros/pull/373). +- api_info, api_modify - add ``port-cost-mode`` to ``interface bridge`` which is supported since RouterOS 7.13 (https://github.com/ansible-collections/community.routeros/pull/371). + v3.6.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 5bb0119..3297286 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -901,3 +901,18 @@ releases: - 360-bgp-connection-afi.yml - 364-wireguard-responder.yml release_date: '2025-04-21' + 3.7.0: + changes: + minor_changes: + - api_find_and_modify - allow to control whether ``dynamic`` and/or ``builtin`` + entries are ignored with the new ``ignore_dynamic`` and ``ignore_builtin`` + options (https://github.com/ansible-collections/community.routeros/issues/372, + https://github.com/ansible-collections/community.routeros/pull/373). + - api_info, api_modify - add ``port-cost-mode`` to ``interface bridge`` which + is supported since RouterOS 7.13 (https://github.com/ansible-collections/community.routeros/pull/371). + release_summary: Feature release. + fragments: + - 3.7.0.yml + - 371-add-bridge-port-cost-mode.yml + - 373-api_find_and_modify-dynamic-builtin.yml + release_date: '2025-05-31' diff --git a/changelogs/fragments/3.7.0.yml b/changelogs/fragments/3.7.0.yml deleted file mode 100644 index 512efc9..0000000 --- a/changelogs/fragments/3.7.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Feature release. diff --git a/changelogs/fragments/371-add-bridge-port-cost-mode.yml b/changelogs/fragments/371-add-bridge-port-cost-mode.yml deleted file mode 100644 index 5ec9177..0000000 --- a/changelogs/fragments/371-add-bridge-port-cost-mode.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -minor_changes: - - api_info, api_modify - add ``port-cost-mode`` to ``interface bridge`` which is supported since RouterOS 7.13 (https://github.com/ansible-collections/community.routeros/pull/371). diff --git a/changelogs/fragments/373-api_find_and_modify-dynamic-builtin.yml b/changelogs/fragments/373-api_find_and_modify-dynamic-builtin.yml deleted file mode 100644 index 20e7a6b..0000000 --- a/changelogs/fragments/373-api_find_and_modify-dynamic-builtin.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - "api_find_and_modify - allow to control whether ``dynamic`` and/or ``builtin`` entries are ignored with the new ``ignore_dynamic`` and ``ignore_builtin`` options (https://github.com/ansible-collections/community.routeros/issues/372, https://github.com/ansible-collections/community.routeros/pull/373)." From 88806047e3dc600567f5cabfa6c470b95a920951 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 4 Jun 2025 15:19:28 +0200 Subject: [PATCH 10/31] Enable no-trailing-whitespace test. --- README.md | 2 +- antsibull-nox.toml | 4 ++++ docs/docsite/rst/api-guide.rst | 2 +- docs/docsite/rst/ssh-guide.rst | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 59d2aa4..05e6c81 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ Tested with the current ansible-core 2.15, ansible-core 2.16, ansible-core 2.17, ## External requirements -The exact requirements for every module are listed in the module documentation. +The exact requirements for every module are listed in the module documentation. ### Supported connections diff --git a/antsibull-nox.toml b/antsibull-nox.toml index d95dfed..776e49f 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -30,6 +30,10 @@ run_no_unwanted_files = true no_unwanted_files_module_extensions = [".py"] no_unwanted_files_yaml_extensions = [".yml"] run_action_groups = true +run_no_trailing_whitespace = true +no_trailing_whitespace_skip_directories = [ + "tests/unit/plugins/modules/fixtures/", +] [[sessions.extra_checks.action_groups_config]] name = "api" diff --git a/docs/docsite/rst/api-guide.rst b/docs/docsite/rst/api-guide.rst index 6140d81..be4bfa3 100644 --- a/docs/docsite/rst/api-guide.rst +++ b/docs/docsite/rst/api-guide.rst @@ -57,7 +57,7 @@ This results in the following output: } PLAY RECAP ******************************************************************************************************* - localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 + localhost : ok=2 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 Check out the documentation of the :ansplugin:`community.routeros.api module ` for details on the options. diff --git a/docs/docsite/rst/ssh-guide.rst b/docs/docsite/rst/ssh-guide.rst index 4b0eb20..685038e 100644 --- a/docs/docsite/rst/ssh-guide.rst +++ b/docs/docsite/rst/ssh-guide.rst @@ -126,4 +126,4 @@ This results in the following output: } PLAY RECAP ******************************************************************************************************* - router : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 + router : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0 From 49e4b83594765a42ca82e52d252e0a73d6bf6075 Mon Sep 17 00:00:00 2001 From: SdVSysAdmin Date: Fri, 13 Jun 2025 08:10:27 +0200 Subject: [PATCH 11/31] support for 'ip ipsec mode-config' (#376) * Added support for 'ip ipsec mode-config' * Create 376-ipsec-mode-config.yml --------- Co-authored-by: Laurent Papier --- .../fragments/376-ipsec-mode-config.yml | 3 +++ plugins/module_utils/_api_data.py | 19 ++++++++++++++----- plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + 4 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 changelogs/fragments/376-ipsec-mode-config.yml diff --git a/changelogs/fragments/376-ipsec-mode-config.yml b/changelogs/fragments/376-ipsec-mode-config.yml new file mode 100644 index 0000000..27bad66 --- /dev/null +++ b/changelogs/fragments/376-ipsec-mode-config.yml @@ -0,0 +1,3 @@ +minor_changes: + - api_modify, api_info - support API path ``ip ipsec mode-config`` + (https://github.com/ansible-collections/community.routeros/pull/376). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index e95d599..92816f9 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -652,13 +652,22 @@ PATHS = { ), ('ip', 'ipsec', 'mode-config'): APIData( unversioned=VersionedAPIData( - unknown_mechanism=True, - # primary_keys=('default', ), + fully_understood=True, + primary_keys=('name', ), + versioned_fields=[ + ([('6.43', '>=')], 'responder', KeyInfo(default=False)), + ([('6.44', '>=')], 'address', KeyInfo(can_disable=True, remove_value='0.0.0.0')), + ], fields={ - 'default': KeyInfo(), + 'address-pool': KeyInfo(can_disable=True, remove_value='none'), + 'address-prefix-length': KeyInfo(), + 'comment': KeyInfo(can_disable=True, remove_value=''), 'name': KeyInfo(), - 'responder': KeyInfo(), - 'use-responder-dns': KeyInfo(), + 'split-dns': KeyInfo(can_disable=True, remove_value=''), + 'split-include': KeyInfo(can_disable=True, remove_value=''), + 'src-address-list': KeyInfo(can_disable=True, remove_value=''), + 'static-dns': KeyInfo(can_disable=True, remove_value=''), + 'system-dns': KeyInfo(default=False), }, ), ), diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index bd36955..d3f1b9e 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -148,6 +148,7 @@ options: - ip firewall service-port - ip hotspot service-port - ip ipsec identity + - ip ipsec mode-config - ip ipsec peer - ip ipsec policy - ip ipsec profile diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 2c1b012..e89b051 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -159,6 +159,7 @@ options: - ip firewall service-port - ip hotspot service-port - ip ipsec identity + - ip ipsec mode-config - ip ipsec peer - ip ipsec policy - ip ipsec profile From c7b2275f2c5b1ef85faa679127b6d62f162044ec Mon Sep 17 00:00:00 2001 From: Michael Jenny Date: Fri, 13 Jun 2025 08:10:37 +0200 Subject: [PATCH 12/31] Support RouterOS path /interface ethernet switch port-isolation and /routing bfd configuration (#375) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update _api_data.py Add /interface/bridge property "port-cost-mode" which is supported since RouterOS 7.13. See changelog for details: https://mikrotik.com/download/changelogs * Create 371-add-bridge-port-cost-mode.yml * Update changelogs/fragments/371-add-bridge-port-cost-mode.yml Co-authored-by: Felix Fontein * Support for /interface ethernet switch port-isolation RouterOS has supported the /interface ethernet switch port-isolation path since version 6.43. This feature enables hardware offloaded Layer‑2 port isolation on supported switch chips Support for /routing bfd configuration Since RouterOS 7.11 it supports stable bfd support. See: https://iparchitechs.com/mikrotik-routeros-v7-11-stable-released/ * . * Add change file * attr order * Add name to fields * PEP8 * Update changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml Co-authored-by: Felix Fontein * Update changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein Co-authored-by: Michael Jenny --- ...solation-and-routing_bfd_configuration.yml | 6 ++++ plugins/module_utils/_api_data.py | 34 +++++++++++++++++++ plugins/modules/api_info.py | 2 ++ plugins/modules/api_modify.py | 2 ++ 4 files changed, 44 insertions(+) create mode 100644 changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml diff --git a/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml b/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml new file mode 100644 index 0000000..81d2976 --- /dev/null +++ b/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml @@ -0,0 +1,6 @@ +--- +minor_changes: + - api_info, api_modify - add ``interface ethernet switch port-isolation`` which is supported since RouterOS 6.43 (https://github.com/ansible-collections/community.routeros/pull/375). + - | + api_info, api_modify - add ``routing bfd configuration``. Officially stabilized BFD support for BGP and OSPF is available since RouterOS 7.11 + (https://github.com/ansible-collections/community.routeros/pull/375). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 92816f9..0fdb0ca 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -4187,6 +4187,28 @@ PATHS = { }, ), ), + ('routing', 'bfd', 'configuration'): APIData( + versioned=[ + ('7.11', '>=', VersionedAPIData( + fully_understood=True, + fields={ + 'address-list': KeyInfo(), + 'addresses': KeyInfo(), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'copy-from': KeyInfo(), + 'disabled': KeyInfo(default=False), + 'forbid-bfd': KeyInfo(), + 'interfaces': KeyInfo(), + 'min-echo-rx': KeyInfo(), + 'min-rx': KeyInfo(), + 'min-tx': KeyInfo(), + 'multiplier': KeyInfo(), + 'place-before': KeyInfo(), + 'vrf': KeyInfo(), + }, + )) + ], + ), ('routing', 'bfd', 'interface'): APIData( unversioned=VersionedAPIData( unknown_mechanism=True, @@ -4903,6 +4925,18 @@ PATHS = { }, ), ), + ('interface', 'ethernet', 'switch', 'port-isolation'): APIData( + versioned=[ + ('6.43', '>=', VersionedAPIData( + primary_keys=('name', ), + fully_understood=True, + fields={ + 'forwarding-override': KeyInfo(), + 'name': KeyInfo(), + }, + )), + ], + ), ('ip', 'dhcp-client', 'option'): APIData( unversioned=VersionedAPIData( fixed_entries=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index d3f1b9e..1eb8a94 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -68,6 +68,7 @@ options: - interface ethernet poe - interface ethernet switch - interface ethernet switch port + - interface ethernet switch port-isolation - interface gre - interface gre6 - interface l2tp-client @@ -203,6 +204,7 @@ options: - queue type - radius - radius incoming + - routing bfd configuration - routing bgp aggregate - routing bgp connection - routing bgp instance diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index e89b051..dfa6fd5 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -79,6 +79,7 @@ options: - interface ethernet poe - interface ethernet switch - interface ethernet switch port + - interface ethernet switch port-isolation - interface gre - interface gre6 - interface l2tp-client @@ -214,6 +215,7 @@ options: - queue type - radius - radius incoming + - routing bfd configuration - routing bgp aggregate - routing bgp connection - routing bgp instance From 4571d777dea8715b971be0b3eb7b453005e012fa Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 13 Jun 2025 08:11:36 +0200 Subject: [PATCH 13/31] Prepare 3.8.0. --- changelogs/fragments/3.8.0.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3.8.0.yml diff --git a/changelogs/fragments/3.8.0.yml b/changelogs/fragments/3.8.0.yml new file mode 100644 index 0000000..512efc9 --- /dev/null +++ b/changelogs/fragments/3.8.0.yml @@ -0,0 +1 @@ +release_summary: Feature release. diff --git a/galaxy.yml b/galaxy.yml index b9f4453..1966418 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.7.0 +version: 3.8.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From aa83116c7851e6231b3568f56999faba8d450398 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 14 Jun 2025 16:49:40 +0200 Subject: [PATCH 14/31] Release 3.8.0. --- CHANGELOG.md | 285 ++++++++++-------- CHANGELOG.rst | 16 + changelogs/changelog.yaml | 18 ++ changelogs/fragments/3.8.0.yml | 1 - ...solation-and-routing_bfd_configuration.yml | 6 - .../fragments/376-ipsec-mode-config.yml | 3 - 6 files changed, 186 insertions(+), 143 deletions(-) delete mode 100644 changelogs/fragments/3.8.0.yml delete mode 100644 changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml delete mode 100644 changelogs/fragments/376-ipsec-mode-config.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 294687e..248e59b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,153 +2,156 @@ **Topics** -- v3\.7\.0 +- v3\.8\.0 - Release Summary - Minor Changes -- v3\.6\.0 +- v3\.7\.0 - Release Summary - Minor Changes -- v3\.5\.0 +- v3\.6\.0 - Release Summary - Minor Changes -- v3\.4\.0 +- v3\.5\.0 - Release Summary - Minor Changes - - Bugfixes -- v3\.3\.0 +- v3\.4\.0 - Release Summary - Minor Changes -- v3\.2\.0 + - Bugfixes +- v3\.3\.0 - Release Summary - Minor Changes -- v3\.1\.0 +- v3\.2\.0 - Release Summary - Minor Changes +- v3\.1\.0 + - Release Summary + - Minor Changes - Bugfixes - v3\.0\.0 - - Release Summary + - Release Summary - Breaking Changes / Porting Guide - Removed Features \(previously deprecated\) - v2\.20\.0 - - Release Summary - - Minor Changes -- v2\.19\.0 - Release Summary - Minor Changes -- v2\.18\.0 +- v2\.19\.0 - Release Summary - Minor Changes +- v2\.18\.0 + - Release Summary + - Minor Changes - Deprecated Features - Bugfixes - v2\.17\.0 - - Release Summary - - Minor Changes -- v2\.16\.0 - Release Summary - Minor Changes -- v2\.15\.0 +- v2\.16\.0 - Release Summary - Minor Changes -- v2\.14\.0 +- v2\.15\.0 - Release Summary - Minor Changes -- v2\.13\.0 +- v2\.14\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.12\.0 +- v2\.13\.0 - Release Summary - Minor Changes -- v2\.11\.0 + - Bugfixes +- v2\.12\.0 - Release Summary - Minor Changes -- v2\.10\.0 +- v2\.11\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.9\.0 +- v2\.10\.0 - Release Summary - Minor Changes + - Bugfixes +- v2\.9\.0 + - Release Summary + - Minor Changes - Bugfixes - v2\.8\.3 - - Release Summary + - Release Summary - Known Issues - v2\.8\.2 - - Release Summary + - Release Summary - Bugfixes - v2\.8\.1 - - Release Summary + - Release Summary - Bugfixes - v2\.8\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v2\.7\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.6\.0 + - Bugfixes +- v2\.7\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.5\.0 + - Bugfixes +- v2\.6\.0 - Release Summary - Minor Changes - - Bugfixes -- v2\.4\.0 + - Bugfixes +- v2\.5\.0 - Release Summary - Minor Changes + - Bugfixes +- v2\.4\.0 + - Release Summary + - Minor Changes - Bugfixes - Known Issues - v2\.3\.1 - - Release Summary + - Release Summary - Known Issues - v2\.3\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - Bugfixes - v2\.2\.1 - - Release Summary + - Release Summary - Bugfixes - v2\.2\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - Bugfixes - New Modules - v2\.1\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - Bugfixes - New Modules - v2\.0\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - Breaking Changes / Porting Guide - Bugfixes - New Plugins - Filter - v1\.2\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v1\.1\.0 - Release Summary - Minor Changes -- v1\.0\.1 + - Bugfixes +- v1\.1\.0 - Release Summary + - Minor Changes +- v1\.0\.1 + - Release Summary - Bugfixes - v1\.0\.0 - - Release Summary + - Release Summary - Bugfixes - v0\.1\.1 - - Release Summary + - Release Summary - Bugfixes - v0\.1\.0 - - Release Summary - - Minor Changes + - Release Summary + - Minor Changes - -## v3\.7\.0 + +## v3\.8\.0 ### Release Summary @@ -158,11 +161,13 @@ Feature release\. ### Minor Changes -* api\_find\_and\_modify \- allow to control whether dynamic and/or builtin entries are ignored with the new ignore\_dynamic and ignore\_builtin options \([https\://github\.com/ansible\-collections/community\.routeros/issues/372](https\://github\.com/ansible\-collections/community\.routeros/issues/372)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/373](https\://github\.com/ansible\-collections/community\.routeros/pull/373)\)\. -* api\_info\, api\_modify \- add port\-cost\-mode to interface bridge which is supported since RouterOS 7\.13 \([https\://github\.com/ansible\-collections/community\.routeros/pull/371](https\://github\.com/ansible\-collections/community\.routeros/pull/371)\)\. +* api\_info\, api\_modify \- add interface ethernet switch port\-isolation which is supported since RouterOS 6\.43 \([https\://github\.com/ansible\-collections/community\.routeros/pull/375](https\://github\.com/ansible\-collections/community\.routeros/pull/375)\)\. +* api\_info\, api\_modify \- add routing bfd configuration\. Officially stabilized BFD support for BGP and OSPF is available since RouterOS 7\.11 + \([https\://github\.com/ansible\-collections/community\.routeros/pull/375](https\://github\.com/ansible\-collections/community\.routeros/pull/375)\)\. +* api\_modify\, api\_info \- support API path ip ipsec mode\-config \([https\://github\.com/ansible\-collections/community\.routeros/pull/376](https\://github\.com/ansible\-collections/community\.routeros/pull/376)\)\. - -## v3\.6\.0 + +## v3\.7\.0 ### Release Summary @@ -172,12 +177,11 @@ Feature release\. ### Minor Changes -* api\_info\, api\_modify \- add mdns\-repeat\-ifaces to ip dns for RouterOS 7\.16 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/358](https\://github\.com/ansible\-collections/community\.routeros/pull/358)\)\. -* api\_info\, api\_modify \- field name change in routing bgp connection path implemented by RouterOS 7\.19 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/360](https\://github\.com/ansible\-collections/community\.routeros/pull/360)\)\. -* api\_info\, api\_modify \- rename is\-responder property in interface wireguard peers to responder for RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/364](https\://github\.com/ansible\-collections/community\.routeros/pull/364)\)\. +* api\_find\_and\_modify \- allow to control whether dynamic and/or builtin entries are ignored with the new ignore\_dynamic and ignore\_builtin options \([https\://github\.com/ansible\-collections/community\.routeros/issues/372](https\://github\.com/ansible\-collections/community\.routeros/issues/372)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/373](https\://github\.com/ansible\-collections/community\.routeros/pull/373)\)\. +* api\_info\, api\_modify \- add port\-cost\-mode to interface bridge which is supported since RouterOS 7\.13 \([https\://github\.com/ansible\-collections/community\.routeros/pull/371](https\://github\.com/ansible\-collections/community\.routeros/pull/371)\)\. - -## v3\.5\.0 + +## v3\.6\.0 ### Release Summary @@ -187,17 +191,32 @@ Feature release\. ### Minor Changes +* api\_info\, api\_modify \- add mdns\-repeat\-ifaces to ip dns for RouterOS 7\.16 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/358](https\://github\.com/ansible\-collections/community\.routeros/pull/358)\)\. +* api\_info\, api\_modify \- field name change in routing bgp connection path implemented by RouterOS 7\.19 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/360](https\://github\.com/ansible\-collections/community\.routeros/pull/360)\)\. +* api\_info\, api\_modify \- rename is\-responder property in interface wireguard peers to responder for RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/364](https\://github\.com/ansible\-collections/community\.routeros/pull/364)\)\. + + +## v3\.5\.0 + + +### Release Summary + +Feature release\. + + +### Minor Changes + * api\_info\, api\_modify \- change default for /ip/cloud/ddns\-enabled for RouterOS 7\.17 and newer from yes to auto \([https\://github\.com/ansible\-collections/community\.routeros/pull/350](https\://github\.com/ansible\-collections/community\.routeros/pull/350)\)\. ## v3\.4\.0 - + ### Release Summary Feature and bugfix release\. - + ### Minor Changes * api\_info\, api\_modify \- add support for the ip dns forwarders path implemented by RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/343](https\://github\.com/ansible\-collections/community\.routeros/pull/343)\)\. @@ -210,12 +229,12 @@ Feature and bugfix release\. ## v3\.3\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add missing attribute require\-message\-auth for the radius path which exists since RouterOS version 7\.15 \([https\://github\.com/ansible\-collections/community\.routeros/issues/338](https\://github\.com/ansible\-collections/community\.routeros/issues/338)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/339](https\://github\.com/ansible\-collections/community\.routeros/pull/339)\)\. @@ -226,12 +245,12 @@ Feature release\. ## v3\.2\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add support for the routing filter community\-list path implemented by RouterOS 7 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/331](https\://github\.com/ansible\-collections/community\.routeros/pull/331)\)\. @@ -239,12 +258,12 @@ Feature release\. ## v3\.1\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add missing fields comment\, next\-pool to ip pool path \([https\://github\.com/ansible\-collections/community\.routeros/pull/327](https\://github\.com/ansible\-collections/community\.routeros/pull/327)\)\. @@ -257,7 +276,7 @@ Bugfix and feature release\. ## v3\.0\.0 - + ### Release Summary Major release that drops support for End of Life Python versions and fixes check mode for community\.routeros\.command\. @@ -275,12 +294,12 @@ Major release that drops support for End of Life Python versions and fixes check ## v2\.20\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add new parameters from the RouterOS 7\.16 release \([https\://github\.com/ansible\-collections/community\.routeros/pull/323](https\://github\.com/ansible\-collections/community\.routeros/pull/323)\)\. @@ -291,12 +310,12 @@ Feature release\. ## v2\.19\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add support for the ip dns adlist path implemented by RouterOS 7\.15 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/310](https\://github\.com/ansible\-collections/community\.routeros/pull/310)\)\. @@ -308,12 +327,12 @@ Feature release\. ## v2\.18\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info \- allow to restrict the output by limiting fields to specific values with the new restrict option \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\. @@ -337,12 +356,12 @@ Feature release\. ## v2\.17\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add system health settings path \([https\://github\.com/ansible\-collections/community\.routeros/pull/294](https\://github\.com/ansible\-collections/community\.routeros/pull/294)\)\. @@ -352,12 +371,12 @@ Feature release\. ## v2\.16\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add missing path /ppp secret \([https\://github\.com/ansible\-collections/community\.routeros/pull/286](https\://github\.com/ansible\-collections/community\.routeros/pull/286)\)\. @@ -366,12 +385,12 @@ Feature release\. ## v2\.15\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- Add RouterOS 7\.x support to /mpls ldp path \([https\://github\.com/ansible\-collections/community\.routeros/pull/271](https\://github\.com/ansible\-collections/community\.routeros/pull/271)\)\. @@ -388,12 +407,12 @@ Feature release\. ## v2\.14\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add read\-only fields installed\-version\, latest\-version and status in system package update \([https\://github\.com/ansible\-collections/community\.routeros/pull/263](https\://github\.com/ansible\-collections/community\.routeros/pull/263)\)\. @@ -403,12 +422,12 @@ Feature release\. ## v2\.13\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_info\, api\_modify \- make path user group modifiable and add comment attribute \([https\://github\.com/ansible\-collections/community\.routeros/issues/256](https\://github\.com/ansible\-collections/community\.routeros/issues/256)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/257](https\://github\.com/ansible\-collections/community\.routeros/pull/257)\)\. @@ -422,12 +441,12 @@ Bugfix and feature release\. ## v2\.12\.0 - + ### Release Summary Feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add interface ovpn\-client path \([https\://github\.com/ansible\-collections/community\.routeros/issues/242](https\://github\.com/ansible\-collections/community\.routeros/issues/242)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/244](https\://github\.com/ansible\-collections/community\.routeros/pull/244)\)\. @@ -441,12 +460,12 @@ Feature release\. ## v2\.11\.0 - + ### Release Summary Feature and bugfix release\. - + ### Minor Changes * api\_info\, api\_modify \- add missing DoH parameters doh\-max\-concurrent\-queries\, doh\-max\-server\-connections\, and doh\-timeout to the ip dns path \([https\://github\.com/ansible\-collections/community\.routeros/issues/230](https\://github\.com/ansible\-collections/community\.routeros/issues/230)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/235](https\://github\.com/ansible\-collections/community\.routeros/pull/235)\) @@ -461,12 +480,12 @@ Feature and bugfix release\. ## v2\.10\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_info \- add new include\_read\_only option to select behavior for read\-only values\. By default these are not returned \([https\://github\.com/ansible\-collections/community\.routeros/pull/213](https\://github\.com/ansible\-collections/community\.routeros/pull/213)\)\. @@ -498,12 +517,12 @@ Bugfix and feature release\. ## v2\.9\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_info\, api\_modify \- add path caps\-man channel and enable path caps\-man manager interface \([https\://github\.com/ansible\-collections/community\.routeros/issues/193](https\://github\.com/ansible\-collections/community\.routeros/issues/193)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/194](https\://github\.com/ansible\-collections/community\.routeros/pull/194)\)\. @@ -517,7 +536,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -538,7 +557,7 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - + ### Release Summary Bugfix release\. @@ -551,7 +570,7 @@ Bugfix release\. ## v2\.8\.1 - + ### Release Summary Bugfix release\. @@ -564,12 +583,12 @@ Bugfix release\. ## v2\.8\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_modify \- adapt data for API paths ip dhcp\-server network \([https\://github\.com/ansible\-collections/community\.routeros/pull/156](https\://github\.com/ansible\-collections/community\.routeros/pull/156)\)\. @@ -589,12 +608,12 @@ Bugfix and feature release\. ## v2\.7\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * api\_modify\, api\_info \- support API paths ip arp\, ip firewall raw\, ipv6 firewall raw \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\. @@ -607,12 +626,12 @@ Bugfix and feature release\. ## v2\.6\.0 - + ### Release Summary Regular bugfix and feature release\. - + ### Minor Changes * api\_modify\, api\_info \- add field regexp to ip dns static \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\. @@ -627,12 +646,12 @@ Regular bugfix and feature release\. ## v2\.5\.0 - + ### Release Summary Feature and bugfix release\. - + ### 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](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\. @@ -645,12 +664,12 @@ Feature and bugfix release\. ## v2\.4\.0 - + ### Release Summary Feature release improving the api\* modules\. - + ### Minor Changes * api\* modules \- Add new option force\_no\_cert to connect with ADH ciphers \([https\://github\.com/ansible\-collections/community\.routeros/pull/124](https\://github\.com/ansible\-collections/community\.routeros/pull/124)\)\. @@ -689,7 +708,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -702,12 +721,12 @@ Maintenance release with improved documentation\. ## v2\.3\.0 - + ### Release Summary Feature and bugfix release\. - + ### Minor Changes * The collection repository conforms to the [REUSE specification](https\://reuse\.software/spec/) except for the changelog fragments \([https\://github\.com/ansible\-collections/community\.routeros/pull/108](https\://github\.com/ansible\-collections/community\.routeros/pull/108)\)\. @@ -722,7 +741,7 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. @@ -736,12 +755,12 @@ Bugfix release\. ## v2\.2\.0 - + ### Release Summary New feature release\. - + ### Minor Changes * All software licenses are now in the LICENSES/ directory of the collection root\. Moreover\, SPDX\-License\-Identifier\: is used to declare the applicable license for every file that is not automatically generated \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\. @@ -760,12 +779,12 @@ New feature release\. ## v2\.1\.0 - + ### Release Summary Feature and bugfix release with new modules\. - + ### Minor Changes * Added a community\.routeros\.api module defaults group\. Use with group/community\.routeros\.api to provide options for all API\-based modules \([https\://github\.com/ansible\-collections/community\.routeros/pull/89](https\://github\.com/ansible\-collections/community\.routeros/pull/89)\)\. @@ -789,12 +808,12 @@ Feature and bugfix release with new modules\. ## v2\.0\.0 - + ### Release Summary A new major release with breaking changes in the behavior of community\.routeros\.api and community\.routeros\.command\. - + ### Minor Changes * api \- make validation of WHERE for query more strict \([https\://github\.com/ansible\-collections/community\.routeros/pull/53](https\://github\.com/ansible\-collections/community\.routeros/pull/53)\)\. @@ -830,12 +849,12 @@ A new major release with breaking changes in the behavior of community\.ro ## v1\.2\.0 - + ### Release Summary Bugfix and feature release\. - + ### Minor Changes * Avoid internal ansible\-core module\_utils in favor of equivalent public API available since at least Ansible 2\.9 \([https\://github\.com/ansible\-collections/community\.routeros/pull/38](https\://github\.com/ansible\-collections/community\.routeros/pull/38)\)\. @@ -851,12 +870,12 @@ Bugfix and feature release\. ## v1\.1\.0 - + ### Release Summary This release allow dashes in usernames for SSH\-based modules\. - + ### Minor Changes * command \- added support for a dash \(\-\) in username \([https\://github\.com/ansible\-collections/community\.routeros/pull/18](https\://github\.com/ansible\-collections/community\.routeros/pull/18)\)\. @@ -865,7 +884,7 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. @@ -878,7 +897,7 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. @@ -891,7 +910,7 @@ This is the first production \(non\-prerelease\) release of community\.rou ## v0\.1\.1 - + ### Release Summary Small improvements and bugfixes over the initial release\. @@ -904,12 +923,12 @@ Small improvements and bugfixes over the initial release\. ## v0\.1\.0 - + ### Release Summary The community\.routeros continues the work on the Ansible RouterOS modules from their state in community\.network 1\.2\.0\. The changes listed here are thus relative to the modules community\.network\.routeros\_\*\. - + ### Minor Changes * facts \- now also collecting data about BGP and OSPF \([https\://github\.com/ansible\-collections/community\.network/pull/101](https\://github\.com/ansible\-collections/community\.network/pull/101)\)\. diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 627304d..cc72cad 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,22 @@ Community RouterOS Release Notes .. contents:: Topics +v3.8.0 +====== + +Release Summary +--------------- + +Feature release. + +Minor Changes +------------- + +- api_info, api_modify - add ``interface ethernet switch port-isolation`` which is supported since RouterOS 6.43 (https://github.com/ansible-collections/community.routeros/pull/375). +- api_info, api_modify - add ``routing bfd configuration``. Officially stabilized BFD support for BGP and OSPF is available since RouterOS 7.11 + (https://github.com/ansible-collections/community.routeros/pull/375). +- api_modify, api_info - support API path ``ip ipsec mode-config`` (https://github.com/ansible-collections/community.routeros/pull/376). + v3.7.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 3297286..eaaf93e 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -916,3 +916,21 @@ releases: - 371-add-bridge-port-cost-mode.yml - 373-api_find_and_modify-dynamic-builtin.yml release_date: '2025-05-31' + 3.8.0: + changes: + minor_changes: + - api_info, api_modify - add ``interface ethernet switch port-isolation`` + which is supported since RouterOS 6.43 (https://github.com/ansible-collections/community.routeros/pull/375). + - 'api_info, api_modify - add ``routing bfd configuration``. Officially stabilized + BFD support for BGP and OSPF is available since RouterOS 7.11 + + (https://github.com/ansible-collections/community.routeros/pull/375). + + ' + - api_modify, api_info - support API path ``ip ipsec mode-config`` (https://github.com/ansible-collections/community.routeros/pull/376). + release_summary: Feature release. + fragments: + - 3.8.0.yml + - 375-port_isolation-and-routing_bfd_configuration.yml + - 376-ipsec-mode-config.yml + release_date: '2025-06-14' diff --git a/changelogs/fragments/3.8.0.yml b/changelogs/fragments/3.8.0.yml deleted file mode 100644 index 512efc9..0000000 --- a/changelogs/fragments/3.8.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Feature release. diff --git a/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml b/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml deleted file mode 100644 index 81d2976..0000000 --- a/changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -minor_changes: - - api_info, api_modify - add ``interface ethernet switch port-isolation`` which is supported since RouterOS 6.43 (https://github.com/ansible-collections/community.routeros/pull/375). - - | - api_info, api_modify - add ``routing bfd configuration``. Officially stabilized BFD support for BGP and OSPF is available since RouterOS 7.11 - (https://github.com/ansible-collections/community.routeros/pull/375). diff --git a/changelogs/fragments/376-ipsec-mode-config.yml b/changelogs/fragments/376-ipsec-mode-config.yml deleted file mode 100644 index 27bad66..0000000 --- a/changelogs/fragments/376-ipsec-mode-config.yml +++ /dev/null @@ -1,3 +0,0 @@ -minor_changes: - - api_modify, api_info - support API path ``ip ipsec mode-config`` - (https://github.com/ansible-collections/community.routeros/pull/376). From b751d79a98ebd1bfce3d5bab3c797a9c2960fbd8 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 17 Jun 2025 07:19:14 +0200 Subject: [PATCH 15/31] Update yamllint config, fix YAML. --- .yamllint-extra-docs | 53 ++++++++++++++++++++++++++++++++++ antsibull-nox.toml | 1 + docs/docsite/rst/api-guide.rst | 2 +- docs/docsite/rst/ssh-guide.rst | 26 ++++++++--------- 4 files changed, 68 insertions(+), 14 deletions(-) create mode 100644 .yamllint-extra-docs diff --git a/.yamllint-extra-docs b/.yamllint-extra-docs new file mode 100644 index 0000000..7e24c0f --- /dev/null +++ b/.yamllint-extra-docs @@ -0,0 +1,53 @@ +--- +# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +# SPDX-License-Identifier: GPL-3.0-or-later +# SPDX-FileCopyrightText: 2025 Felix Fontein + +extends: default + +ignore: | + /changelogs/ + +rules: + line-length: + max: 160 + level: error + document-start: disable + document-end: + present: false + truthy: + level: error + allowed-values: + - 'true' + - 'false' + indentation: + spaces: 2 + indent-sequences: true + key-duplicates: enable + trailing-spaces: enable + new-line-at-end-of-file: disable + hyphens: + max-spaces-after: 1 + empty-lines: + max: 2 + max-start: 0 + max-end: 0 + commas: + max-spaces-before: 0 + min-spaces-after: 1 + max-spaces-after: 1 + colons: + max-spaces-before: 0 + max-spaces-after: 1 + brackets: + min-spaces-inside: 0 + max-spaces-inside: 0 + braces: + min-spaces-inside: 0 + max-spaces-inside: 1 + octal-values: + forbid-implicit-octal: true + forbid-explicit-octal: true + comments: + min-spaces-from-content: 1 + comments-indentation: false diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 776e49f..8391654 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -18,6 +18,7 @@ run_yamllint = true yamllint_config = ".yamllint" yamllint_config_plugins = ".yamllint-docs" yamllint_config_plugins_examples = ".yamllint-examples" +yamllint_config_extra_docs = ".yamllint-extra-docs" run_mypy = false [sessions.docs_check] diff --git a/docs/docsite/rst/api-guide.rst b/docs/docsite/rst/api-guide.rst index be4bfa3..9df17fc 100644 --- a/docs/docsite/rst/api-guide.rst +++ b/docs/docsite/rst/api-guide.rst @@ -191,7 +191,7 @@ When this playbook completed successfully, you should be able to use the HTTPS a .. code-block:: yaml+jinja - community.routeros.api: - ... + # ... tls: true validate_certs: true validate_cert_hostname: true diff --git a/docs/docsite/rst/ssh-guide.rst b/docs/docsite/rst/ssh-guide.rst index 685038e..ac1f65b 100644 --- a/docs/docsite/rst/ssh-guide.rst +++ b/docs/docsite/rst/ssh-guide.rst @@ -66,22 +66,22 @@ With the above inventory, you can use the following playbook to execute ``/syste gather_facts: false tasks: - - name: Gather system resources - community.routeros.command: - commands: - - /system resource print - register: system_resource_print + - name: Gather system resources + community.routeros.command: + commands: + - /system resource print + register: system_resource_print - - name: Show system resources - debug: - var: system_resource_print.stdout_lines + - name: Show system resources + debug: + var: system_resource_print.stdout_lines - - name: Gather facts - community.routeros.facts: + - name: Gather facts + community.routeros.facts: - - name: Show a fact - debug: - msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}" + - name: Show a fact + debug: + msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}" This results in the following output: From 6008397375b2916df045ea00ad4d7e51dbd1ebf1 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 18 Jun 2025 21:48:53 +0200 Subject: [PATCH 16/31] Add linting check for RST code blocks. --- antsibull-nox.toml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 8391654..d82f63c 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -23,6 +23,15 @@ run_mypy = false [sessions.docs_check] validate_collection_refs="all" +codeblocks_restrict_types = [ + "ansible-output", + "ini", + "yaml", + "yaml+jinja", +] +codeblocks_restrict_type_exact_case = true +codeblocks_allow_without_type = false +codeblocks_allow_literal_blocks = false [sessions.license_check] From 3475751b30ba7ceefa0d4c0906cb7df085f90d79 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 1 Jul 2025 07:24:51 +0200 Subject: [PATCH 17/31] Add stable-2.19 to CI; add ignore-2.20.txt (#378) * Add ignore-2.20.txt. * Restrict stable-2.19 versions. --- antsibull-nox.toml | 1 + tests/sanity/ignore-2.20.txt | 1 + tests/sanity/ignore-2.20.txt.license | 3 +++ 3 files changed, 5 insertions(+) create mode 100644 tests/sanity/ignore-2.20.txt create mode 100644 tests/sanity/ignore-2.20.txt.license diff --git a/antsibull-nox.toml b/antsibull-nox.toml index d82f63c..6478f27 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -69,3 +69,4 @@ controller_python_versions_only = true "2.16" = ["3.10"] "2.17" = ["3.8"] "2.18" = ["3.9"] +"2.19" = ["3.11"] diff --git a/tests/sanity/ignore-2.20.txt b/tests/sanity/ignore-2.20.txt new file mode 100644 index 0000000..65e5bca --- /dev/null +++ b/tests/sanity/ignore-2.20.txt @@ -0,0 +1 @@ +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.20.txt.license b/tests/sanity/ignore-2.20.txt.license new file mode 100644 index 0000000..edff8c7 --- /dev/null +++ b/tests/sanity/ignore-2.20.txt.license @@ -0,0 +1,3 @@ +GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) +SPDX-License-Identifier: GPL-3.0-or-later +SPDX-FileCopyrightText: Ansible Project From d9be02bdb8ab0e92459627b0197314fd5e77f47c Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 1 Jul 2025 22:34:37 +0200 Subject: [PATCH 18/31] Adjust README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 05e6c81..7d4f4c3 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ For more information about communication, see the [Ansible communication guide]( ## Tested with Ansible -Tested with the current ansible-core 2.15, ansible-core 2.16, ansible-core 2.17, and ansible-core 2.18 releases and the current development version of ansible-core. Ansible 2.9, ansible-base 2.10, and ansible-core versions before 2.15.0 are not supported. +Tested with the current ansible-core 2.15, ansible-core 2.16, ansible-core 2.17, ansible-core 2.18, and ansible-core 2.19 releases and the current development version of ansible-core. Ansible 2.9, ansible-base 2.10, and ansible-core versions before 2.15.0 are not supported. ## External requirements From bb7eadbc9ffb78e946dae745d4057cf022a627b5 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 6 Jul 2025 18:05:28 +0200 Subject: [PATCH 19/31] Avoid tabs. --- antsibull-nox.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 6478f27..082b06c 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -44,6 +44,7 @@ run_no_trailing_whitespace = true no_trailing_whitespace_skip_directories = [ "tests/unit/plugins/modules/fixtures/", ] +run_avoid_characters = true [[sessions.extra_checks.action_groups_config]] name = "api" @@ -51,6 +52,10 @@ pattern = "^api.*$" exclusions = [] doc_fragment = "community.routeros.attributes.actiongroup_api" +[[sessions.extra_checks.avoid_character_group]] +name = "tab" +regex = "\\x09" + [sessions.build_import_check] run_galaxy_importer = true From 852e21a2f2cb2888f61a5addb2682b57c969cd56 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 25 Jul 2025 18:59:28 +0200 Subject: [PATCH 20/31] Move EE tests to antsibull-nox. (#384) --- .github/workflows/ee.yml | 159 --------------------------------------- antsibull-nox.toml | 20 +++++ 2 files changed, 20 insertions(+), 159 deletions(-) delete mode 100644 .github/workflows/ee.yml diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml deleted file mode 100644 index 5b45972..0000000 --- a/.github/workflows/ee.yml +++ /dev/null @@ -1,159 +0,0 @@ ---- -# Copyright (c) Ansible Project -# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) -# SPDX-License-Identifier: GPL-3.0-or-later - -name: execution environment -'on': - # Run CI against all pushes (direct commits, also merged PRs), Pull Requests - push: - branches: - - main - - stable-* - pull_request: - # Run CI once per day (at 05:15 UTC) - # This ensures that even if there haven't been commits that we are still testing against latest version of ansible-builder - schedule: - - cron: '15 5 * * *' - -env: - NAMESPACE: community - COLLECTION_NAME: routeros - -jobs: - build: - name: Build and test EE (${{ matrix.name }}) - strategy: - fail-fast: false - matrix: - name: - - '' - ansible_core: - - '' - ansible_runner: - - '' - base_image: - - '' - pre_base: - - '' - extra_vars: - - '' - other_deps: - - '' - exclude: - - ansible_core: '' - include: - - name: ansible-core devel @ RHEL UBI 9 - ansible_core: https://github.com/ansible/ansible/archive/devel.tar.gz - ansible_runner: ansible-runner - other_deps: |2 - python_interpreter: - package_system: python3.11 python3.11-pip python3.11-wheel python3.11-cryptography - python_path: "/usr/bin/python3.11" - base_image: docker.io/redhat/ubi9:latest - pre_base: '"#"' - - name: ansible-core 2.15 @ Rocky Linux 9 - ansible_core: https://github.com/ansible/ansible/archive/stable-2.15.tar.gz - ansible_runner: ansible-runner - base_image: quay.io/rockylinux/rockylinux:9 - pre_base: '"#"' - runs-on: ubuntu-latest - steps: - - name: Check out code - uses: actions/checkout@v4 - with: - path: ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }} - persist-credentials: false - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.11' - - - name: Install ansible-builder and ansible-navigator - run: pip install ansible-builder ansible-navigator - - - name: Verify requirements - run: ansible-builder introspect --sanitize . - - - name: Make sure galaxy.yml has version entry - run: >- - python -c - 'import yaml ; - f = open("galaxy.yml", "rb") ; - data = yaml.safe_load(f) ; - f.close() ; - data["version"] = data.get("version") or "0.0.1" ; - f = open("galaxy.yml", "wb") ; - f.write(yaml.dump(data).encode("utf-8")) ; - f.close() ; - ' - working-directory: ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }} - - - name: Build collection - run: | - ansible-galaxy collection build --output-path ../../../ - working-directory: ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }} - - - name: Create files for building execution environment - run: | - COLLECTION_FILENAME="$(ls "${NAMESPACE}-${COLLECTION_NAME}"-*.tar.gz)" - - # EE config - cat > execution-environment.yml < requirements.yml < - ansible-navigator run - --mode stdout - --container-engine docker - --pull-policy never - --set-environment-variable ANSIBLE_PRIVATE_ROLE_VARS=true - --execution-environment-image test-ee:latest - -v - all.yml - ${{ matrix.extra_vars }} - working-directory: ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}/tests/ee diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 082b06c..885e041 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -75,3 +75,23 @@ controller_python_versions_only = true "2.17" = ["3.8"] "2.18" = ["3.9"] "2.19" = ["3.11"] + +[[sessions.ee_check.execution_environments]] +name = "devel-ubi-9" +description = "ansible-core devel @ RHEL UBI 9" +test_playbooks = ["tests/ee/all.yml"] +config.images.base_image.name = "docker.io/redhat/ubi9:latest" +config.dependencies.ansible_core.package_pip = "https://github.com/ansible/ansible/archive/devel.tar.gz" +config.dependencies.ansible_runner.package_pip = "ansible-runner" +config.dependencies.python_interpreter.package_system = "python3.11 python3.11-pip python3.11-wheel python3.11-cryptography" +config.dependencies.python_interpreter.python_path = "/usr/bin/python3.11" +runtime_environment = {"ANSIBLE_PRIVATE_ROLE_VARS" = "true"} + +[[sessions.ee_check.execution_environments]] +name = "2.15-rocky-9" +description = "ansible-core 2.15 @ Rocky Linux 9" +test_playbooks = ["tests/ee/all.yml"] +config.images.base_image.name = "quay.io/rockylinux/rockylinux:9" +config.dependencies.ansible_core.package_pip = "https://github.com/ansible/ansible/archive/stable-2.15.tar.gz" +config.dependencies.ansible_runner.package_pip = "ansible-runner" +runtime_environment = {"ANSIBLE_PRIVATE_ROLE_VARS" = "true"} From 9099fcd6987c895b41a9564813bf01dabae66120 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 25 Jul 2025 22:19:29 +0200 Subject: [PATCH 21/31] Prepare 3.8.1. --- changelogs/fragments/3.8.1.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3.8.1.yml diff --git a/changelogs/fragments/3.8.1.yml b/changelogs/fragments/3.8.1.yml new file mode 100644 index 0000000..8ce9aa9 --- /dev/null +++ b/changelogs/fragments/3.8.1.yml @@ -0,0 +1 @@ +release_summary: Bugfix release. diff --git a/galaxy.yml b/galaxy.yml index 1966418..31eb214 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.8.0 +version: 3.8.1 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From 1c182725ce8f5020c53cdf07a271beb3010c3140 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 25 Jul 2025 22:26:39 +0200 Subject: [PATCH 22/31] Prevent deprecation warnings when using ansible-core 2.19. (#385) --- changelogs/fragments/384-warnings.yml | 2 ++ plugins/modules/api_facts.py | 4 +--- plugins/modules/facts.py | 4 +--- 3 files changed, 4 insertions(+), 6 deletions(-) create mode 100644 changelogs/fragments/384-warnings.yml diff --git a/changelogs/fragments/384-warnings.yml b/changelogs/fragments/384-warnings.yml new file mode 100644 index 0000000..77eaef9 --- /dev/null +++ b/changelogs/fragments/384-warnings.yml @@ -0,0 +1,2 @@ +bugfixes: + - "facts and api_facts modules - prevent deprecation warnings when used with ansible-core 2.19 (https://github.com/ansible-collections/community.routeros/pull/384)." diff --git a/plugins/modules/api_facts.py b/plugins/modules/api_facts.py index 41c9a4e..09c0fbb 100644 --- a/plugins/modules/api_facts.py +++ b/plugins/modules/api_facts.py @@ -419,8 +419,6 @@ FACT_SUBSETS = dict( VALID_SUBSETS = frozenset(FACT_SUBSETS.keys()) -warnings = [] - def main(): argument_spec = dict( @@ -485,7 +483,7 @@ def main(): key = 'ansible_net_%s' % key ansible_facts[key] = value - module.exit_json(ansible_facts=ansible_facts, warnings=warnings) + module.exit_json(ansible_facts=ansible_facts) if __name__ == '__main__': diff --git a/plugins/modules/facts.py b/plugins/modules/facts.py index e75d609..e80143c 100644 --- a/plugins/modules/facts.py +++ b/plugins/modules/facts.py @@ -589,8 +589,6 @@ FACT_SUBSETS = dict( VALID_SUBSETS = frozenset(FACT_SUBSETS.keys()) -warnings = list() - def main(): """main entry point for module execution @@ -653,7 +651,7 @@ def main(): key = 'ansible_net_%s' % key ansible_facts[key] = value - module.exit_json(ansible_facts=ansible_facts, warnings=warnings) + module.exit_json(ansible_facts=ansible_facts) if __name__ == '__main__': From 6e9d2e137969a13d08db354bdf145adeba77aaa6 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 26 Jul 2025 14:38:22 +0200 Subject: [PATCH 23/31] Release 3.8.1. --- CHANGELOG.md | 290 ++++++++++++++------------ CHANGELOG.rst | 13 ++ changelogs/changelog.yaml | 10 + changelogs/fragments/3.8.1.yml | 1 - changelogs/fragments/384-warnings.yml | 2 - 5 files changed, 176 insertions(+), 140 deletions(-) delete mode 100644 changelogs/fragments/3.8.1.yml delete mode 100644 changelogs/fragments/384-warnings.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 248e59b..88a7efe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,158 +2,174 @@ **Topics** -- v3\.8\.0 +- v3\.8\.1 - Release Summary + - Bugfixes +- v3\.8\.0 + - Release Summary - Minor Changes - v3\.7\.0 - - Release Summary + - Release Summary - Minor Changes - v3\.6\.0 - - Release Summary + - Release Summary - Minor Changes - v3\.5\.0 - - Release Summary + - Release Summary - Minor Changes - v3\.4\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v3\.3\.0 - Release Summary + - Minor Changes + - Bugfixes +- v3\.3\.0 + - Release Summary - Minor Changes - v3\.2\.0 - - Release Summary + - Release Summary - Minor Changes - v3\.1\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v3\.0\.0 - Release Summary + - Minor Changes + - Bugfixes +- v3\.0\.0 + - Release Summary - Breaking Changes / Porting Guide - Removed Features \(previously deprecated\) - v2\.20\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.19\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.18\.0 - - Release Summary + - Release Summary - Minor Changes - Deprecated Features - - Bugfixes + - Bugfixes - v2\.17\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.16\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.15\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.14\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.13\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v2\.12\.0 - Release Summary + - Minor Changes + - Bugfixes +- v2\.12\.0 + - Release Summary - Minor Changes - v2\.11\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.10\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v2\.9\.0 - Release Summary - - Minor Changes + - Minor Changes - Bugfixes -- v2\.8\.3 +- v2\.9\.0 - Release Summary + - Minor Changes + - Bugfixes +- v2\.8\.3 + - Release Summary - Known Issues - v2\.8\.2 - - Release Summary - - Bugfixes -- v2\.8\.1 - Release Summary - Bugfixes -- v2\.8\.0 +- v2\.8\.1 - Release Summary - - Minor Changes - Bugfixes -- v2\.7\.0 +- v2\.8\.0 - Release Summary - - Minor Changes + - Minor Changes - Bugfixes -- v2\.6\.0 +- v2\.7\.0 - Release Summary - - Minor Changes + - Minor Changes - Bugfixes -- v2\.5\.0 +- v2\.6\.0 - Release Summary - - Minor Changes + - Minor Changes - Bugfixes -- v2\.4\.0 +- v2\.5\.0 - Release Summary - - Minor Changes + - Minor Changes - Bugfixes +- v2\.4\.0 + - Release Summary + - Minor Changes + - Bugfixes - Known Issues - v2\.3\.1 - - Release Summary + - Release Summary - Known Issues - v2\.3\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v2\.2\.1 - Release Summary + - Minor Changes - Bugfixes -- v2\.2\.0 +- v2\.2\.1 - Release Summary - - Minor Changes - Bugfixes +- v2\.2\.0 + - Release Summary + - Minor Changes + - Bugfixes - New Modules - v2\.1\.0 - - Release Summary + - Release Summary - Minor Changes - - Bugfixes + - Bugfixes - New Modules - v2\.0\.0 - - Release Summary + - Release Summary - Minor Changes - Breaking Changes / Porting Guide - - Bugfixes + - Bugfixes - New Plugins - Filter - v1\.2\.0 - - Release Summary - - Minor Changes - - Bugfixes -- v1\.1\.0 - Release Summary + - Minor Changes + - Bugfixes +- v1\.1\.0 + - Release Summary - Minor Changes - v1\.0\.1 - - Release Summary - - Bugfixes -- v1\.0\.0 - Release Summary - Bugfixes -- v0\.1\.1 +- v1\.0\.0 - Release Summary - Bugfixes -- v0\.1\.0 +- v0\.1\.1 - Release Summary + - Bugfixes +- v0\.1\.0 + - Release Summary - Minor Changes + +## v3\.8\.1 + + +### Release Summary + +Bugfix release\. + + +### Bugfixes + +* facts and api\_facts modules \- prevent deprecation warnings when used with ansible\-core 2\.19 \([https\://github\.com/ansible\-collections/community\.routeros/pull/384](https\://github\.com/ansible\-collections/community\.routeros/pull/384)\)\. + ## v3\.8\.0 - + ### Release Summary Feature release\. @@ -169,7 +185,7 @@ Feature release\. ## v3\.7\.0 - + ### Release Summary Feature release\. @@ -183,7 +199,7 @@ Feature release\. ## v3\.6\.0 - + ### Release Summary Feature release\. @@ -198,7 +214,7 @@ Feature release\. ## v3\.5\.0 - + ### Release Summary Feature release\. @@ -211,7 +227,7 @@ Feature release\. ## v3\.4\.0 - + ### Release Summary Feature and bugfix release\. @@ -221,7 +237,7 @@ Feature and bugfix release\. * api\_info\, api\_modify \- add support for the ip dns forwarders path implemented by RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/343](https\://github\.com/ansible\-collections/community\.routeros/pull/343)\)\. - + ### Bugfixes * api\_info\, api\_modify \- remove the primary key action from the interface wifi provisioning path\, since RouterOS also allows to create completely duplicate entries \([https\://github\.com/ansible\-collections/community\.routeros/issues/344](https\://github\.com/ansible\-collections/community\.routeros/issues/344)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/345](https\://github\.com/ansible\-collections/community\.routeros/pull/345)\)\. @@ -229,7 +245,7 @@ Feature and bugfix release\. ## v3\.3\.0 - + ### Release Summary Feature release\. @@ -245,7 +261,7 @@ Feature release\. ## v3\.2\.0 - + ### Release Summary Feature release\. @@ -258,7 +274,7 @@ Feature release\. ## v3\.1\.0 - + ### Release Summary Bugfix and feature release\. @@ -268,7 +284,7 @@ Bugfix and feature release\. * api\_info\, api\_modify \- add missing fields comment\, next\-pool to ip pool path \([https\://github\.com/ansible\-collections/community\.routeros/pull/327](https\://github\.com/ansible\-collections/community\.routeros/pull/327)\)\. - + ### Bugfixes * api\_info\, api\_modify \- fields log and log\-prefix in paths ip firewall filter\, ip firewall mangle\, ip firewall nat\, ip firewall raw now have the correct default values \([https\://github\.com/ansible\-collections/community\.routeros/pull/324](https\://github\.com/ansible\-collections/community\.routeros/pull/324)\)\. @@ -276,7 +292,7 @@ Bugfix and feature release\. ## v3\.0\.0 - + ### Release Summary Major release that drops support for End of Life Python versions and fixes check mode for community\.routeros\.command\. @@ -294,7 +310,7 @@ Major release that drops support for End of Life Python versions and fixes check ## v2\.20\.0 - + ### Release Summary Feature release\. @@ -310,7 +326,7 @@ Feature release\. ## v2\.19\.0 - + ### Release Summary Feature release\. @@ -327,7 +343,7 @@ Feature release\. ## v2\.18\.0 - + ### Release Summary Feature release\. @@ -348,7 +364,7 @@ Feature release\. * The collection deprecates support for all Ansible/ansible\-base/ansible\-core versions that are currently End of Life\, [according to the ansible\-core support matrix](https\://docs\.ansible\.com/ansible\-core/devel/reference\_appendices/release\_and\_maintenance\.html\#ansible\-core\-support\-matrix)\. This means that the next major release of the collection will no longer support Ansible 2\.9\, ansible\-base 2\.10\, ansible\-core 2\.11\, ansible\-core 2\.12\, ansible\-core 2\.13\, and ansible\-core 2\.14\. - + ### Bugfixes * api\_modify\, api\_info \- change the default of ingress\-filtering in paths interface bridge and interface bridge port back to false for RouterOS before version 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\. @@ -356,7 +372,7 @@ Feature release\. ## v2\.17\.0 - + ### Release Summary Feature release\. @@ -371,7 +387,7 @@ Feature release\. ## v2\.16\.0 - + ### Release Summary Feature release\. @@ -385,7 +401,7 @@ Feature release\. ## v2\.15\.0 - + ### Release Summary Feature release\. @@ -407,7 +423,7 @@ Feature release\. ## v2\.14\.0 - + ### Release Summary Feature release\. @@ -422,7 +438,7 @@ Feature release\. ## v2\.13\.0 - + ### Release Summary Bugfix and feature release\. @@ -433,7 +449,7 @@ Bugfix and feature release\. * api\_info\, api\_modify \- make path user group modifiable and add comment attribute \([https\://github\.com/ansible\-collections/community\.routeros/issues/256](https\://github\.com/ansible\-collections/community\.routeros/issues/256)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/257](https\://github\.com/ansible\-collections/community\.routeros/pull/257)\)\. * api\_modify\, api\_info \- add support for the ip vrf path in RouterOS 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/259](https\://github\.com/ansible\-collections/community\.routeros/pull/259)\) - + ### Bugfixes * facts \- fix date not getting removed for idempotent config export \([https\://github\.com/ansible\-collections/community\.routeros/pull/262](https\://github\.com/ansible\-collections/community\.routeros/pull/262)\)\. @@ -441,7 +457,7 @@ Bugfix and feature release\. ## v2\.12\.0 - + ### Release Summary Feature release\. @@ -460,7 +476,7 @@ Feature release\. ## v2\.11\.0 - + ### Release Summary Feature and bugfix release\. @@ -480,7 +496,7 @@ Feature and bugfix release\. ## v2\.10\.0 - + ### Release Summary Bugfix and feature release\. @@ -509,7 +525,7 @@ Bugfix and feature release\. * api\_modify \- add new handle\_read\_only and handle\_write\_only options to handle the module\'s behavior for read\-only and write\-only fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/213](https\://github\.com/ansible\-collections/community\.routeros/pull/213)\)\. * api\_modify\, api\_info \- support API paths routing id\, routing bgp connection \([https\://github\.com/ansible\-collections/community\.routeros/pull/220](https\://github\.com/ansible\-collections/community\.routeros/pull/220)\)\. - + ### Bugfixes * api\_info\, api\_modify \- in the snmp path\, ensure that engine\-id\-suffix is only available on RouterOS 7\.10\+\, and that engine\-id is read\-only on RouterOS 7\.10\+ \([https\://github\.com/ansible\-collections/community\.routeros/issues/208](https\://github\.com/ansible\-collections/community\.routeros/issues/208)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/218](https\://github\.com/ansible\-collections/community\.routeros/pull/218)\)\. @@ -517,7 +533,7 @@ Bugfix and feature release\. ## v2\.9\.0 - + ### Release Summary Bugfix and feature release\. @@ -528,7 +544,7 @@ Bugfix and feature release\. * api\_info\, api\_modify \- add path caps\-man channel and enable path caps\-man manager interface \([https\://github\.com/ansible\-collections/community\.routeros/issues/193](https\://github\.com/ansible\-collections/community\.routeros/issues/193)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/194](https\://github\.com/ansible\-collections/community\.routeros/pull/194)\)\. * api\_info\, api\_modify \- add path ip traffic\-flow target \([https\://github\.com/ansible\-collections/community\.routeros/issues/191](https\://github\.com/ansible\-collections/community\.routeros/issues/191)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/192](https\://github\.com/ansible\-collections/community\.routeros/pull/192)\)\. - + ### Bugfixes * api\_modify\, api\_info \- add missing parameter engine\-id\-suffix for the snmp path \([https\://github\.com/ansible\-collections/community\.routeros/issues/189](https\://github\.com/ansible\-collections/community\.routeros/issues/189)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/190](https\://github\.com/ansible\-collections/community\.routeros/pull/190)\)\. @@ -536,7 +552,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -557,19 +573,6 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - -### Release Summary - -Bugfix release\. - - -### Bugfixes - -* api\_modify\, api\_info \- add missing parameter tls for the tool e\-mail path \([https\://github\.com/ansible\-collections/community\.routeros/issues/179](https\://github\.com/ansible\-collections/community\.routeros/issues/179)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/180](https\://github\.com/ansible\-collections/community\.routeros/pull/180)\)\. - - -## v2\.8\.1 - ### Release Summary @@ -578,12 +581,25 @@ Bugfix release\. ### Bugfixes +* api\_modify\, api\_info \- add missing parameter tls for the tool e\-mail path \([https\://github\.com/ansible\-collections/community\.routeros/issues/179](https\://github\.com/ansible\-collections/community\.routeros/issues/179)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/180](https\://github\.com/ansible\-collections/community\.routeros/pull/180)\)\. + + +## v2\.8\.1 + + +### Release Summary + +Bugfix release\. + + +### Bugfixes + * facts \- do not crash in CLI output preprocessing in unexpected situations during line unwrapping \([https\://github\.com/ansible\-collections/community\.routeros/issues/170](https\://github\.com/ansible\-collections/community\.routeros/issues/170)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/177](https\://github\.com/ansible\-collections/community\.routeros/pull/177)\)\. ## v2\.8\.0 - + ### Release Summary Bugfix and feature release\. @@ -598,7 +614,7 @@ Bugfix and feature release\. * api\_modify \- support API paths ip firewall layer7\-protocol \([https\://github\.com/ansible\-collections/community\.routeros/pull/153](https\://github\.com/ansible\-collections/community\.routeros/pull/153)\)\. * command \- workaround for extra characters in stdout in RouterOS versions between 6\.49 and 7\.1\.5 \([https\://github\.com/ansible\-collections/community\.routeros/issues/62](https\://github\.com/ansible\-collections/community\.routeros/issues/62)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/161](https\://github\.com/ansible\-collections/community\.routeros/pull/161)\)\. - + ### Bugfixes * api\_info\, api\_modify \- fix default and remove behavior for dhcp\-options in path ip dhcp\-client \([https\://github\.com/ansible\-collections/community\.routeros/issues/148](https\://github\.com/ansible\-collections/community\.routeros/issues/148)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\. @@ -608,7 +624,7 @@ Bugfix and feature release\. ## v2\.7\.0 - + ### Release Summary Bugfix and feature release\. @@ -618,7 +634,7 @@ Bugfix and feature release\. * api\_modify\, api\_info \- support API paths ip arp\, ip firewall raw\, ipv6 firewall raw \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\. - + ### Bugfixes * api\_modify\, api\_info \- defaults corrected for fields in interface wireguard peers API path \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\. @@ -626,7 +642,7 @@ Bugfix and feature release\. ## v2\.6\.0 - + ### Release Summary Regular bugfix and feature release\. @@ -637,7 +653,7 @@ Regular bugfix and feature release\. * api\_modify\, api\_info \- add field regexp to ip dns static \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\. * api\_modify\, api\_info \- support API paths interface wireguard\, interface wireguard peers \([https\://github\.com/ansible\-collections/community\.routeros/pull/143](https\://github\.com/ansible\-collections/community\.routeros/pull/143)\)\. - + ### Bugfixes * api\_modify \- do not use name as a unique key in ip dns static \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\. @@ -646,7 +662,7 @@ Regular bugfix and feature release\. ## v2\.5\.0 - + ### Release Summary Feature and bugfix release\. @@ -656,7 +672,7 @@ Feature and bugfix release\. * 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](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](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\. @@ -664,7 +680,7 @@ Feature and bugfix release\. ## v2\.4\.0 - + ### Release Summary Feature release improving the api\* modules\. @@ -690,7 +706,7 @@ Feature release improving the api\* modules\. * api\_modify\, api\_info \- support for fields blackhole\, pref\-src\, routing\-table\, suppress\-hw\-offload\, type\, vrf\-interface in ip route path \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\. * 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 vrf for system ntp client \([https\://github\.com/ansible\-collections/community\.routeros/pull/122](https\://github\.com/ansible\-collections/community\.routeros/pull/122)\)\. - + ### Bugfixes * api\_modify \- ip route entry can be defined without the need of gateway field\, which is correct for unreachable/blackhole type of routes \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\. @@ -708,7 +724,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -721,7 +737,7 @@ Maintenance release with improved documentation\. ## v2\.3\.0 - + ### Release Summary Feature and bugfix release\. @@ -733,7 +749,7 @@ Feature and bugfix release\. * api\* modules \- added timeout parameter \([https\://github\.com/ansible\-collections/community\.routeros/pull/109](https\://github\.com/ansible\-collections/community\.routeros/pull/109)\)\. * api\_modify\, api\_info \- support API path ip firewall mangle \([https\://github\.com/ansible\-collections/community\.routeros/pull/110](https\://github\.com/ansible\-collections/community\.routeros/pull/110)\)\. - + ### Bugfixes * api\_modify\, api\_info \- make API path ip dhcp\-server support script\, and ip firewall nat support in\-interface and in\-interface\-list \([https\://github\.com/ansible\-collections/community\.routeros/pull/110](https\://github\.com/ansible\-collections/community\.routeros/pull/110)\)\. @@ -741,12 +757,12 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. - + ### Bugfixes * api\_modify\, api\_info \- make API path ip dhcp\-server lease support server\=all \([https\://github\.com/ansible\-collections/community\.routeros/issues/104](https\://github\.com/ansible\-collections/community\.routeros/issues/104)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/107](https\://github\.com/ansible\-collections/community\.routeros/pull/107)\)\. @@ -755,7 +771,7 @@ Bugfix release\. ## v2\.2\.0 - + ### Release Summary New feature release\. @@ -765,7 +781,7 @@ New feature release\. * All software licenses are now in the LICENSES/ directory of the collection root\. Moreover\, SPDX\-License\-Identifier\: is used to declare the applicable license for every file that is not automatically generated \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\. - + ### Bugfixes * Include LICENSES/BSD\-2\-Clause\.txt file for the routeros module utils \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\. @@ -779,7 +795,7 @@ New feature release\. ## v2\.1\.0 - + ### Release Summary Feature and bugfix release with new modules\. @@ -793,7 +809,7 @@ Feature and bugfix release with new modules\. * api \- update query to accept symbolic parameters \([https\://github\.com/ansible\-collections/community\.routeros/pull/63](https\://github\.com/ansible\-collections/community\.routeros/pull/63)\)\. * api\* modules \- allow to set an encoding other than the default ASCII for communicating with the API \([https\://github\.com/ansible\-collections/community\.routeros/pull/95](https\://github\.com/ansible\-collections/community\.routeros/pull/95)\)\. - + ### Bugfixes * query \- fix query function check for \.id vs\. id arguments to not conflict with routeros arguments like identity \([https\://github\.com/ansible\-collections/community\.routeros/pull/68](https\://github\.com/ansible\-collections/community\.routeros/pull/68)\, [https\://github\.com/ansible\-collections/community\.routeros/issues/67](https\://github\.com/ansible\-collections/community\.routeros/issues/67)\)\. @@ -808,7 +824,7 @@ Feature and bugfix release with new modules\. ## v2\.0\.0 - + ### Release Summary A new major release with breaking changes in the behavior of community\.routeros\.api and community\.routeros\.command\. @@ -827,7 +843,7 @@ A new major release with breaking changes in the behavior of community\.ro * api \- splitting commands no longer uses a naive split by whitespace\, but a more RouterOS CLI compatible splitting algorithm \([https\://github\.com/ansible\-collections/community\.routeros/pull/45](https\://github\.com/ansible\-collections/community\.routeros/pull/45)\)\. * command \- the module now always indicates that a change happens\. If this is not correct\, please use changed\_when to determine the correct changed status for a task \([https\://github\.com/ansible\-collections/community\.routeros/pull/50](https\://github\.com/ansible\-collections/community\.routeros/pull/50)\)\. - + ### Bugfixes * api \- improve splitting of WHERE queries \([https\://github\.com/ansible\-collections/community\.routeros/pull/47](https\://github\.com/ansible\-collections/community\.routeros/pull/47)\)\. @@ -849,7 +865,7 @@ A new major release with breaking changes in the behavior of community\.ro ## v1\.2\.0 - + ### Release Summary Bugfix and feature release\. @@ -862,7 +878,7 @@ Bugfix and feature release\. * api \- rename option ssl to tls\, and keep the old name as an alias \([https\://github\.com/ansible\-collections/community\.routeros/pull/37](https\://github\.com/ansible\-collections/community\.routeros/pull/37)\)\. * fact \- add fact ansible\_net\_config\_nonverbose to get idempotent config \(no date\, no verbose\) \([https\://github\.com/ansible\-collections/community\.routeros/pull/23](https\://github\.com/ansible\-collections/community\.routeros/pull/23)\)\. - + ### Bugfixes * api \- when using TLS/SSL\, remove explicit cipher configuration to insecure values\, which also makes it impossible to connect to newer RouterOS versions \([https\://github\.com/ansible\-collections/community\.routeros/pull/34](https\://github\.com/ansible\-collections/community\.routeros/pull/34)\)\. @@ -870,7 +886,7 @@ Bugfix and feature release\. ## v1\.1\.0 - + ### Release Summary This release allow dashes in usernames for SSH\-based modules\. @@ -884,12 +900,12 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. - + ### Bugfixes * api \- remove id to \.id as default requirement which conflicts with RouterOS id configuration parameter \([https\://github\.com/ansible\-collections/community\.routeros/pull/15](https\://github\.com/ansible\-collections/community\.routeros/pull/15)\)\. @@ -897,12 +913,12 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. - + ### Bugfixes * routeros terminal plugin \- allow slashes in hostnames for terminal detection\. Without this\, slashes in hostnames will result in connection timeouts \([https\://github\.com/ansible\-collections/community\.network/pull/138](https\://github\.com/ansible\-collections/community\.network/pull/138)\)\. @@ -910,12 +926,12 @@ This is the first production \(non\-prerelease\) release of community\.rou ## v0\.1\.1 - + ### Release Summary Small improvements and bugfixes over the initial release\. - + ### Bugfixes * api \- fix crash when the ssl parameter is used \([https\://github\.com/ansible\-collections/community\.routeros/pull/3](https\://github\.com/ansible\-collections/community\.routeros/pull/3)\)\. @@ -923,7 +939,7 @@ Small improvements and bugfixes over the initial release\. ## v0\.1\.0 - + ### Release Summary The community\.routeros continues the work on the Ansible RouterOS modules from their state in community\.network 1\.2\.0\. The changes listed here are thus relative to the modules community\.network\.routeros\_\*\. diff --git a/CHANGELOG.rst b/CHANGELOG.rst index cc72cad..2e73ef4 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,19 @@ Community RouterOS Release Notes .. contents:: Topics +v3.8.1 +====== + +Release Summary +--------------- + +Bugfix release. + +Bugfixes +-------- + +- facts and api_facts modules - prevent deprecation warnings when used with ansible-core 2.19 (https://github.com/ansible-collections/community.routeros/pull/384). + v3.8.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index eaaf93e..df9d0e0 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -934,3 +934,13 @@ releases: - 375-port_isolation-and-routing_bfd_configuration.yml - 376-ipsec-mode-config.yml release_date: '2025-06-14' + 3.8.1: + changes: + bugfixes: + - facts and api_facts modules - prevent deprecation warnings when used with + ansible-core 2.19 (https://github.com/ansible-collections/community.routeros/pull/384). + release_summary: Bugfix release. + fragments: + - 3.8.1.yml + - 384-warnings.yml + release_date: '2025-07-26' diff --git a/changelogs/fragments/3.8.1.yml b/changelogs/fragments/3.8.1.yml deleted file mode 100644 index 8ce9aa9..0000000 --- a/changelogs/fragments/3.8.1.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Bugfix release. diff --git a/changelogs/fragments/384-warnings.yml b/changelogs/fragments/384-warnings.yml deleted file mode 100644 index 77eaef9..0000000 --- a/changelogs/fragments/384-warnings.yml +++ /dev/null @@ -1,2 +0,0 @@ -bugfixes: - - "facts and api_facts modules - prevent deprecation warnings when used with ansible-core 2.19 (https://github.com/ansible-collections/community.routeros/pull/384)." From e988b18acf4f903d5eb052a318a705d18a816f59 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 27 Jul 2025 16:35:29 +0200 Subject: [PATCH 24/31] Normalize changelog configs. --- changelogs/config.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/changelogs/config.yaml b/changelogs/config.yaml index a02e530..39b7120 100644 --- a/changelogs/config.yaml +++ b/changelogs/config.yaml @@ -7,9 +7,9 @@ changelog_filename_template: ../CHANGELOG.rst changelog_filename_version_depth: 0 changes_file: changelog.yaml changes_format: combined +ignore_other_fragment_extensions: true keep_fragments: false mention_ancestor: true -flatmap: true new_plugins_after_name: removed_features notesdir: fragments output_formats: @@ -40,3 +40,4 @@ use_fqcn: true add_plugin_period: true changelog_nice_yaml: true changelog_sort: version +vcs: auto From 1f38be9e562dee377083aa86ca6a1d596742da48 Mon Sep 17 00:00:00 2001 From: hansmi Date: Mon, 28 Jul 2025 22:33:11 +0200 Subject: [PATCH 25/31] Update IPv6 settings fields for RouterOS 7.17/7.18 (#380) From the RouterOS 7.17 changelog: *) ipv6 - added IPv6 settings related to stale IPv6 neighbor cleanup; *) ipv6 - added support for manual link-local address configuration; And from the RouterOS 7.18 changelog: *) ipv6 - added FastTrack support; *) ipv6 - added support for neighbor removal and static entries; The change also removes the default value for the `max-neighbor-entries` field. It's documented to vary depending on the RAM size. --- changelogs/fragments/380-ipv6-settings.yml | 3 +++ plugins/module_utils/_api_data.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/380-ipv6-settings.yml diff --git a/changelogs/fragments/380-ipv6-settings.yml b/changelogs/fragments/380-ipv6-settings.yml new file mode 100644 index 0000000..a8c6e9b --- /dev/null +++ b/changelogs/fragments/380-ipv6-settings.yml @@ -0,0 +1,3 @@ +minor_changes: + - api_info, api_modify - add ``disable-link-local-address`` and ``stale-neighbor-timeout`` fields to ``ipv6 settings`` (https://github.com/ansible-collections/community.routeros/pull/380). + - api_info, api_modify - adjust neighbor limit fields in ``ipv6 settings`` to match RouterOS 7.18 and newer (https://github.com/ansible-collections/community.routeros/pull/380). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 0fdb0ca..cf8aed8 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1553,13 +1553,19 @@ PATHS = { fully_understood=True, versioned_fields=[ ([('7.16', '>=')], 'multipath-hash-policy', KeyInfo(default='l3')), + ([('7.17', '>=')], 'disable-link-local-address', KeyInfo(default=False)), + ([('7.17', '>=')], 'stale-neighbor-timeout', KeyInfo(default=60)), + ([('7.18', '>=')], 'allow-fast-path', KeyInfo(default=True)), + ([('7.18', '<')], 'max-neighbor-entries', KeyInfo(default=8192)), + ([('7.18', '>=')], 'min-neighbor-entries', KeyInfo()), + ([('7.18', '>=')], 'soft-max-neighbor-entries', KeyInfo()), + ([('7.18', '>=')], 'max-neighbor-entries', KeyInfo()), ], fields={ 'accept-redirects': KeyInfo(default='yes-if-forwarding-disabled'), 'accept-router-advertisements': KeyInfo(default='yes-if-forwarding-disabled'), 'disable-ipv6': KeyInfo(default=False), 'forward': KeyInfo(default=True), - 'max-neighbor-entries': KeyInfo(default=8192), }, ), ), From b70b4a72b3d810bd41c70e79c816833e0d112f05 Mon Sep 17 00:00:00 2001 From: hansmi Date: Mon, 28 Jul 2025 22:33:24 +0200 Subject: [PATCH 26/31] 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), From 008b5f893a2206302a07fb57ac64edcea53da406 Mon Sep 17 00:00:00 2001 From: Tr4sK Date: Mon, 28 Jul 2025 22:33:40 +0200 Subject: [PATCH 27/31] Update logging action fields for ROS 7.18 (#381) * Update logging action fields for ROS 7.18 * Add changelog fragment * Update changelogs/fragments/381-logging-cef.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- changelogs/fragments/381-logging-cef.yml | 2 ++ plugins/module_utils/_api_data.py | 5 +++++ 2 files changed, 7 insertions(+) create mode 100644 changelogs/fragments/381-logging-cef.yml diff --git a/changelogs/fragments/381-logging-cef.yml b/changelogs/fragments/381-logging-cef.yml new file mode 100644 index 0000000..849f82a --- /dev/null +++ b/changelogs/fragments/381-logging-cef.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api modify - add ``remote-log-format``, ``remote-protocol``, and ``event-delimiter`` to ``system logging action`` (https://github.com/ansible-collections/community.routeros/pull/381). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index ceef7e4..10505f3 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -5221,6 +5221,11 @@ PATHS = { unversioned=VersionedAPIData( fully_understood=True, primary_keys=('name',), + versioned_fields=[ + ([('7.18', '>=')], 'remote-log-format', KeyInfo(default='default')), + ([('7.18', '>=')], 'remote-protocol', KeyInfo(default='udp')), + ([('7.18', '>=')], 'cef-event-delimiter', KeyInfo(default='\r\n')), + ], fields={ 'bsd-syslog': KeyInfo(default=False), 'comment': KeyInfo(can_disable=True, remove_value=''), From c9d15bc43a2e7fb06d80a11b4ce1941fd3a44cef Mon Sep 17 00:00:00 2001 From: Michael Jenny Date: Mon, 28 Jul 2025 22:34:15 +0200 Subject: [PATCH 28/31] OVPN server accepts now multiple items (RouterOS >= 7.17) (#383) * Since RouterOS 7.17 VRF is supported for OVPN server. It now supports multiple entries and single-value is now obsolete. This demands for a versioned API. * Add change fragment * Add change fragment * add license field * Update changelogs/fragments/385-vrf-support-for-ovpn-server Co-authored-by: Felix Fontein * rename * remove license field --------- Co-authored-by: Felix Fontein --- .../385-vrf-support-for-ovpn-server.yml | 7 +++ plugins/module_utils/_api_data.py | 57 +++++++++++++------ 2 files changed, 47 insertions(+), 17 deletions(-) create mode 100644 changelogs/fragments/385-vrf-support-for-ovpn-server.yml diff --git a/changelogs/fragments/385-vrf-support-for-ovpn-server.yml b/changelogs/fragments/385-vrf-support-for-ovpn-server.yml new file mode 100644 index 0000000..4790a9d --- /dev/null +++ b/changelogs/fragments/385-vrf-support-for-ovpn-server.yml @@ -0,0 +1,7 @@ +--- +minor_changes: + - api_info, api_modify - since RouterOS 7.17 VRF is supported for OVPN server. + It now supports multiple entries, while ``api_modify`` so far only accepted a single entry. + The ``interface ovpn-server server`` path now allows multiple entries + on RouterOS 7.17 and newer + (https://github.com/ansible-collections/community.routeros/pull/383). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 10505f3..2b44b8b 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -1664,23 +1664,46 @@ PATHS = { ), ), ('interface', 'ovpn-server', 'server'): APIData( - unversioned=VersionedAPIData( - single_value=True, - fully_understood=True, - fields={ - 'auth': KeyInfo(), - 'cipher': KeyInfo(), - 'default-profile': KeyInfo(default='default'), - 'enabled': KeyInfo(default=False), - 'keepalive-timeout': KeyInfo(default=60), - 'mac-address': KeyInfo(), - 'max-mtu': KeyInfo(default=1500), - 'mode': KeyInfo(default='ip'), - 'netmask': KeyInfo(default=24), - 'port': KeyInfo(default=1194), - 'require-client-certificate': KeyInfo(default=False), - }, - ), + versioned=[ + ('7.17', '>=', VersionedAPIData( + fully_understood=True, + fields={ + 'auth': KeyInfo(), + 'cipher': KeyInfo(), + 'default-profile': KeyInfo(default='default'), + 'enabled': KeyInfo(default=False), + 'keepalive-timeout': KeyInfo(default=60), + 'mac-address': KeyInfo(), + 'max-mtu': KeyInfo(default=1500), + 'mode': KeyInfo(default='ip'), + 'name': KeyInfo(default=''), + 'netmask': KeyInfo(default=24), + 'port': KeyInfo(default=1194), + 'protocol': KeyInfo(default='tcp'), + 'require-client-certificate': KeyInfo(default=False), + 'vrf': KeyInfo(default='main'), + }, + )), + ('7.17', '<', VersionedAPIData( + single_value=True, + fully_understood=True, + fields={ + 'auth': KeyInfo(), + 'cipher': KeyInfo(), + 'default-profile': KeyInfo(default='default'), + 'enabled': KeyInfo(default=False), + 'keepalive-timeout': KeyInfo(default=60), + 'mac-address': KeyInfo(), + 'max-mtu': KeyInfo(default=1500), + 'mode': KeyInfo(default='ip'), + 'name': KeyInfo(default=''), + 'netmask': KeyInfo(default=24), + 'port': KeyInfo(default=1194), + 'protocol': KeyInfo(default='tcp'), + 'require-client-certificate': KeyInfo(default=False), + }, + )) + ] ), ('interface', 'pppoe-server', 'server'): APIData( unversioned=VersionedAPIData( From e78df4a4cff2bb097e4d10724376c69dd542773f Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 28 Jul 2025 22:35:44 +0200 Subject: [PATCH 29/31] Prepare 3.9.0. --- changelogs/fragments/3.9.0.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3.9.0.yml diff --git a/changelogs/fragments/3.9.0.yml b/changelogs/fragments/3.9.0.yml new file mode 100644 index 0000000..63e0654 --- /dev/null +++ b/changelogs/fragments/3.9.0.yml @@ -0,0 +1 @@ +release_summary: Feature release. \ No newline at end of file diff --git a/galaxy.yml b/galaxy.yml index 31eb214..f2ba31a 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.8.1 +version: 3.9.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From 8edc8018a72fac41028c7024e6dc2564a0f972e1 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 31 Jul 2025 07:18:42 +0200 Subject: [PATCH 30/31] Ansible-core devel EE: use Python 3.12. (#387) --- antsibull-nox.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 885e041..72982fa 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -83,8 +83,8 @@ test_playbooks = ["tests/ee/all.yml"] config.images.base_image.name = "docker.io/redhat/ubi9:latest" config.dependencies.ansible_core.package_pip = "https://github.com/ansible/ansible/archive/devel.tar.gz" config.dependencies.ansible_runner.package_pip = "ansible-runner" -config.dependencies.python_interpreter.package_system = "python3.11 python3.11-pip python3.11-wheel python3.11-cryptography" -config.dependencies.python_interpreter.python_path = "/usr/bin/python3.11" +config.dependencies.python_interpreter.package_system = "python3.12 python3.12-pip python3.12-wheel python3.12-cryptography" +config.dependencies.python_interpreter.python_path = "/usr/bin/python3.12" runtime_environment = {"ANSIBLE_PRIVATE_ROLE_VARS" = "true"} [[sessions.ee_check.execution_environments]] From 7395011b0c6054aa5c183511ede5d52cd079fb81 Mon Sep 17 00:00:00 2001 From: Jefferson Raylan Date: Thu, 31 Jul 2025 17:02:47 -0300 Subject: [PATCH 31/31] fix: Fix pattern to handle long system identity (#386) * fix: Fix pattern to handle long system identity names When the system identity string is too long, the terminal output may be truncated. The truncated output is marked by multiple carriage returns (`\r`) and a `<` symbol. This is a example of a truncated output: `\r\n\r\r\r\r ` The existing regex failed to match these truncated prompts. This update introduces a more flexible regex that matches both, the truncated and the preserved output. * add change-log fragment for pr 386 * refactoring change-log fragment for pr 386 * Update changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- .../fragments/386-fix-pattern-to-handle-long-identity.yml | 3 +++ plugins/terminal/routeros.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml diff --git a/changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml b/changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml new file mode 100644 index 0000000..b9a749f --- /dev/null +++ b/changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - routeros terminal plugin - fix ``terminal_stdout_re`` pattern to handle long system identities when connecting to RouterOS through SSH (https://github.com/ansible-collections/community.routeros/pull/386). diff --git a/plugins/terminal/routeros.py b/plugins/terminal/routeros.py index 9d50fa2..8a39561 100644 --- a/plugins/terminal/routeros.py +++ b/plugins/terminal/routeros.py @@ -31,7 +31,9 @@ class TerminalModule(TerminalBase): terminal_stdout_re = [ re.compile(br"\x1b<"), - re.compile(br"\[[\w\-\.]+\@[\w\s\-\.\/]+\] ?( ?$"), + re.compile( + br"((\[[\w\-\.]+\@)|(\r\<(([\w\-\.]*\@)|)))" + br"[\w\s\-\.\/]+\] ?( ?$"), re.compile(br"Please press \"Enter\" to continue!"), re.compile(br"Do you want to see the software license\? \[Y\/n\]: ?"), ]