From e18de43407e0dc00d2e1678863f1748d7c2e0f8d Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 18 Oct 2024 21:01:46 +0200 Subject: [PATCH 01/96] Prepare 3.0.0 release (#318) * Prepare 3.0.0 release. * Install using ansible-galaxy via git instead of cloning directly. --- .github/workflows/ansible-test.yml | 67 ++---- .github/workflows/ee.yml | 5 - LICENSES/PSF-2.0.txt | 48 ---- README.md | 2 +- changelogs/fragments/3.0.0.yml | 7 + galaxy.yml | 2 +- meta/runtime.yml | 2 +- plugins/module_utils/_version.py | 345 ---------------------------- plugins/module_utils/version.py | 7 +- plugins/modules/command.py | 10 +- tests/sanity/extra/update-docs.json | 5 +- tests/sanity/extra/update-docs.py | 2 +- 12 files changed, 37 insertions(+), 465 deletions(-) delete mode 100644 LICENSES/PSF-2.0.txt create mode 100644 changelogs/fragments/3.0.0.yml delete mode 100644 plugins/module_utils/_version.py diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index ad01212..4431bea 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -26,12 +26,6 @@ jobs: ansible: # It's important that Sanity is tested against all stable-X.Y branches # Testing against `devel` may fail as new tests are added. - - stable-2.9 - - stable-2.10 - - stable-2.11 - - stable-2.12 - - stable-2.13 - - stable-2.14 - stable-2.15 - stable-2.16 - stable-2.17 @@ -54,10 +48,9 @@ jobs: ansible-core-version: ${{ matrix.ansible }} codecov-token: ${{ secrets.CODECOV_TOKEN }} testing-type: sanity - # NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429) - pre-test-cmd: |- - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils + test-deps: >- + git+https://github.com/ansible-collections/ansible.utils.git,main + git+https://github.com/ansible-collections/ansible.netcommon.git,main units: # Ansible-test on various stable branches does not yet work well with cgroups v2. @@ -75,13 +68,6 @@ jobs: fail-fast: true matrix: ansible: - - stable-2.9 - - stable-2.10 - - stable-2.11 - - stable-2.12 - - stable-2.13 - - stable-2.14 - - stable-2.15 - stable-2.16 - stable-2.17 - stable-2.18 @@ -97,10 +83,9 @@ jobs: ansible-core-version: ${{ matrix.ansible }} codecov-token: ${{ secrets.CODECOV_TOKEN }} testing-type: units - # NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429) - pre-test-cmd: |- - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils + test-deps: >- + git+https://github.com/ansible-collections/ansible.utils.git,main + git+https://github.com/ansible-collections/ansible.netcommon.git,main integration: # Ansible-test on various stable branches does not yet work well with cgroups v2. @@ -122,41 +107,24 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13" include: - # 2.9 - - ansible: stable-2.9 - python: 2.7 - - ansible: stable-2.9 - python: 3.5 - # 2.10 - - ansible: stable-2.10 - python: 3.5 - # 2.11 - - ansible: stable-2.11 - python: 2.7 - - ansible: stable-2.11 - python: 3.6 - # 2.12 - - ansible: stable-2.12 - python: 3.8 - # 2.13 - - ansible: stable-2.13 - python: "3.10" - # 2.14 - - ansible: stable-2.14 - python: "3.11" # 2.15 - ansible: stable-2.15 - python: "3.9" + python: "2.7" + - ansible: stable-2.15 + python: "3.6" + - ansible: stable-2.15 + python: "3.7" # 2.16 - ansible: stable-2.16 python: "3.10" # 2.17 - ansible: stable-2.17 - python: "3.7" + python: "3.8" # 2.18 - ansible: stable-2.18 - python: "3.8" + python: "3.9" steps: - name: >- @@ -171,9 +139,8 @@ jobs: integration-continue-on-error: 'false' integration-diff: 'false' integration-retry-on-error: 'true' - # NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429) - pre-test-cmd: |- - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils + test-deps: >- + git+https://github.com/ansible-collections/ansible.utils.git,main + git+https://github.com/ansible-collections/ansible.netcommon.git,main target-python-version: ${{ matrix.python }} testing-type: integration diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml index cd6341f..9d6f3fd 100644 --- a/.github/workflows/ee.yml +++ b/.github/workflows/ee.yml @@ -57,11 +57,6 @@ jobs: ansible_runner: ansible-runner base_image: quay.io/rockylinux/rockylinux:9 pre_base: '"#"' - - name: ansible-core 2.14 @ CentOS Stream 9 - ansible_core: https://github.com/ansible/ansible/archive/stable-2.14.tar.gz - ansible_runner: ansible-runner - base_image: quay.io/centos/centos:stream9 - pre_base: '"#"' runs-on: ubuntu-latest steps: - name: Check out code diff --git a/LICENSES/PSF-2.0.txt b/LICENSES/PSF-2.0.txt deleted file mode 100644 index 35acd7f..0000000 --- a/LICENSES/PSF-2.0.txt +++ /dev/null @@ -1,48 +0,0 @@ -PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 --------------------------------------------- - -1. This LICENSE AGREEMENT is between the Python Software Foundation -("PSF"), and the Individual or Organization ("Licensee") accessing and -otherwise using this software ("Python") in source or binary form and -its associated documentation. - -2. Subject to the terms and conditions of this License Agreement, PSF hereby -grants Licensee a nonexclusive, royalty-free, world-wide license to reproduce, -analyze, test, perform and/or display publicly, prepare derivative works, -distribute, and otherwise use Python alone or in any derivative version, -provided, however, that PSF's License Agreement and PSF's notice of copyright, -i.e., "Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021 Python Software Foundation; -All Rights Reserved" are retained in Python alone or in any derivative version -prepared by Licensee. - -3. In the event Licensee prepares a derivative work that is based on -or incorporates Python or any part thereof, and wants to make -the derivative work available to others as provided herein, then -Licensee hereby agrees to include in any such work a brief summary of -the changes made to Python. - -4. PSF is making Python available to Licensee on an "AS IS" -basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR -IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND -DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS -FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT -INFRINGE ANY THIRD PARTY RIGHTS. - -5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON -FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS -A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, -OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. - -6. This License Agreement will automatically terminate upon a material -breach of its terms and conditions. - -7. Nothing in this License Agreement shall be deemed to create any -relationship of agency, partnership, or joint venture between PSF and -Licensee. This License Agreement does not grant permission to use PSF -trademarks or trade name in a trademark sense to endorse or promote -products or services of Licensee, or any third party. - -8. By copying, installing or otherwise using Python, Licensee -agrees to be bound by the terms and conditions of this License -Agreement. diff --git a/README.md b/README.md index a773b72..f7b488d 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ For more information about communication, see the [Ansible communication guide]( ## Tested with Ansible -Tested with the current Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, ansible-core 2.14, 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 versions before 2.9.10 are not supported. +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. ## External requirements diff --git a/changelogs/fragments/3.0.0.yml b/changelogs/fragments/3.0.0.yml new file mode 100644 index 0000000..4a71c2f --- /dev/null +++ b/changelogs/fragments/3.0.0.yml @@ -0,0 +1,7 @@ +release_summary: Major release that drops support for End of Life Python versions and fixes check mode for community.routeros.command. +removed_features: + - "The collection no longer supports Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, and ansible-core 2.14. + If you need to continue using End of Life versions of Ansible/ansible-base/ansible-core, please use community.routeros 2.x.y + (https://github.com/ansible-collections/community.routeros/pull/318)." +breaking_changes: + - "command - the module no longer declares that it supports check mode (https://github.com/ansible-collections/community.routeros/pull/318)." diff --git a/galaxy.yml b/galaxy.yml index 7c40eda..1508467 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 2.20.0 +version: 3.0.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) diff --git a/meta/runtime.yml b/meta/runtime.yml index 5aafd31..aae1259 100644 --- a/meta/runtime.yml +++ b/meta/runtime.yml @@ -3,7 +3,7 @@ # 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 -requires_ansible: '>=2.9.10' +requires_ansible: '>=2.15.0' action_groups: api: - api diff --git a/plugins/module_utils/_version.py b/plugins/module_utils/_version.py deleted file mode 100644 index f795407..0000000 --- a/plugins/module_utils/_version.py +++ /dev/null @@ -1,345 +0,0 @@ -# Vendored copy of distutils/version.py from CPython 3.9.5 -# -# Implements multiple version numbering conventions for the -# Python Module Distribution Utilities. -# -# Copyright (c) 2001-2022 Python Software Foundation. All rights reserved. -# PSF License (see LICENSES/PSF-2.0.txt or https://opensource.org/licenses/Python-2.0) -# SPDX-License-Identifier: PSF-2.0 -# - -"""Provides classes to represent module version numbers (one class for -each style of version numbering). There are currently two such classes -implemented: StrictVersion and LooseVersion. - -Every version number class implements the following interface: - * the 'parse' method takes a string and parses it to some internal - representation; if the string is an invalid version number, - 'parse' raises a ValueError exception - * the class constructor takes an optional string argument which, - if supplied, is passed to 'parse' - * __str__ reconstructs the string that was passed to 'parse' (or - an equivalent string -- ie. one that will generate an equivalent - version number instance) - * __repr__ generates Python code to recreate the version number instance - * _cmp compares the current instance with either another instance - of the same class or a string (which will be parsed to an instance - of the same class, thus must follow the same rules) -""" - -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import re - -try: - RE_FLAGS = re.VERBOSE | re.ASCII -except AttributeError: - RE_FLAGS = re.VERBOSE - - -class Version: - """Abstract base class for version numbering classes. Just provides - constructor (__init__) and reproducer (__repr__), because those - seem to be the same for all version numbering classes; and route - rich comparisons to _cmp. - """ - - def __init__(self, vstring=None): - if vstring: - self.parse(vstring) - - def __repr__(self): - return "%s ('%s')" % (self.__class__.__name__, str(self)) - - def __eq__(self, other): - c = self._cmp(other) - if c is NotImplemented: - return c - return c == 0 - - def __lt__(self, other): - c = self._cmp(other) - if c is NotImplemented: - return c - return c < 0 - - def __le__(self, other): - c = self._cmp(other) - if c is NotImplemented: - return c - return c <= 0 - - def __gt__(self, other): - c = self._cmp(other) - if c is NotImplemented: - return c - return c > 0 - - def __ge__(self, other): - c = self._cmp(other) - if c is NotImplemented: - return c - return c >= 0 - - -# Interface for version-number classes -- must be implemented -# by the following classes (the concrete ones -- Version should -# be treated as an abstract class). -# __init__ (string) - create and take same action as 'parse' -# (string parameter is optional) -# parse (string) - convert a string representation to whatever -# internal representation is appropriate for -# this style of version numbering -# __str__ (self) - convert back to a string; should be very similar -# (if not identical to) the string supplied to parse -# __repr__ (self) - generate Python code to recreate -# the instance -# _cmp (self, other) - compare two version numbers ('other' may -# be an unparsed version string, or another -# instance of your version class) - - -class StrictVersion(Version): - """Version numbering for anal retentives and software idealists. - Implements the standard interface for version number classes as - described above. A version number consists of two or three - dot-separated numeric components, with an optional "pre-release" tag - on the end. The pre-release tag consists of the letter 'a' or 'b' - followed by a number. If the numeric components of two version - numbers are equal, then one with a pre-release tag will always - be deemed earlier (lesser) than one without. - - The following are valid version numbers (shown in the order that - would be obtained by sorting according to the supplied cmp function): - - 0.4 0.4.0 (these two are equivalent) - 0.4.1 - 0.5a1 - 0.5b3 - 0.5 - 0.9.6 - 1.0 - 1.0.4a3 - 1.0.4b1 - 1.0.4 - - The following are examples of invalid version numbers: - - 1 - 2.7.2.2 - 1.3.a4 - 1.3pl1 - 1.3c4 - - The rationale for this version numbering system will be explained - in the distutils documentation. - """ - - version_re = re.compile(r'^(\d+) \. (\d+) (\. (\d+))? ([ab](\d+))?$', - RE_FLAGS) - - def parse(self, vstring): - match = self.version_re.match(vstring) - if not match: - raise ValueError("invalid version number '%s'" % vstring) - - (major, minor, patch, prerelease, prerelease_num) = \ - match.group(1, 2, 4, 5, 6) - - if patch: - self.version = tuple(map(int, [major, minor, patch])) - else: - self.version = tuple(map(int, [major, minor])) + (0,) - - if prerelease: - self.prerelease = (prerelease[0], int(prerelease_num)) - else: - self.prerelease = None - - def __str__(self): - if self.version[2] == 0: - vstring = '.'.join(map(str, self.version[0:2])) - else: - vstring = '.'.join(map(str, self.version)) - - if self.prerelease: - vstring = vstring + self.prerelease[0] + str(self.prerelease[1]) - - return vstring - - def _cmp(self, other): - if isinstance(other, str): - other = StrictVersion(other) - elif not isinstance(other, StrictVersion): - return NotImplemented - - if self.version != other.version: - # numeric versions don't match - # prerelease stuff doesn't matter - if self.version < other.version: - return -1 - else: - return 1 - - # have to compare prerelease - # case 1: neither has prerelease; they're equal - # case 2: self has prerelease, other doesn't; other is greater - # case 3: self doesn't have prerelease, other does: self is greater - # case 4: both have prerelease: must compare them! - - if (not self.prerelease and not other.prerelease): - return 0 - elif (self.prerelease and not other.prerelease): - return -1 - elif (not self.prerelease and other.prerelease): - return 1 - elif (self.prerelease and other.prerelease): - if self.prerelease == other.prerelease: - return 0 - elif self.prerelease < other.prerelease: - return -1 - else: - return 1 - else: - raise AssertionError("never get here") - -# end class StrictVersion - -# The rules according to Greg Stein: -# 1) a version number has 1 or more numbers separated by a period or by -# sequences of letters. If only periods, then these are compared -# left-to-right to determine an ordering. -# 2) sequences of letters are part of the tuple for comparison and are -# compared lexicographically -# 3) recognize the numeric components may have leading zeroes -# -# The LooseVersion class below implements these rules: a version number -# string is split up into a tuple of integer and string components, and -# comparison is a simple tuple comparison. This means that version -# numbers behave in a predictable and obvious way, but a way that might -# not necessarily be how people *want* version numbers to behave. There -# wouldn't be a problem if people could stick to purely numeric version -# numbers: just split on period and compare the numbers as tuples. -# However, people insist on putting letters into their version numbers; -# the most common purpose seems to be: -# - indicating a "pre-release" version -# ('alpha', 'beta', 'a', 'b', 'pre', 'p') -# - indicating a post-release patch ('p', 'pl', 'patch') -# but of course this can't cover all version number schemes, and there's -# no way to know what a programmer means without asking him. -# -# The problem is what to do with letters (and other non-numeric -# characters) in a version number. The current implementation does the -# obvious and predictable thing: keep them as strings and compare -# lexically within a tuple comparison. This has the desired effect if -# an appended letter sequence implies something "post-release": -# eg. "0.99" < "0.99pl14" < "1.0", and "5.001" < "5.001m" < "5.002". -# -# However, if letters in a version number imply a pre-release version, -# the "obvious" thing isn't correct. Eg. you would expect that -# "1.5.1" < "1.5.2a2" < "1.5.2", but under the tuple/lexical comparison -# implemented here, this just isn't so. -# -# Two possible solutions come to mind. The first is to tie the -# comparison algorithm to a particular set of semantic rules, as has -# been done in the StrictVersion class above. This works great as long -# as everyone can go along with bondage and discipline. Hopefully a -# (large) subset of Python module programmers will agree that the -# particular flavour of bondage and discipline provided by StrictVersion -# provides enough benefit to be worth using, and will submit their -# version numbering scheme to its domination. The free-thinking -# anarchists in the lot will never give in, though, and something needs -# to be done to accommodate them. -# -# Perhaps a "moderately strict" version class could be implemented that -# lets almost anything slide (syntactically), and makes some heuristic -# assumptions about non-digits in version number strings. This could -# sink into special-case-hell, though; if I was as talented and -# idiosyncratic as Larry Wall, I'd go ahead and implement a class that -# somehow knows that "1.2.1" < "1.2.2a2" < "1.2.2" < "1.2.2pl3", and is -# just as happy dealing with things like "2g6" and "1.13++". I don't -# think I'm smart enough to do it right though. -# -# In any case, I've coded the test suite for this module (see -# ../test/test_version.py) specifically to fail on things like comparing -# "1.2a2" and "1.2". That's not because the *code* is doing anything -# wrong, it's because the simple, obvious design doesn't match my -# complicated, hairy expectations for real-world version numbers. It -# would be a snap to fix the test suite to say, "Yep, LooseVersion does -# the Right Thing" (ie. the code matches the conception). But I'd rather -# have a conception that matches common notions about version numbers. - - -class LooseVersion(Version): - """Version numbering for anarchists and software realists. - Implements the standard interface for version number classes as - described above. A version number consists of a series of numbers, - separated by either periods or strings of letters. When comparing - version numbers, the numeric components will be compared - numerically, and the alphabetic components lexically. The following - are all valid version numbers, in no particular order: - - 1.5.1 - 1.5.2b2 - 161 - 3.10a - 8.02 - 3.4j - 1996.07.12 - 3.2.pl0 - 3.1.1.6 - 2g6 - 11g - 0.960923 - 2.2beta29 - 1.13++ - 5.5.kw - 2.0b1pl0 - - In fact, there is no such thing as an invalid version number under - this scheme; the rules for comparison are simple and predictable, - but may not always give the results you want (for some definition - of "want"). - """ - - component_re = re.compile(r'(\d+ | [a-z]+ | \.)', re.VERBOSE) - - def __init__(self, vstring=None): - if vstring: - self.parse(vstring) - - def parse(self, vstring): - # I've given up on thinking I can reconstruct the version string - # from the parsed tuple -- so I just store the string here for - # use by __str__ - self.vstring = vstring - components = [x for x in self.component_re.split(vstring) if x and x != '.'] - for i, obj in enumerate(components): - try: - components[i] = int(obj) - except ValueError: - pass - - self.version = components - - def __str__(self): - return self.vstring - - def __repr__(self): - return "LooseVersion ('%s')" % str(self) - - def _cmp(self, other): - if isinstance(other, str): - other = LooseVersion(other) - elif not isinstance(other, LooseVersion): - return NotImplemented - - if self.version == other.version: - return 0 - if self.version < other.version: - return -1 - if self.version > other.version: - return 1 - -# end class LooseVersion diff --git a/plugins/module_utils/version.py b/plugins/module_utils/version.py index dc01ffe..cc3028c 100644 --- a/plugins/module_utils/version.py +++ b/plugins/module_utils/version.py @@ -10,9 +10,4 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type -# Once we drop support for Ansible 2.9, ansible-base 2.10, and ansible-core 2.11, we can -# remove the _version.py file, and replace the following import by -# -# from ansible.module_utils.compat.version import LooseVersion - -from ._version import LooseVersion # noqa: F401, pylint: disable=unused-import +from ansible.module_utils.compat.version import LooseVersion # pylint: disable=unused-import diff --git a/plugins/modules/command.py b/plugins/modules/command.py index 52b916b..bf74d47 100644 --- a/plugins/modules/command.py +++ b/plugins/modules/command.py @@ -20,16 +20,14 @@ description: - The module always indicates a (changed) status. You can use R(the changed_when task property,override_the_changed_result) to determine whether a command task actually resulted in a change or not. -notes: - - The module declares that it B(supports check mode). This is a bug and will - be changed in community.routeros 3.0.0. extends_documentation_fragment: - community.routeros.attributes attributes: check_mode: - support: partial + support: none details: - - The module claims to support check mode, but it simply always executes the command. + - Before community.routeros 3.0.0, the module claimed to support check mode. + It simply executed the command in check mode. diff_mode: support: none platform: @@ -165,7 +163,7 @@ def main(): argument_spec.update(routeros_argument_spec) module = AnsibleModule(argument_spec=argument_spec, - supports_check_mode=True) + supports_check_mode=False) result = {'changed': False} diff --git a/tests/sanity/extra/update-docs.json b/tests/sanity/extra/update-docs.json index 029699f..3a63af8 100644 --- a/tests/sanity/extra/update-docs.json +++ b/tests/sanity/extra/update-docs.json @@ -4,5 +4,8 @@ "docs/docsite/rst/api-guide.rst", "plugins/modules/" ], - "output": "path-line-column-message" + "output": "path-line-column-message", + "requirements": [ + "ansible-core" + ] } diff --git a/tests/sanity/extra/update-docs.py b/tests/sanity/extra/update-docs.py index 68e2edf..6015512 100644 --- a/tests/sanity/extra/update-docs.py +++ b/tests/sanity/extra/update-docs.py @@ -12,7 +12,7 @@ import subprocess def main(): """Main entry point.""" - p = subprocess.run(['./update-docs.py'], check=False) + p = subprocess.run([sys.executable, 'update-docs.py'], check=False) if p.returncode not in (0, 1): print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode)) From 3af29683164a0acbd50c695161d85bf591c4e6d5 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 19 Oct 2024 12:31:31 +0200 Subject: [PATCH 02/96] Update links to stable-2. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index a773b72..9149046 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ Browsing the [**latest** collection documentation](https://docs.ansible.com/ansi Browsing the [**devel** collection documentation](https://docs.ansible.com/ansible/devel/collections/community/routeros) shows docs for the _latest version released on Galaxy_. -We also separately publish [**latest commit** collection documentation](https://ansible-collections.github.io/community.routeros/branch/main/) which shows docs for the _latest commit in the `main` branch_. +We also separately publish [**latest commit** collection documentation](https://ansible-collections.github.io/community.routeros/branch/stable-2/) which shows docs for the _latest commit in the `stable-2` branch_. If you use the Ansible package and do not update collections independently, use **latest**. If you install or update this collection directly from Galaxy, use **devel**. If you are looking to contribute, use **latest commit**. @@ -183,7 +183,7 @@ See [Ansible's dev guide](https://docs.ansible.com/ansible/devel/dev_guide/devel ## Release notes -See the [collection's changelog](https://github.com/ansible-collections/community.routeros/blob/main/CHANGELOG.md). +See the [collection's changelog](https://github.com/ansible-collections/community.routeros/blob/stable-2/CHANGELOG.md). ## Roadmap @@ -203,8 +203,8 @@ We plan to regularly release minor and patch versions, whenever new features are This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later. -See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.routeros/blob/main/COPYING) for the full text. +See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.routeros/blob/stable-2/COPYING) for the full text. -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). +Parts of the collection are licensed under the [BSD 2-Clause license](https://github.com/ansible-collections/community.routeros/blob/stable-2/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/). From 5fdbd52303a419b4033b26cebc6f8cfdcd50c763 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 19 Oct 2024 12:34:51 +0200 Subject: [PATCH 03/96] Fix reuse workflow branches. --- .github/workflows/reuse.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index 7c15c11..b552396 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -7,9 +7,13 @@ name: Verify REUSE on: push: - branches: [main] + branches: + - main + - stable-* pull_request: - branches: [main] + branches: + - main + - stable-* # Run CI once per day (at 05:15 UTC) schedule: - cron: '15 5 * * *' From b0453b2e4785403e27e33c0b992e39a82de87a90 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 19 Oct 2024 12:34:51 +0200 Subject: [PATCH 04/96] Fix reuse workflow branches. (cherry picked from commit 5fdbd52303a419b4033b26cebc6f8cfdcd50c763) --- .github/workflows/reuse.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index 7c15c11..b552396 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -7,9 +7,13 @@ name: Verify REUSE on: push: - branches: [main] + branches: + - main + - stable-* pull_request: - branches: [main] + branches: + - main + - stable-* # Run CI once per day (at 05:15 UTC) schedule: - cron: '15 5 * * *' From 5936c1ecefca748859d74c9ac3df0d2d03ef45e0 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 20 Oct 2024 10:38:22 +0200 Subject: [PATCH 05/96] Release 3.0.0. --- CHANGELOG.md | 154 +++++++++++++++++++-------------- CHANGELOG.rst | 18 ++++ changelogs/changelog.yaml | 14 +++ changelogs/fragments/3.0.0.yml | 7 -- 4 files changed, 120 insertions(+), 73 deletions(-) delete mode 100644 changelogs/fragments/3.0.0.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index d104e3f..55853f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,128 +2,150 @@ **Topics** -- v2\.20\.0 +- v3\.0\.0 - Release Summary + - Breaking Changes / Porting Guide + - Removed Features \(previously deprecated\) +- v2\.20\.0 + - 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 - 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 + - Release Summary - Minor Changes - Bugfixes - v2\.12\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.11\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.10\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.9\.0 - - Release Summary + - 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 + - Release Summary - Minor Changes - Bugfixes - v2\.7\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.6\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.5\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.4\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - Known Issues - v2\.3\.1 - - Release Summary + - Release Summary - Known Issues - v2\.3\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.2\.1 - - Release Summary + - Release Summary - Bugfixes - v2\.2\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - New Modules - v2\.1\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - New Modules - v2\.0\.0 - - Release Summary + - Release Summary - Minor Changes - - Breaking Changes / Porting Guide + - Breaking Changes / Porting Guide - Bugfixes - New Plugins - Filter - v1\.2\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v1\.1\.0 - - Release Summary + - Release Summary - Minor Changes - v1\.0\.1 - - Release Summary + - Release Summary - Bugfixes - v1\.0\.0 - - Release Summary + - Release Summary - Bugfixes - v0\.1\.1 - - Release Summary + - Release Summary - Bugfixes - v0\.1\.0 - - Release Summary + - Release Summary - Minor Changes + +## v3\.0\.0 + + +### Release Summary + +Major release that drops support for End of Life Python versions and fixes check mode for community\.routeros\.command\. + + +### Breaking Changes / Porting Guide + +* command \- the module no longer declares that it supports check mode \([https\://github\.com/ansible\-collections/community\.routeros/pull/318](https\://github\.com/ansible\-collections/community\.routeros/pull/318)\)\. + + +### Removed Features \(previously deprecated\) + +* The collection no longer supports Ansible 2\.9\, ansible\-base 2\.10\, ansible\-core 2\.11\, ansible\-core 2\.12\, ansible\-core 2\.13\, and ansible\-core 2\.14\. If you need to continue using End of Life versions of Ansible/ansible\-base/ansible\-core\, please use community\.routeros 2\.x\.y \([https\://github\.com/ansible\-collections/community\.routeros/pull/318](https\://github\.com/ansible\-collections/community\.routeros/pull/318)\)\. + ## v2\.20\.0 - + ### Release Summary Feature release\. @@ -139,7 +161,7 @@ Feature release\. ## v2\.19\.0 - + ### Release Summary Feature release\. @@ -156,7 +178,7 @@ Feature release\. ## v2\.18\.0 - + ### Release Summary Feature release\. @@ -185,7 +207,7 @@ Feature release\. ## v2\.17\.0 - + ### Release Summary Feature release\. @@ -200,7 +222,7 @@ Feature release\. ## v2\.16\.0 - + ### Release Summary Feature release\. @@ -214,7 +236,7 @@ Feature release\. ## v2\.15\.0 - + ### Release Summary Feature release\. @@ -236,7 +258,7 @@ Feature release\. ## v2\.14\.0 - + ### Release Summary Feature release\. @@ -251,7 +273,7 @@ Feature release\. ## v2\.13\.0 - + ### Release Summary Bugfix and feature release\. @@ -270,7 +292,7 @@ Bugfix and feature release\. ## v2\.12\.0 - + ### Release Summary Feature release\. @@ -289,7 +311,7 @@ Feature release\. ## v2\.11\.0 - + ### Release Summary Feature and bugfix release\. @@ -309,7 +331,7 @@ Feature and bugfix release\. ## v2\.10\.0 - + ### Release Summary Bugfix and feature release\. @@ -346,7 +368,7 @@ Bugfix and feature release\. ## v2\.9\.0 - + ### Release Summary Bugfix and feature release\. @@ -365,7 +387,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -386,7 +408,7 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - + ### Release Summary Bugfix release\. @@ -399,7 +421,7 @@ Bugfix release\. ## v2\.8\.1 - + ### Release Summary Bugfix release\. @@ -412,7 +434,7 @@ Bugfix release\. ## v2\.8\.0 - + ### Release Summary Bugfix and feature release\. @@ -437,7 +459,7 @@ Bugfix and feature release\. ## v2\.7\.0 - + ### Release Summary Bugfix and feature release\. @@ -455,7 +477,7 @@ Bugfix and feature release\. ## v2\.6\.0 - + ### Release Summary Regular bugfix and feature release\. @@ -475,7 +497,7 @@ Regular bugfix and feature release\. ## v2\.5\.0 - + ### Release Summary Feature and bugfix release\. @@ -493,7 +515,7 @@ Feature and bugfix release\. ## v2\.4\.0 - + ### Release Summary Feature release improving the api\* modules\. @@ -537,7 +559,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -550,7 +572,7 @@ Maintenance release with improved documentation\. ## v2\.3\.0 - + ### Release Summary Feature and bugfix release\. @@ -570,7 +592,7 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. @@ -584,7 +606,7 @@ Bugfix release\. ## v2\.2\.0 - + ### Release Summary New feature release\. @@ -608,7 +630,7 @@ New feature release\. ## v2\.1\.0 - + ### Release Summary Feature and bugfix release with new modules\. @@ -637,7 +659,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\. @@ -649,7 +671,7 @@ A new major release with breaking changes in the behavior of community\.ro * command \- the commands and wait\_for options now convert the list elements to strings \([https\://github\.com/ansible\-collections/community\.routeros/pull/55](https\://github\.com/ansible\-collections/community\.routeros/pull/55)\)\. * facts \- the gather\_subset option now converts the list elements to strings \([https\://github\.com/ansible\-collections/community\.routeros/pull/55](https\://github\.com/ansible\-collections/community\.routeros/pull/55)\)\. - + ### Breaking Changes / Porting Guide * api \- due to a programming error\, the module never failed on errors\. This has now been fixed\. If you are relying on the module not failing in case of idempotent commands \(resulting in errors like failure\: already have such address\)\, you need to adjust your roles/playbooks\. We suggest to use failed\_when to accept failure in specific circumstances\, for example failed\_when\: \"\'failure\: already have \' in result\.msg\[0\]\" \([https\://github\.com/ansible\-collections/community\.routeros/pull/39](https\://github\.com/ansible\-collections/community\.routeros/pull/39)\)\. @@ -678,7 +700,7 @@ A new major release with breaking changes in the behavior of community\.ro ## v1\.2\.0 - + ### Release Summary Bugfix and feature release\. @@ -699,7 +721,7 @@ Bugfix and feature release\. ## v1\.1\.0 - + ### Release Summary This release allow dashes in usernames for SSH\-based modules\. @@ -713,7 +735,7 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. @@ -726,7 +748,7 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. @@ -739,7 +761,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\. @@ -752,7 +774,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 108831a..4b511c3 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,24 @@ Community RouterOS Release Notes .. contents:: Topics +v3.0.0 +====== + +Release Summary +--------------- + +Major release that drops support for End of Life Python versions and fixes check mode for community.routeros.command. + +Breaking Changes / Porting Guide +-------------------------------- + +- command - the module no longer declares that it supports check mode (https://github.com/ansible-collections/community.routeros/pull/318). + +Removed Features (previously deprecated) +---------------------------------------- + +- The collection no longer supports Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, and ansible-core 2.14. If you need to continue using End of Life versions of Ansible/ansible-base/ansible-core, please use community.routeros 2.x.y (https://github.com/ansible-collections/community.routeros/pull/318). + v2.20.0 ======= diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 7185a2c..09b5b6d 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -795,3 +795,17 @@ releases: - 322-add-l2tp-client-interface-configuration.yml - 323-add-ros-7.16-parameters.yml release_date: '2024-10-17' + 3.0.0: + changes: + breaking_changes: + - command - the module no longer declares that it supports check mode (https://github.com/ansible-collections/community.routeros/pull/318). + release_summary: Major release that drops support for End of Life Python versions + and fixes check mode for community.routeros.command. + removed_features: + - The collection no longer supports Ansible 2.9, ansible-base 2.10, ansible-core + 2.11, ansible-core 2.12, ansible-core 2.13, and ansible-core 2.14. If you + need to continue using End of Life versions of Ansible/ansible-base/ansible-core, + please use community.routeros 2.x.y (https://github.com/ansible-collections/community.routeros/pull/318). + fragments: + - 3.0.0.yml + release_date: '2024-10-20' diff --git a/changelogs/fragments/3.0.0.yml b/changelogs/fragments/3.0.0.yml deleted file mode 100644 index 4a71c2f..0000000 --- a/changelogs/fragments/3.0.0.yml +++ /dev/null @@ -1,7 +0,0 @@ -release_summary: Major release that drops support for End of Life Python versions and fixes check mode for community.routeros.command. -removed_features: - - "The collection no longer supports Ansible 2.9, ansible-base 2.10, ansible-core 2.11, ansible-core 2.12, ansible-core 2.13, and ansible-core 2.14. - If you need to continue using End of Life versions of Ansible/ansible-base/ansible-core, please use community.routeros 2.x.y - (https://github.com/ansible-collections/community.routeros/pull/318)." -breaking_changes: - - "command - the module no longer declares that it supports check mode (https://github.com/ansible-collections/community.routeros/pull/318)." From d44262d820f9966f3f3e4608b6f6a07f403c5cf2 Mon Sep 17 00:00:00 2001 From: gardar Date: Mon, 4 Nov 2024 18:05:52 +0000 Subject: [PATCH 06/96] fix: add missing fields to `ip pool` path (#327) * fix: add missing fields to `ip pool` path Signed-off-by: gardar * fix: remove unneeded copy-from Signed-off-by: gardar --------- Signed-off-by: gardar --- changelogs/fragments/327-add-missing-ip-pool-fields.yml | 3 +++ plugins/module_utils/_api_data.py | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/327-add-missing-ip-pool-fields.yml diff --git a/changelogs/fragments/327-add-missing-ip-pool-fields.yml b/changelogs/fragments/327-add-missing-ip-pool-fields.yml new file mode 100644 index 0000000..54ee54d --- /dev/null +++ b/changelogs/fragments/327-add-missing-ip-pool-fields.yml @@ -0,0 +1,3 @@ +--- +bugfixes: + - api_info, api_modify - add missing fields ``comment``, ``next-pool`` to ``ip pool`` path (https://github.com/ansible-collections/community.routeros/pull/327). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 847f5b1..929aa19 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -708,7 +708,9 @@ PATHS = { fully_understood=True, primary_keys=('name', ), fields={ + 'comment': KeyInfo(), 'name': KeyInfo(), + 'next-pool': KeyInfo(), 'ranges': KeyInfo(), }, ), From 14d89a3cfa8d064e6d3f019c33f36db1b9bd5f36 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Nov 2024 06:41:47 +0100 Subject: [PATCH 07/96] Bump fsfe/reuse-action from 4 to 5 (#328) Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 4 to 5. - [Release notes](https://github.com/fsfe/reuse-action/releases) - [Commits](https://github.com/fsfe/reuse-action/compare/v4...v5) --- updated-dependencies: - dependency-name: fsfe/reuse-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/reuse.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/reuse.yml b/.github/workflows/reuse.yml index b552396..f6d5215 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/reuse.yml @@ -28,4 +28,4 @@ jobs: - uses: actions/checkout@v4 - name: REUSE Compliance Check - uses: fsfe/reuse-action@v4 + uses: fsfe/reuse-action@v5 From 249b1a92e2c2cdc1cd8786d9972aa58290723067 Mon Sep 17 00:00:00 2001 From: liquorice-head <40302350+liquorice-head@users.noreply.github.com> Date: Sat, 23 Nov 2024 03:19:05 +0400 Subject: [PATCH 08/96] Update _api_data.py (#324) * Update _api_data.py * Create 324-fix-firewall-log-and-log-prefix.yaml * Update changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml Co-authored-by: Felix Fontein * Update test_api_info.py * fix tests --------- Co-authored-by: Felix Fontein Co-authored-by: alsmirnov --- .../324-fix-firewall-log-and-log-prefix.yaml | 2 ++ plugins/module_utils/_api_data.py | 16 ++++++++-------- .../plugins/modules/test_api_find_and_modify.py | 14 ++++++++++++++ 3 files changed, 24 insertions(+), 8 deletions(-) create mode 100644 changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml diff --git a/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml b/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml new file mode 100644 index 0000000..3c56470 --- /dev/null +++ b/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml @@ -0,0 +1,2 @@ +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). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 929aa19..bf0d335 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2986,8 +2986,8 @@ PATHS = { 'jump-target': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True), - 'log': KeyInfo(can_disable=True), - 'log-prefix': KeyInfo(can_disable=True), + 'log': KeyInfo(default=False), + 'log-prefix': KeyInfo(default=''), 'nth': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True), @@ -3057,8 +3057,8 @@ PATHS = { 'jump-target': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True), - 'log': KeyInfo(can_disable=True), - 'log-prefix': KeyInfo(can_disable=True), + 'log': KeyInfo(default=False), + 'log-prefix': KeyInfo(default=''), 'new-connection-mark': KeyInfo(can_disable=True), 'new-dscp': KeyInfo(can_disable=True), 'new-mss': KeyInfo(can_disable=True), @@ -3137,8 +3137,8 @@ PATHS = { 'jump-target': KeyInfo(can_disable=True), 'layer7-protocol': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True), - 'log': KeyInfo(can_disable=True), - 'log-prefix': KeyInfo(can_disable=True), + 'log': KeyInfo(default=False), + 'log-prefix': KeyInfo(default=''), 'nth': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True), @@ -3200,8 +3200,8 @@ PATHS = { 'ipv4-options': KeyInfo(can_disable=True), 'jump-target': KeyInfo(can_disable=True), 'limit': KeyInfo(can_disable=True), - 'log': KeyInfo(can_disable=True), - 'log-prefix': KeyInfo(can_disable=True), + 'log': KeyInfo(default=False), + 'log-prefix': KeyInfo(default=''), 'nth': KeyInfo(can_disable=True), 'out-bridge-port': KeyInfo(can_disable=True), 'out-bridge-port-list': KeyInfo(can_disable=True), 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 2f47af4..e6eb00b 100644 --- a/tests/unit/plugins/modules/test_api_find_and_modify.py +++ b/tests/unit/plugins/modules/test_api_find_and_modify.py @@ -620,6 +620,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'defconf', 'protocol': 'icmp', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*3', @@ -627,6 +629,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'chain': 'input', 'comment': 'defconf', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*4', @@ -634,6 +638,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'chain': 'input', 'comment': 'defconf', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*7', @@ -642,6 +648,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'defconf', 'disabled': False, 'in-interface': 'wan', + 'log': False, + 'log-prefix': '', }, { '.id': '*8', @@ -650,6 +658,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'defconf', 'connection-state': 'established', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*9', @@ -658,6 +668,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'defconf', 'connection-state': 'related', 'disabled': False, + 'log': False, + 'log-prefix': '', }, { '.id': '*A', @@ -666,6 +678,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'defconf', 'connection-status': 'invalid', 'disabled': False, + 'log': False, + 'log-prefix': '', }, ]) self.assertEqual(result['match_count'], 3) From c27c1906aa90295316b77d1f239ab4142e709571 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 2 Dec 2024 20:38:57 +0100 Subject: [PATCH 09/96] Re-classify change as feature. --- changelogs/fragments/327-add-missing-ip-pool-fields.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/327-add-missing-ip-pool-fields.yml b/changelogs/fragments/327-add-missing-ip-pool-fields.yml index 54ee54d..e7e05b7 100644 --- a/changelogs/fragments/327-add-missing-ip-pool-fields.yml +++ b/changelogs/fragments/327-add-missing-ip-pool-fields.yml @@ -1,3 +1,3 @@ --- -bugfixes: +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). From 8dbad9a8d4a82ca9331b8867fb2987fbf18840cd Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 2 Dec 2024 20:39:15 +0100 Subject: [PATCH 10/96] Prepare 3.1.0. --- changelogs/fragments/3.1.0.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelogs/fragments/3.1.0.yml diff --git a/changelogs/fragments/3.1.0.yml b/changelogs/fragments/3.1.0.yml new file mode 100644 index 0000000..56de6d9 --- /dev/null +++ b/changelogs/fragments/3.1.0.yml @@ -0,0 +1 @@ +release_summary: Bugfix and feature release. From c3e57efa9d9ef6c75f57c9bc8dda463b7f2fbdac Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 2 Dec 2024 20:44:15 +0100 Subject: [PATCH 11/96] Forgot to bump version. --- galaxy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/galaxy.yml b/galaxy.yml index 1508467..e59c543 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.0.0 +version: 3.1.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From 0bf4b3ef8cb570de634092da8323d4ebd40a7d7b Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 2 Dec 2024 20:45:03 +0100 Subject: [PATCH 12/96] Release 3.1.0. --- CHANGELOG.md | 352 ++++++++++-------- CHANGELOG.rst | 18 + changelogs/changelog.yaml | 15 + changelogs/fragments/3.1.0.yml | 1 - .../324-fix-firewall-log-and-log-prefix.yaml | 2 - .../327-add-missing-ip-pool-fields.yml | 3 - 6 files changed, 220 insertions(+), 171 deletions(-) delete mode 100644 changelogs/fragments/3.1.0.yml delete mode 100644 changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml delete mode 100644 changelogs/fragments/327-add-missing-ip-pool-fields.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 55853f0..135eb61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,132 +2,154 @@ **Topics** -- v3\.0\.0 +- v3\.1\.0 - Release Summary + - Minor Changes + - Bugfixes +- v3\.0\.0 + - 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 - - Deprecated Features - - Bugfixes -- v2\.17\.0 +- v2\.18\.0 - Release Summary - Minor Changes -- v2\.16\.0 + - Deprecated Features + - Bugfixes +- v2\.17\.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\.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 - Bugfixes -- v2\.6\.0 +- v2\.7\.0 - Release Summary - Minor Changes - Bugfixes -- v2\.5\.0 +- v2\.6\.0 - Release Summary - Minor Changes - Bugfixes -- v2\.4\.0 +- v2\.5\.0 - Release Summary - Minor Changes - Bugfixes - - Known Issues -- v2\.3\.1 +- v2\.4\.0 - Release Summary - - Known Issues -- v2\.3\.0 - - Release Summary - Minor Changes - Bugfixes -- v2\.2\.1 + - Known Issues +- v2\.3\.1 + - Release Summary + - Known Issues +- v2\.3\.0 - Release Summary - - Bugfixes -- v2\.2\.0 - - Release Summary - Minor Changes + - Bugfixes +- v2\.2\.1 + - Release Summary - Bugfixes - - New Modules -- v2\.1\.0 +- v2\.2\.0 - Release Summary - Minor Changes - Bugfixes - - New Modules -- v2\.0\.0 + - New Modules +- v2\.1\.0 - Release Summary - Minor Changes - - Breaking Changes / Porting Guide - Bugfixes + - New Modules +- v2\.0\.0 + - 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 - - Release Summary - Bugfixes -- v1\.0\.0 +- v1\.1\.0 + - Release Summary + - Minor Changes +- v1\.0\.1 - Release Summary - Bugfixes -- v0\.1\.1 +- v1\.0\.0 - Release Summary - Bugfixes -- v0\.1\.0 +- v0\.1\.1 - Release Summary - - Minor Changes + - Bugfixes +- v0\.1\.0 + - Release Summary + - Minor Changes + + +## 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)\)\. + + +### 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)\)\. ## v3\.0\.0 - + ### Release Summary Major release that drops support for End of Life Python versions and fixes check mode for community\.routeros\.command\. @@ -145,12 +167,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)\)\. @@ -161,12 +183,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)\)\. @@ -178,12 +200,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)\)\. @@ -199,7 +221,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)\)\. @@ -207,21 +229,6 @@ 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)\)\. -* api\_info\, api\_modify \- add missing path /system resource irq rps \([https\://github\.com/ansible\-collections/community\.routeros/pull/295](https\://github\.com/ansible\-collections/community\.routeros/pull/295)\)\. -* api\_info\, api\_modify \- add parameter host\-key\-type for ip ssh path \([https\://github\.com/ansible\-collections/community\.routeros/issues/280](https\://github\.com/ansible\-collections/community\.routeros/issues/280)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/297](https\://github\.com/ansible\-collections/community\.routeros/pull/297)\)\. - - -## v2\.16\.0 - ### Release Summary @@ -230,11 +237,12 @@ 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)\)\. -* api\_info\, api\_modify \- minor changes /interface ethernet path fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/288](https\://github\.com/ansible\-collections/community\.routeros/pull/288)\)\. +* 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)\)\. +* api\_info\, api\_modify \- add missing path /system resource irq rps \([https\://github\.com/ansible\-collections/community\.routeros/pull/295](https\://github\.com/ansible\-collections/community\.routeros/pull/295)\)\. +* api\_info\, api\_modify \- add parameter host\-key\-type for ip ssh path \([https\://github\.com/ansible\-collections/community\.routeros/issues/280](https\://github\.com/ansible\-collections/community\.routeros/issues/280)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/297](https\://github\.com/ansible\-collections/community\.routeros/pull/297)\)\. - -## v2\.15\.0 + +## v2\.16\.0 ### Release Summary @@ -244,6 +252,20 @@ 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)\)\. +* api\_info\, api\_modify \- minor changes /interface ethernet path fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/288](https\://github\.com/ansible\-collections/community\.routeros/pull/288)\)\. + + +## 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)\)\. * api\_info\, api\_modify \- add /ip route rule path for RouterOS 6\.x \([https\://github\.com/ansible\-collections/community\.routeros/pull/278](https\://github\.com/ansible\-collections/community\.routeros/pull/278)\)\. * api\_info\, api\_modify \- add /routing filter path for RouterOS 6\.x \([https\://github\.com/ansible\-collections/community\.routeros/pull/279](https\://github\.com/ansible\-collections/community\.routeros/pull/279)\)\. @@ -258,12 +280,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)\)\. @@ -273,18 +295,18 @@ 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)\)\. * 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)\)\. @@ -292,12 +314,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)\)\. @@ -311,12 +333,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)\) @@ -331,12 +353,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)\)\. @@ -360,7 +382,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)\)\. @@ -368,18 +390,18 @@ 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)\)\. * 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)\)\. @@ -387,7 +409,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -408,19 +430,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 @@ -429,35 +438,23 @@ 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)\)\. +* 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\.0 + +## v2\.8\.1 ### 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)\)\. -* api\_modify \- add support for API path snmp community \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. -* api\_modify \- add support for trap\-interfaces in API path snmp \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. -* api\_modify \- add support to disable IPv6 in API paths ipv6 settings \([https\://github\.com/ansible\-collections/community\.routeros/pull/158](https\://github\.com/ansible\-collections/community\.routeros/pull/158)\)\. -* 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)\)\. +Bugfix release\. ### 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)\)\. -* api\_modify \- fix handling of disabled keys on creation \([https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\. -* various plugins and modules \- remove unnecessary imports \([https\://github\.com/ansible\-collections/community\.routeros/pull/149](https\://github\.com/ansible\-collections/community\.routeros/pull/149)\)\. +* 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\.7\.0 + +## v2\.8\.0 ### Release Summary @@ -467,28 +464,53 @@ 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)\)\. +* 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)\)\. +* api\_modify \- add support for API path snmp community \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. +* api\_modify \- add support for trap\-interfaces in API path snmp \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. +* api\_modify \- add support to disable IPv6 in API paths ipv6 settings \([https\://github\.com/ansible\-collections/community\.routeros/pull/158](https\://github\.com/ansible\-collections/community\.routeros/pull/158)\)\. +* 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)\)\. +* api\_modify \- fix handling of disabled keys on creation \([https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\. +* various plugins and modules \- remove unnecessary imports \([https\://github\.com/ansible\-collections/community\.routeros/pull/149](https\://github\.com/ansible\-collections/community\.routeros/pull/149)\)\. + + +## 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)\)\. + + +### 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)\)\. ## 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)\)\. * 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)\)\. @@ -497,17 +519,17 @@ 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)\)\. - + ### 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)\)\. @@ -515,12 +537,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)\)\. @@ -541,7 +563,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)\)\. @@ -559,7 +581,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -572,19 +594,19 @@ 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)\)\. * 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)\)\. @@ -592,12 +614,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)\)\. @@ -606,17 +628,17 @@ 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)\)\. - + ### 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)\)\. @@ -630,12 +652,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)\)\. @@ -644,7 +666,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)\)\. @@ -659,12 +681,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)\)\. @@ -678,7 +700,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)\)\. @@ -700,12 +722,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)\)\. @@ -713,7 +735,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)\)\. @@ -721,12 +743,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)\)\. @@ -735,12 +757,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)\)\. @@ -748,12 +770,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)\)\. @@ -761,12 +783,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)\)\. @@ -774,12 +796,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 4b511c3..fdfeca0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,24 @@ Community RouterOS Release Notes .. contents:: Topics +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). + +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). + v3.0.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 09b5b6d..8522a87 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -809,3 +809,18 @@ releases: fragments: - 3.0.0.yml release_date: '2024-10-20' + 3.1.0: + changes: + 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). + 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). + release_summary: Bugfix and feature release. + fragments: + - 3.1.0.yml + - 324-fix-firewall-log-and-log-prefix.yaml + - 327-add-missing-ip-pool-fields.yml + release_date: '2024-12-02' diff --git a/changelogs/fragments/3.1.0.yml b/changelogs/fragments/3.1.0.yml deleted file mode 100644 index 56de6d9..0000000 --- a/changelogs/fragments/3.1.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Bugfix and feature release. diff --git a/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml b/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml deleted file mode 100644 index 3c56470..0000000 --- a/changelogs/fragments/324-fix-firewall-log-and-log-prefix.yaml +++ /dev/null @@ -1,2 +0,0 @@ -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). diff --git a/changelogs/fragments/327-add-missing-ip-pool-fields.yml b/changelogs/fragments/327-add-missing-ip-pool-fields.yml deleted file mode 100644 index e7e05b7..0000000 --- a/changelogs/fragments/327-add-missing-ip-pool-fields.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -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). From a7340eae1a26ae269655c8ac0c75ec05e7760ae9 Mon Sep 17 00:00:00 2001 From: Serhiy Date: Sat, 14 Dec 2024 15:20:58 +0200 Subject: [PATCH 13/96] community-list for /routing/filter (#331) * Update _api_data.py added ('routing', 'filter', 'community-list') * Update api_info.py added routing filter community-list * Update api_modify.py added routing filter community-list * Create 331-add-routing-filter-community-list.yml * Update api_info.py * Update api_modify.py --- .../331-add-routing-filter-community-list.yml | 2 ++ plugins/module_utils/_api_data.py | 14 ++++++++++++++ plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + 4 files changed, 18 insertions(+) create mode 100644 changelogs/fragments/331-add-routing-filter-community-list.yml diff --git a/changelogs/fragments/331-add-routing-filter-community-list.yml b/changelogs/fragments/331-add-routing-filter-community-list.yml new file mode 100644 index 0000000..e4cb0ba --- /dev/null +++ b/changelogs/fragments/331-add-routing-filter-community-list.yml @@ -0,0 +1,2 @@ +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). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index bf0d335..cb9ff98 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -895,6 +895,20 @@ PATHS = { )), ], ), + ('routing', 'filter', 'community-list'): APIData( + versioned=[ + ('7', '>=', VersionedAPIData( + fully_understood=True, + fields={ + 'list': KeyInfo(required=True), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(can_disable=True), + 'communities': KeyInfo(can_disable=True), + 'regexp': KeyInfo(can_disable=True), + }, + )), + ], + ), ('routing', 'ospf', 'instance'): APIData( unversioned=VersionedAPIData( fully_understood=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 829fc17..5b34463 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -205,6 +205,7 @@ options: - routing bgp peer - routing bgp template - routing filter + - routing filter community-list - routing filter num-list - routing filter rule - routing filter select-rule diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 4975dc4..9ab34d9 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -214,6 +214,7 @@ options: - routing bgp peer - routing bgp template - routing filter + - routing filter community-list - routing filter num-list - routing filter rule - routing filter select-rule From 995ab18e7bf30886030394cbabeed07bde785333 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 14 Dec 2024 14:56:14 +0100 Subject: [PATCH 14/96] Fix some issues pointed out by zizmor. (#333) --- .github/workflows/ee.yml | 3 ++- .github/workflows/extra-tests.yml | 1 + .github/workflows/reuse.yml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml index 9d6f3fd..b04d197 100644 --- a/.github/workflows/ee.yml +++ b/.github/workflows/ee.yml @@ -63,6 +63,7 @@ jobs: 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 @@ -96,7 +97,7 @@ jobs: - name: Create files for building execution environment run: | - COLLECTION_FILENAME="$(ls "${{ env.NAMESPACE }}-${{ env.COLLECTION_NAME }}"-*.tar.gz)" + COLLECTION_FILENAME="$(ls "${NAMESPACE}-${COLLECTION_NAME}"-*.tar.gz)" # EE config cat > execution-environment.yml < Date: Sat, 14 Dec 2024 15:17:24 +0100 Subject: [PATCH 15/96] Fix some issues pointed out by zizmor. (#333) (#334) (cherry picked from commit 995ab18e7bf30886030394cbabeed07bde785333) Co-authored-by: Felix Fontein --- .github/workflows/ee.yml | 3 ++- .github/workflows/extra-tests.yml | 1 + .github/workflows/reuse.yml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ee.yml b/.github/workflows/ee.yml index cd6341f..32c0c50 100644 --- a/.github/workflows/ee.yml +++ b/.github/workflows/ee.yml @@ -68,6 +68,7 @@ jobs: 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 @@ -101,7 +102,7 @@ jobs: - name: Create files for building execution environment run: | - COLLECTION_FILENAME="$(ls "${{ env.NAMESPACE }}-${{ env.COLLECTION_NAME }}"-*.tar.gz)" + COLLECTION_FILENAME="$(ls "${NAMESPACE}-${COLLECTION_NAME}"-*.tar.gz)" # EE config cat > execution-environment.yml < Date: Sat, 28 Dec 2024 14:27:15 +0100 Subject: [PATCH 16/96] Improve language. --- plugins/module_utils/_api_data.py | 2 +- plugins/module_utils/api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index cb9ff98..25dd4cb 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -5158,7 +5158,7 @@ PATHS = { 'protocol': KeyInfo(default='all'), 'src-address': KeyInfo(), 'src-port': KeyInfo(default='any'), - # The template field can't really be changed once the item is + # The template field ca not really be changed once the item is # created. This config captures the behavior best as it can # i.e. template=yes is shown, template=no is hidden. 'template': KeyInfo(can_disable=True, remove_value=False), diff --git a/plugins/module_utils/api.py b/plugins/module_utils/api.py index 6c276d7..aa3aa2e 100644 --- a/plugins/module_utils/api.py +++ b/plugins/module_utils/api.py @@ -77,7 +77,7 @@ def _ros_api_connect(module, username, password, host, port, use_tls, force_no_c elif not validate_cert_hostname: ctx.check_hostname = False else: - # Since librouteros doesn't pass server_hostname, + # Since librouteros does not pass server_hostname, # we have to do this ourselves: def wrap_context(*args, **kwargs): kwargs.pop('server_hostname', None) From 8eab87714036a02e3bb0bd19a1dbcfeab444b461 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 28 Dec 2024 14:27:15 +0100 Subject: [PATCH 17/96] Improve language. (cherry picked from commit 77de6d90bf22582d3ac194a0681e9fc1f40a6314) --- plugins/module_utils/_api_data.py | 2 +- plugins/module_utils/api.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 847f5b1..e4a5182 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -5142,7 +5142,7 @@ PATHS = { 'protocol': KeyInfo(default='all'), 'src-address': KeyInfo(), 'src-port': KeyInfo(default='any'), - # The template field can't really be changed once the item is + # The template field ca not really be changed once the item is # created. This config captures the behavior best as it can # i.e. template=yes is shown, template=no is hidden. 'template': KeyInfo(can_disable=True, remove_value=False), diff --git a/plugins/module_utils/api.py b/plugins/module_utils/api.py index 6c276d7..aa3aa2e 100644 --- a/plugins/module_utils/api.py +++ b/plugins/module_utils/api.py @@ -77,7 +77,7 @@ def _ros_api_connect(module, username, password, host, port, use_tls, force_no_c elif not validate_cert_hostname: ctx.check_hostname = False else: - # Since librouteros doesn't pass server_hostname, + # Since librouteros does not pass server_hostname, # we have to do this ourselves: def wrap_context(*args, **kwargs): kwargs.pop('server_hostname', None) From 539119c57da13a18f4968734dbf94fa0136bf672 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 28 Dec 2024 15:34:20 +0100 Subject: [PATCH 18/96] Reformat documentation with 'andebox yaml-doc' (#335) * Reformat documentation with 'andebox yaml-doc'. * Revert unwanted changes. --- plugins/cliconf/routeros.py | 9 +- plugins/doc_fragments/api.py | 39 +- plugins/doc_fragments/attributes.py | 62 +-- plugins/modules/api.py | 63 +-- plugins/modules/api_facts.py | 35 +- plugins/modules/api_find_and_modify.py | 111 +++-- plugins/modules/api_info.py | 493 +++++++++++----------- plugins/modules/api_modify.py | 557 ++++++++++++------------- plugins/modules/command.py | 71 ++-- plugins/modules/facts.py | 33 +- update-docs.py | 2 +- 11 files changed, 717 insertions(+), 758 deletions(-) diff --git a/plugins/cliconf/routeros.py b/plugins/cliconf/routeros.py index 412627b..1c3288f 100644 --- a/plugins/cliconf/routeros.py +++ b/plugins/cliconf/routeros.py @@ -5,15 +5,14 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" author: "Egor Zaitsev (@heuels)" name: routeros short_description: Use routeros cliconf to run command on MikroTik RouterOS platform description: - - This routeros plugin provides low level abstraction apis for - sending and receiving CLI commands from MikroTik RouterOS network devices. -''' + - This routeros plugin provides low level abstraction apis for sending and receiving CLI commands from MikroTik RouterOS + network devices. +""" import re import json diff --git a/plugins/doc_fragments/api.py b/plugins/doc_fragments/api.py index b0ad979..edef5f0 100644 --- a/plugins/doc_fragments/api.py +++ b/plugins/doc_fragments/api.py @@ -10,7 +10,7 @@ __metaclass__ = type class ModuleDocFragment(object): - DOCUMENTATION = r''' + DOCUMENTATION = r""" options: hostname: description: @@ -50,10 +50,9 @@ options: description: - Set to V(true) to connect without a certificate when O(tls=true). - See also O(validate_certs). - - B(Note:) this forces the use of anonymous Diffie-Hellman (ADH) ciphers. The protocol is susceptible - to Man-in-the-Middle attacks, because the keys used in the exchange are not authenticated. - Instead of simply connecting without a certificate to "make things work" have a look at - O(validate_certs) and O(ca_path). + - B(Note:) this forces the use of anonymous Diffie-Hellman (ADH) ciphers. The protocol is susceptible to Man-in-the-Middle + attacks, because the keys used in the exchange are not authenticated. Instead of simply connecting without a certificate + to "make things work" have a look at O(validate_certs) and O(ca_path). type: bool default: false version_added: 2.4.0 @@ -61,10 +60,9 @@ options: description: - Set to V(false) to skip validation of TLS certificates. - See also O(validate_cert_hostname). Only used when O(tls=true). - - B(Note:) instead of simply deactivating certificate validations to "make things work", - please consider creating your own CA certificate and using it to sign certificates used - for your router. You can tell the module about your CA certificate with the O(ca_path) - option. + - B(Note:) instead of simply deactivating certificate validations to "make things work", please consider creating your + own CA certificate and using it to sign certificates used for your router. You can tell the module about your CA certificate + with the O(ca_path) option. type: bool default: true version_added: 1.2.0 @@ -93,10 +91,10 @@ requirements: - Python >= 3.6 (for librouteros) seealso: - ref: ansible_collections.community.routeros.docsite.api-guide - description: How to connect to RouterOS devices with the RouterOS API -''' + description: How to connect to RouterOS devices with the RouterOS API. +""" - RESTRICT = r''' + RESTRICT = r""" options: restrict: type: list @@ -115,24 +113,21 @@ options: values: description: - The values of the field to limit to. - - >- - Note that the types of the values are important. If you provide a string V("0"), - and librouteros converts the value returned by the API to the integer V(0), - then this will not match. If you are not sure, better include both variants: - both the string and the integer. + - 'Note that the types of the values are important. If you provide a string V("0"), and librouteros converts the + value returned by the API to the integer V(0), then this will not match. If you are not sure, better include both + variants: both the string and the integer.' type: list elements: raw regex: description: - A regular expression matching values of the field to limit to. - Note that all values will be converted to strings before matching. - - It is not possible to match disabled values with regular expressions. - Set O(restrict[].match_disabled=true) if you also want to match disabled values. + - It is not possible to match disabled values with regular expressions. Set O(restrict[].match_disabled=true) if + you also want to match disabled values. type: str invert: description: - - Invert the condition. This affects O(restrict[].match_disabled), O(restrict[].values), - and O(restrict[].regex). + - Invert the condition. This affects O(restrict[].match_disabled), O(restrict[].values), and O(restrict[].regex). type: bool default: false -''' +""" diff --git a/plugins/doc_fragments/attributes.py b/plugins/doc_fragments/attributes.py index e18a48f..8c5c145 100644 --- a/plugins/doc_fragments/attributes.py +++ b/plugins/doc_fragments/attributes.py @@ -11,17 +11,17 @@ __metaclass__ = type class ModuleDocFragment(object): # Standard documentation fragment - DOCUMENTATION = r''' + DOCUMENTATION = r""" options: {} attributes: - check_mode: - description: Can run in C(check_mode) and return changed status prediction without modifying target. - diff_mode: - description: Will return details on what has changed (or possibly needs changing in C(check_mode)), when in diff mode. - platform: - description: Target OS/families that can be operated against. - support: N/A -''' + check_mode: + description: Can run in C(check_mode) and return changed status prediction without modifying target. + diff_mode: + description: Will return details on what has changed (or possibly needs changing in C(check_mode)), when in diff mode. + platform: + description: Target OS/families that can be operated against. + support: N/A +""" # Should be used together with the standard fragment INFO_MODULE = r''' @@ -47,23 +47,23 @@ attributes: - community.routeros.api ''' - CONN = r''' + CONN = r""" options: {} attributes: - become: - description: Is usable alongside C(become) keywords. - connection: - description: Uses the target's configured connection information to execute code on it. - delegation: - description: Can be used in conjunction with C(delegate_to) and related keywords. -''' + become: + description: Is usable alongside C(become) keywords. + connection: + description: Uses the target's configured connection information to execute code on it. + delegation: + description: Can be used in conjunction with C(delegate_to) and related keywords. +""" - FACTS = r''' + FACTS = r""" options: {} attributes: - facts: - description: Action returns an C(ansible_facts) dictionary that will update existing host facts. -''' + facts: + description: Action returns an C(ansible_facts) dictionary that will update existing host facts. +""" # Should be used together with the standard fragment and the FACTS fragment FACTS_MODULE = r''' @@ -81,18 +81,18 @@ attributes: support: full ''' - FILES = r''' + FILES = r""" options: {} attributes: - safe_file_operations: - description: Uses Ansible's strict file operation functions to ensure proper permissions and avoid data corruption. -''' + safe_file_operations: + description: Uses Ansible's strict file operation functions to ensure proper permissions and avoid data corruption. +""" - FLOW = r''' + FLOW = r""" options: {} attributes: - action: - description: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller. - async: - description: Supports being used with the C(async) keyword. -''' + action: + description: Indicates this has a corresponding action plugin so some parts of the options can be executed on the controller. + async: + description: Supports being used with the C(async) keyword. +""" diff --git a/plugins/modules/api.py b/plugins/modules/api.py index 4857a3c..ecd99e0 100644 --- a/plugins/modules/api.py +++ b/plugins/modules/api.py @@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: api author: "Nikolay Dachev (@NikolayDachev)" short_description: Ansible module for RouterOS API @@ -18,9 +17,8 @@ description: - This module can add, remove, update, query and execute arbitrary command in RouterOS via API. notes: - O(add), O(remove), O(update), O(cmd), and O(query) are mutually exclusive. - - Use the M(community.routeros.api_modify) and M(community.routeros.api_find_and_modify) modules - for more specific modifications, and the M(community.routeros.api_info) module for a more controlled - way of returning all entries for a path. + - Use the M(community.routeros.api_modify) and M(community.routeros.api_find_and_modify) modules for more specific modifications, + and the M(community.routeros.api_info) module for a more controlled way of returning all entries for a path. extends_documentation_fragment: - community.routeros.api - community.routeros.attributes @@ -68,11 +66,12 @@ options: - Query given path for selected query attributes from RouterOS aip. - WHERE is key word which extend query. WHERE format is key operator value - with spaces. - WHERE valid operators are V(==) or V(eq), V(!=) or V(not), V(>) or V(more), V(<) or V(less). - - Example path V(ip address) and query V(.id address) will return only C(.id) and C(address) for all items in V(ip address) path. - - Example path V(ip address) and query V(.id address WHERE address == 1.1.1.3/32). - will return only C(.id) and C(address) for items in V(ip address) path, where address is eq to 1.1.1.3/32. - - Example path V(interface) and query V(mtu name WHERE mut > 1400) will - return only interfaces C(mtu,name) where mtu is bigger than 1400. + - Example path V(ip address) and query V(.id address) will return only C(.id) and C(address) for all items in V(ip address) + path. + - Example path V(ip address) and query V(.id address WHERE address == 1.1.1.3/32). will return only C(.id) and C(address) + for items in V(ip address) path, where address is eq to 1.1.1.3/32. + - Example path V(interface) and query V(mtu name WHERE mut > 1400) will return only interfaces C(mtu,name) where mtu + is bigger than 1400. - Equivalent in RouterOS CLI C(/interface print where mtu > 1400). type: str extended_query: @@ -91,7 +90,8 @@ options: where: description: - Allows to restrict the objects returned. - - The conditions here must all match. An O(extended_query.where[].or) condition needs at least one of its conditions to match. + - The conditions here must all match. An O(extended_query.where[].or) condition needs at least one of its conditions + to match. type: list elements: dict suboptions: @@ -105,7 +105,8 @@ options: description: - The operator to use for matching. - For equality use V(==) or V(eq). For less use V(<) or V(less). For more use V(>) or V(more). - - Use V(in) to check whether the value is part of a list. In that case, O(extended_query.where[].value) must be a list. + - Use V(in) to check whether the value is part of a list. In that case, O(extended_query.where[].value) must + be a list. - Either O(extended_query.where[].or) or all of O(extended_query.where[].attribute), O(extended_query.where[].is), and O(extended_query.where[].value) have to be specified. type: str @@ -133,7 +134,8 @@ options: description: - The operator to use for matching. - For equality use V(==) or V(eq). For less use V(<) or V(less). For more use V(>) or V(more). - - Use V(in) to check whether the value is part of a list. In that case, O(extended_query.where[].or[].value) must be a list. + - Use V(in) to check whether the value is part of a list. In that case, O(extended_query.where[].or[].value) + must be a list. type: str choices: ["==", "!=", ">", "<", "in", "eq", "not", "more", "less"] required: true @@ -150,14 +152,14 @@ options: type: str seealso: - ref: ansible_collections.community.routeros.docsite.quoting - description: How to quote and unquote commands and arguments + description: How to quote and unquote commands and arguments. - module: community.routeros.api_facts - module: community.routeros.api_find_and_modify - module: community.routeros.api_info - module: community.routeros.api_modify -''' +""" -EXAMPLES = ''' +EXAMPLES = r""" - name: Get example - ip address print community.routeros.api: hostname: "{{ hostname }}" @@ -216,8 +218,8 @@ EXAMPLES = ''' - attribute: "network" is: "in" value: - - "10.20.36.0" - - "192.168.255.0" + - "10.20.36.0" + - "192.168.255.0" register: extended_queryout - name: Dump "Extended query example" output @@ -231,9 +233,9 @@ EXAMPLES = ''' username: "{{ username }}" path: "ip address" update: >- - .id=*14 - address=192.168.255.20/24 - comment={{ 'Update 192.168.255.10/24 to 192.168.255.20/24 on ether2' | community.routeros.quote_argument_value }} + .id=*14 + address=192.168.255.20/24 + comment={{ 'Update 192.168.255.10/24 to 192.168.255.20/24 on ether2' | community.routeros.quote_argument_value }} - name: Remove example - ether2 ip 192.168.255.20/24 with ".id = *14" community.routeros.api: @@ -255,18 +257,17 @@ EXAMPLES = ''' - name: Dump "Arbitrary command example" output ansible.builtin.debug: msg: '{{ arbitraryout }}' -''' +""" -RETURN = ''' ---- +RETURN = r""" message: - description: All outputs are in list with dictionary elements returned from RouterOS api. - sample: - - address: 1.2.3.4 - - address: 2.3.4.5 - type: list - returned: always -''' + description: All outputs are in list with dictionary elements returned from RouterOS api. + sample: + - address: 1.2.3.4 + - address: 2.3.4.5 + type: list + returned: always +""" from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native diff --git a/plugins/modules/api_facts.py b/plugins/modules/api_facts.py index 296621e..e1fb70a 100644 --- a/plugins/modules/api_facts.py +++ b/plugins/modules/api_facts.py @@ -9,23 +9,20 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: api_facts author: - - "Egor Zaitsev (@heuels)" - - "Nikolay Dachev (@NikolayDachev)" - - "Felix Fontein (@felixfontein)" + - "Egor Zaitsev (@heuels)" + - "Nikolay Dachev (@NikolayDachev)" + - "Felix Fontein (@felixfontein)" version_added: 2.1.0 short_description: Collect facts from remote devices running MikroTik RouterOS using the API description: - - Collects a base set of device facts from a remote device that - is running RouterOS. This module prepends all of the - base network fact keys with C(ansible_net_). The facts - module will always collect a base set of facts from the device + - Collects a base set of device facts from a remote device that is running RouterOS. This module prepends all of the base + network fact keys with C(ansible_net_). The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts. - - As opposed to the M(community.routeros.facts) module, it uses the - RouterOS API, similar to the M(community.routeros.api) module. + - As opposed to the M(community.routeros.facts) module, it uses the RouterOS API, similar to the M(community.routeros.api) + module. extends_documentation_fragment: - community.routeros.api - community.routeros.attributes @@ -39,12 +36,10 @@ attributes: options: gather_subset: description: - - When supplied, this argument will restrict the facts collected - to a given subset. Possible values for this argument include - V(all), V(hardware), V(interfaces), and V(routing). - - Can specify a list of values to include a larger subset. - Values can also be used with an initial V(!) to specify that a - specific subset should not be collected. + - When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument + include V(all), V(hardware), V(interfaces), and V(routing). + - Can specify a list of values to include a larger subset. Values can also be used with an initial V(!) to specify that + a specific subset should not be collected. required: false default: - all @@ -56,9 +51,9 @@ seealso: - module: community.routeros.api_find_and_modify - module: community.routeros.api_info - module: community.routeros.api_modify -''' +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Collect all facts from the device community.routeros.api_facts: hostname: 192.168.88.1 @@ -75,7 +70,7 @@ EXAMPLES = """ - "!hardware" """ -RETURN = """ +RETURN = r""" ansible_facts: description: "Dictionary of IP geolocation facts for a host's IP address." returned: always diff --git a/plugins/modules/api_find_and_modify.py b/plugins/modules/api_find_and_modify.py index 176c943..f6aab9f 100644 --- a/plugins/modules/api_find_and_modify.py +++ b/plugins/modules/api_find_and_modify.py @@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: api_find_and_modify author: - "Felix Fontein (@felixfontein)" @@ -17,13 +16,13 @@ short_description: Find and modify information using the API version_added: 2.1.0 description: - Allows to find entries for a path by conditions and modify the values of these entries. - - Use the M(community.routeros.api_find_and_modify) module to set all entries of a path to specific values, - or change multiple entries in different ways in one step. + - Use the M(community.routeros.api_find_and_modify) module to set all entries of a path to specific values, or change multiple + entries in different ways in one step. notes: - - "If you want to change values based on their old values (like change all comments 'foo' to 'bar') and make sure that - there are at least N such values, you can use O(require_matches_min=N) together with O(allow_no_matches=true). - This will make the module fail if there are less than N such entries, but not if there is no match. The latter case - is needed for idempotency of the task: once the values have been changed, there should be no further match." + - "If you want to change values based on their old values (like change all comments 'foo' to 'bar') and make sure that there + are at least N such values, you can use O(require_matches_min=N) together with O(allow_no_matches=true). This will make + the module fail if there are less than N such entries, but not if there is no match. The latter case is needed for idempotency + of the task: once the values have been changed, there should be no further match." extends_documentation_fragment: - community.routeros.api - community.routeros.attributes @@ -79,10 +78,9 @@ seealso: - module: community.routeros.api_facts - module: community.routeros.api_modify - module: community.routeros.api_info -''' +""" -EXAMPLES = ''' ---- +EXAMPLES = r""" - name: Rename bridge from 'bridge' to 'my-bridge' community.routeros.api_find_and_modify: hostname: "{{ hostname }}" @@ -104,59 +102,58 @@ EXAMPLES = ''' 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 -''' +""" -RETURN = ''' ---- +RETURN = r""" old_data: - description: - - A list of all elements for the current path before a change was made. - sample: - - '.id': '*1' - actual-interface: bridge - address: "192.168.88.1/24" - comment: defconf - disabled: false - dynamic: false - interface: bridge - invalid: false - network: 192.168.88.0 - type: list - elements: dict - returned: success + description: + - A list of all elements for the current path before a change was made. + sample: + - '.id': '*1' + actual-interface: bridge + address: "192.168.88.1/24" + comment: defconf + disabled: false + dynamic: false + interface: bridge + invalid: false + network: 192.168.88.0 + type: list + elements: dict + returned: success new_data: - description: - - A list of all elements for the current path after a change was made. - sample: - - '.id': '*1' - actual-interface: bridge - address: "192.168.1.1/24" - comment: awesome - disabled: false - dynamic: false - interface: bridge - invalid: false - network: 192.168.1.0 - type: list - elements: dict - returned: success + description: + - A list of all elements for the current path after a change was made. + sample: + - '.id': '*1' + actual-interface: bridge + address: "192.168.1.1/24" + comment: awesome + disabled: false + dynamic: false + interface: bridge + invalid: false + network: 192.168.1.0 + type: list + elements: dict + returned: success match_count: - description: - - The number of entries that matched the criteria in O(find). - sample: 1 - type: int - returned: success + description: + - The number of entries that matched the criteria in O(find). + sample: 1 + type: int + returned: success modify__count: - description: - - The number of entries that were modified. - sample: 1 - type: int - returned: success -''' + description: + - The number of entries that were modified. + sample: 1 + type: int + returned: success +""" from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 5b34463..f696548 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: api_info author: - "Felix Fontein (@felixfontein)" @@ -18,12 +17,12 @@ version_added: 2.2.0 description: - Allows to retrieve information for a path using the API. - This can be used to backup a path to restore it with the M(community.routeros.api_modify) module. - - Entries are normalized, dynamic and builtin entries are not returned. Use the O(handle_disabled) and - O(hide_defaults) options to control normalization, the O(include_dynamic) and O(include_builtin) options to also return - dynamic resp. builtin entries, and use O(unfiltered) to return all fields including counters. - - B(Note) that this module is still heavily in development, and only supports B(some) paths. - If you want to support new paths, or think you found problems with existing paths, please first - L(create an issue in the community.routeros Issue Tracker,https://github.com/ansible-collections/community.routeros/issues/). + - Entries are normalized, dynamic and builtin entries are not returned. Use the O(handle_disabled) and O(hide_defaults) + options to control normalization, the O(include_dynamic) and O(include_builtin) options to also return dynamic resp. builtin + entries, and use O(unfiltered) to return all fields including counters. + - B(Note) that this module is still heavily in development, and only supports B(some) paths. If you want to support new + paths, or think you found problems with existing paths, please first L(create an issue in the community.routeros Issue + Tracker,https://github.com/ansible-collections/community.routeros/issues/). extends_documentation_fragment: - community.routeros.api - community.routeros.api.restrict @@ -43,225 +42,225 @@ options: type: str choices: # BEGIN PATH LIST - - caps-man aaa - - caps-man access-list - - caps-man channel - - caps-man configuration - - caps-man datapath - - caps-man manager - - caps-man manager interface - - caps-man provisioning - - caps-man security - - certificate settings - - interface bonding - - interface bridge - - interface bridge mlag - - interface bridge port - - interface bridge port-controller - - interface bridge port-extender - - interface bridge settings - - interface bridge vlan - - interface detect-internet - - interface eoip - - interface ethernet - - interface ethernet poe - - interface ethernet switch - - interface ethernet switch port - - interface gre - - interface gre6 - - interface l2tp-client - - interface l2tp-server server - - interface list - - interface list member - - interface ovpn-client - - interface ovpn-server server - - interface ppp-client - - interface pppoe-client - - interface pppoe-server server - - interface pptp-server server - - interface sstp-server server - - interface vlan - - interface vrrp - - interface wifi - - interface wifi aaa - - interface wifi access-list - - interface wifi cap - - interface wifi capsman - - interface wifi channel - - interface wifi configuration - - interface wifi datapath - - interface wifi interworking - - interface wifi provisioning - - interface wifi security - - interface wifi steering - - interface wifiwave2 - - interface wifiwave2 aaa - - interface wifiwave2 access-list - - interface wifiwave2 cap - - interface wifiwave2 capsman - - interface wifiwave2 channel - - interface wifiwave2 configuration - - interface wifiwave2 datapath - - interface wifiwave2 interworking - - interface wifiwave2 provisioning - - interface wifiwave2 security - - interface wifiwave2 steering - - interface wireguard - - interface wireguard peers - - interface wireless - - interface wireless align - - interface wireless cap - - interface wireless security-profiles - - interface wireless sniffer - - interface wireless snooper - - iot modbus - - ip accounting - - ip accounting web-access - - ip address - - ip arp - - ip cloud - - ip cloud advanced - - ip dhcp-client - - ip dhcp-client option - - ip dhcp-relay - - ip dhcp-server - - ip dhcp-server config - - ip dhcp-server lease - - ip dhcp-server matcher - - ip dhcp-server network - - ip dhcp-server option - - ip dhcp-server option sets - - ip dns - - ip dns adlist - - ip dns static - - ip firewall address-list - - ip firewall connection tracking - - ip firewall filter - - ip firewall layer7-protocol - - ip firewall mangle - - ip firewall nat - - ip firewall raw - - ip firewall service-port - - ip hotspot service-port - - ip ipsec identity - - ip ipsec peer - - ip ipsec policy - - ip ipsec profile - - ip ipsec proposal - - ip ipsec settings - - ip neighbor discovery-settings - - ip pool - - ip proxy - - ip route - - ip route rule - - ip route vrf - - ip service - - ip settings - - ip smb - - ip socks - - ip ssh - - ip tftp settings - - ip traffic-flow - - ip traffic-flow ipfix - - ip traffic-flow target - - ip upnp - - ip upnp interfaces - - ip vrf - - ipv6 address - - ipv6 dhcp-client - - ipv6 dhcp-server - - ipv6 dhcp-server option - - ipv6 firewall address-list - - ipv6 firewall filter - - ipv6 firewall mangle - - ipv6 firewall nat - - ipv6 firewall raw - - ipv6 nd - - ipv6 nd prefix - - ipv6 nd prefix default - - ipv6 route - - ipv6 settings - - mpls - - mpls interface - - mpls ldp - - mpls ldp accept-filter - - mpls ldp advertise-filter - - mpls ldp interface - - port firmware - - port remote-access - - ppp aaa - - ppp profile - - ppp secret - - queue interface - - queue simple - - queue tree - - queue type - - radius - - radius incoming - - routing bgp aggregate - - routing bgp connection - - routing bgp instance - - routing bgp network - - routing bgp peer - - routing bgp template - - routing filter - - routing filter community-list - - routing filter num-list - - routing filter rule - - routing filter select-rule - - routing id - - routing igmp-proxy - - routing igmp-proxy interface - - routing mme - - routing ospf area - - routing ospf area range - - routing ospf instance - - routing ospf interface-template - - routing ospf static-neighbor - - routing pimsm instance - - routing pimsm interface-template - - routing rip - - routing ripng - - routing rule - - routing table - - snmp - - snmp community - - system clock - - system clock manual - - system health settings - - system identity - - system leds settings - - system logging - - system logging action - - system note - - system ntp client - - system ntp client servers - - system ntp server - - system package update - - system resource irq rps - - system routerboard settings - - system scheduler - - system script - - system upgrade mirror - - system ups - - system watchdog - - tool bandwidth-server - - tool e-mail - - tool graphing - - tool graphing interface - - tool graphing resource - - tool mac-server - - tool mac-server mac-winbox - - tool mac-server ping - - tool netwatch - - tool romon - - tool sms - - tool sniffer - - tool traffic-generator - - user - - user aaa - - user group - - user settings + - caps-man aaa + - caps-man access-list + - caps-man channel + - caps-man configuration + - caps-man datapath + - caps-man manager + - caps-man manager interface + - caps-man provisioning + - caps-man security + - certificate settings + - interface bonding + - interface bridge + - interface bridge mlag + - interface bridge port + - interface bridge port-controller + - interface bridge port-extender + - interface bridge settings + - interface bridge vlan + - interface detect-internet + - interface eoip + - interface ethernet + - interface ethernet poe + - interface ethernet switch + - interface ethernet switch port + - interface gre + - interface gre6 + - interface l2tp-client + - interface l2tp-server server + - interface list + - interface list member + - interface ovpn-client + - interface ovpn-server server + - interface ppp-client + - interface pppoe-client + - interface pppoe-server server + - interface pptp-server server + - interface sstp-server server + - interface vlan + - interface vrrp + - interface wifi + - interface wifi aaa + - interface wifi access-list + - interface wifi cap + - interface wifi capsman + - interface wifi channel + - interface wifi configuration + - interface wifi datapath + - interface wifi interworking + - interface wifi provisioning + - interface wifi security + - interface wifi steering + - interface wifiwave2 + - interface wifiwave2 aaa + - interface wifiwave2 access-list + - interface wifiwave2 cap + - interface wifiwave2 capsman + - interface wifiwave2 channel + - interface wifiwave2 configuration + - interface wifiwave2 datapath + - interface wifiwave2 interworking + - interface wifiwave2 provisioning + - interface wifiwave2 security + - interface wifiwave2 steering + - interface wireguard + - interface wireguard peers + - interface wireless + - interface wireless align + - interface wireless cap + - interface wireless security-profiles + - interface wireless sniffer + - interface wireless snooper + - iot modbus + - ip accounting + - ip accounting web-access + - ip address + - ip arp + - ip cloud + - ip cloud advanced + - ip dhcp-client + - ip dhcp-client option + - ip dhcp-relay + - ip dhcp-server + - ip dhcp-server config + - ip dhcp-server lease + - ip dhcp-server matcher + - ip dhcp-server network + - ip dhcp-server option + - ip dhcp-server option sets + - ip dns + - ip dns adlist + - ip dns static + - ip firewall address-list + - ip firewall connection tracking + - ip firewall filter + - ip firewall layer7-protocol + - ip firewall mangle + - ip firewall nat + - ip firewall raw + - ip firewall service-port + - ip hotspot service-port + - ip ipsec identity + - ip ipsec peer + - ip ipsec policy + - ip ipsec profile + - ip ipsec proposal + - ip ipsec settings + - ip neighbor discovery-settings + - ip pool + - ip proxy + - ip route + - ip route rule + - ip route vrf + - ip service + - ip settings + - ip smb + - ip socks + - ip ssh + - ip tftp settings + - ip traffic-flow + - ip traffic-flow ipfix + - ip traffic-flow target + - ip upnp + - ip upnp interfaces + - ip vrf + - ipv6 address + - ipv6 dhcp-client + - ipv6 dhcp-server + - ipv6 dhcp-server option + - ipv6 firewall address-list + - ipv6 firewall filter + - ipv6 firewall mangle + - ipv6 firewall nat + - ipv6 firewall raw + - ipv6 nd + - ipv6 nd prefix + - ipv6 nd prefix default + - ipv6 route + - ipv6 settings + - mpls + - mpls interface + - mpls ldp + - mpls ldp accept-filter + - mpls ldp advertise-filter + - mpls ldp interface + - port firmware + - port remote-access + - ppp aaa + - ppp profile + - ppp secret + - queue interface + - queue simple + - queue tree + - queue type + - radius + - radius incoming + - routing bgp aggregate + - routing bgp connection + - routing bgp instance + - routing bgp network + - routing bgp peer + - routing bgp template + - routing filter + - routing filter community-list + - routing filter num-list + - routing filter rule + - routing filter select-rule + - routing id + - routing igmp-proxy + - routing igmp-proxy interface + - routing mme + - routing ospf area + - routing ospf area range + - routing ospf instance + - routing ospf interface-template + - routing ospf static-neighbor + - routing pimsm instance + - routing pimsm interface-template + - routing rip + - routing ripng + - routing rule + - routing table + - snmp + - snmp community + - system clock + - system clock manual + - system health settings + - system identity + - system leds settings + - system logging + - system logging action + - system note + - system ntp client + - system ntp client servers + - system ntp server + - system package update + - system resource irq rps + - system routerboard settings + - system scheduler + - system script + - system upgrade mirror + - system ups + - system watchdog + - tool bandwidth-server + - tool e-mail + - tool graphing + - tool graphing interface + - tool graphing resource + - tool mac-server + - tool mac-server mac-winbox + - tool mac-server ping + - tool netwatch + - tool romon + - tool sms + - tool sniffer + - tool traffic-generator + - user + - user aaa + - user group + - user settings # END PATH LIST unfiltered: description: @@ -317,10 +316,9 @@ seealso: - module: community.routeros.api_facts - module: community.routeros.api_find_and_modify - module: community.routeros.api_modify -''' +""" -EXAMPLES = ''' ---- +EXAMPLES = r""" - name: Get IP addresses community.routeros.api_info: hostname: "{{ hostname }}" @@ -344,26 +342,25 @@ EXAMPLES = ''' - name: Print data for IP addresses ansible.builtin.debug: var: ip_addresses.result -''' +""" -RETURN = ''' ---- +RETURN = r""" result: - description: A list of all elements for the current path. - sample: - - '.id': '*1' - actual-interface: bridge - address: "192.168.88.1/24" - comment: defconf - disabled: false - dynamic: false - interface: bridge - invalid: false - network: 192.168.88.0 - type: list - elements: dict - returned: always -''' + description: A list of all elements for the current path. + sample: + - '.id': '*1' + actual-interface: bridge + address: "192.168.88.1/24" + comment: defconf + disabled: false + dynamic: false + interface: bridge + invalid: false + network: 192.168.88.0 + type: list + elements: dict + returned: always +""" from ansible.module_utils.basic import AnsibleModule from ansible.module_utils.common.text.converters import to_native diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 9ab34d9..4abc8fc 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: api_modify author: - "Felix Fontein (@felixfontein)" @@ -17,17 +16,17 @@ short_description: Modify data at paths with API version_added: 2.2.0 description: - Allows to modify information for a path using the API. - - Use the M(community.routeros.api_find_and_modify) module to modify one or multiple entries in a controlled way - depending on some search conditions. + - Use the M(community.routeros.api_find_and_modify) module to modify one or multiple entries in a controlled way depending + on some search conditions. - To make a backup of a path that can be restored with this module, use the M(community.routeros.api_info) module. - The module ignores dynamic and builtin entries. - - B(Note) that this module is still heavily in development, and only supports B(some) paths. - If you want to support new paths, or think you found problems with existing paths, please first - L(create an issue in the community.routeros Issue Tracker,https://github.com/ansible-collections/community.routeros/issues/). + - B(Note) that this module is still heavily in development, and only supports B(some) paths. If you want to support new + paths, or think you found problems with existing paths, please first L(create an issue in the community.routeros Issue + Tracker,https://github.com/ansible-collections/community.routeros/issues/). notes: - - If write-only fields are present in the path, the module is B(not idempotent) in a strict sense, - since it is not able to verify the current value of these fields. The behavior the module should - assume can be controlled with the O(handle_write_only) option. + - If write-only fields are present in the path, the module is B(not idempotent) in a strict sense, since it is not able + to verify the current value of these fields. The behavior the module should assume can be controlled with the O(handle_write_only) + option. requirements: - Needs L(ordereddict,https://pypi.org/project/ordereddict) for Python 2.6 extends_documentation_fragment: @@ -47,230 +46,231 @@ options: path: description: - Path to query. - - An example value is V(ip address). This is equivalent to running modification commands in C(/ip address) in the RouterOS CLI. + - An example value is V(ip address). This is equivalent to running modification commands in C(/ip address) in the RouterOS + CLI. required: true type: str choices: # BEGIN PATH LIST - - caps-man aaa - - caps-man access-list - - caps-man channel - - caps-man configuration - - caps-man datapath - - caps-man manager - - caps-man manager interface - - caps-man provisioning - - caps-man security - - certificate settings - - interface bonding - - interface bridge - - interface bridge mlag - - interface bridge port - - interface bridge port-controller - - interface bridge port-extender - - interface bridge settings - - interface bridge vlan - - interface detect-internet - - interface eoip - - interface ethernet - - interface ethernet poe - - interface ethernet switch - - interface ethernet switch port - - interface gre - - interface gre6 - - interface l2tp-client - - interface l2tp-server server - - interface list - - interface list member - - interface ovpn-client - - interface ovpn-server server - - interface ppp-client - - interface pppoe-client - - interface pppoe-server server - - interface pptp-server server - - interface sstp-server server - - interface vlan - - interface vrrp - - interface wifi - - interface wifi aaa - - interface wifi access-list - - interface wifi cap - - interface wifi capsman - - interface wifi channel - - interface wifi configuration - - interface wifi datapath - - interface wifi interworking - - interface wifi provisioning - - interface wifi security - - interface wifi steering - - interface wifiwave2 - - interface wifiwave2 aaa - - interface wifiwave2 access-list - - interface wifiwave2 cap - - interface wifiwave2 capsman - - interface wifiwave2 channel - - interface wifiwave2 configuration - - interface wifiwave2 datapath - - interface wifiwave2 interworking - - interface wifiwave2 provisioning - - interface wifiwave2 security - - interface wifiwave2 steering - - interface wireguard - - interface wireguard peers - - interface wireless - - interface wireless align - - interface wireless cap - - interface wireless security-profiles - - interface wireless sniffer - - interface wireless snooper - - iot modbus - - ip accounting - - ip accounting web-access - - ip address - - ip arp - - ip cloud - - ip cloud advanced - - ip dhcp-client - - ip dhcp-client option - - ip dhcp-relay - - ip dhcp-server - - ip dhcp-server config - - ip dhcp-server lease - - ip dhcp-server matcher - - ip dhcp-server network - - ip dhcp-server option - - ip dhcp-server option sets - - ip dns - - ip dns adlist - - ip dns static - - ip firewall address-list - - ip firewall connection tracking - - ip firewall filter - - ip firewall layer7-protocol - - ip firewall mangle - - ip firewall nat - - ip firewall raw - - ip firewall service-port - - ip hotspot service-port - - ip ipsec identity - - ip ipsec peer - - ip ipsec policy - - ip ipsec profile - - ip ipsec proposal - - ip ipsec settings - - ip neighbor discovery-settings - - ip pool - - ip proxy - - ip route - - ip route rule - - ip route vrf - - ip service - - ip settings - - ip smb - - ip socks - - ip ssh - - ip tftp settings - - ip traffic-flow - - ip traffic-flow ipfix - - ip traffic-flow target - - ip upnp - - ip upnp interfaces - - ip vrf - - ipv6 address - - ipv6 dhcp-client - - ipv6 dhcp-server - - ipv6 dhcp-server option - - ipv6 firewall address-list - - ipv6 firewall filter - - ipv6 firewall mangle - - ipv6 firewall nat - - ipv6 firewall raw - - ipv6 nd - - ipv6 nd prefix - - ipv6 nd prefix default - - ipv6 route - - ipv6 settings - - mpls - - mpls interface - - mpls ldp - - mpls ldp accept-filter - - mpls ldp advertise-filter - - mpls ldp interface - - port firmware - - port remote-access - - ppp aaa - - ppp profile - - ppp secret - - queue interface - - queue simple - - queue tree - - queue type - - radius - - radius incoming - - routing bgp aggregate - - routing bgp connection - - routing bgp instance - - routing bgp network - - routing bgp peer - - routing bgp template - - routing filter - - routing filter community-list - - routing filter num-list - - routing filter rule - - routing filter select-rule - - routing id - - routing igmp-proxy - - routing igmp-proxy interface - - routing mme - - routing ospf area - - routing ospf area range - - routing ospf instance - - routing ospf interface-template - - routing ospf static-neighbor - - routing pimsm instance - - routing pimsm interface-template - - routing rip - - routing ripng - - routing rule - - routing table - - snmp - - snmp community - - system clock - - system clock manual - - system health settings - - system identity - - system leds settings - - system logging - - system logging action - - system note - - system ntp client - - system ntp client servers - - system ntp server - - system package update - - system resource irq rps - - system routerboard settings - - system scheduler - - system script - - system upgrade mirror - - system ups - - system watchdog - - tool bandwidth-server - - tool e-mail - - tool graphing - - tool graphing interface - - tool graphing resource - - tool mac-server - - tool mac-server mac-winbox - - tool mac-server ping - - tool netwatch - - tool romon - - tool sms - - tool sniffer - - tool traffic-generator - - user - - user aaa - - user group - - user settings + - caps-man aaa + - caps-man access-list + - caps-man channel + - caps-man configuration + - caps-man datapath + - caps-man manager + - caps-man manager interface + - caps-man provisioning + - caps-man security + - certificate settings + - interface bonding + - interface bridge + - interface bridge mlag + - interface bridge port + - interface bridge port-controller + - interface bridge port-extender + - interface bridge settings + - interface bridge vlan + - interface detect-internet + - interface eoip + - interface ethernet + - interface ethernet poe + - interface ethernet switch + - interface ethernet switch port + - interface gre + - interface gre6 + - interface l2tp-client + - interface l2tp-server server + - interface list + - interface list member + - interface ovpn-client + - interface ovpn-server server + - interface ppp-client + - interface pppoe-client + - interface pppoe-server server + - interface pptp-server server + - interface sstp-server server + - interface vlan + - interface vrrp + - interface wifi + - interface wifi aaa + - interface wifi access-list + - interface wifi cap + - interface wifi capsman + - interface wifi channel + - interface wifi configuration + - interface wifi datapath + - interface wifi interworking + - interface wifi provisioning + - interface wifi security + - interface wifi steering + - interface wifiwave2 + - interface wifiwave2 aaa + - interface wifiwave2 access-list + - interface wifiwave2 cap + - interface wifiwave2 capsman + - interface wifiwave2 channel + - interface wifiwave2 configuration + - interface wifiwave2 datapath + - interface wifiwave2 interworking + - interface wifiwave2 provisioning + - interface wifiwave2 security + - interface wifiwave2 steering + - interface wireguard + - interface wireguard peers + - interface wireless + - interface wireless align + - interface wireless cap + - interface wireless security-profiles + - interface wireless sniffer + - interface wireless snooper + - iot modbus + - ip accounting + - ip accounting web-access + - ip address + - ip arp + - ip cloud + - ip cloud advanced + - ip dhcp-client + - ip dhcp-client option + - ip dhcp-relay + - ip dhcp-server + - ip dhcp-server config + - ip dhcp-server lease + - ip dhcp-server matcher + - ip dhcp-server network + - ip dhcp-server option + - ip dhcp-server option sets + - ip dns + - ip dns adlist + - ip dns static + - ip firewall address-list + - ip firewall connection tracking + - ip firewall filter + - ip firewall layer7-protocol + - ip firewall mangle + - ip firewall nat + - ip firewall raw + - ip firewall service-port + - ip hotspot service-port + - ip ipsec identity + - ip ipsec peer + - ip ipsec policy + - ip ipsec profile + - ip ipsec proposal + - ip ipsec settings + - ip neighbor discovery-settings + - ip pool + - ip proxy + - ip route + - ip route rule + - ip route vrf + - ip service + - ip settings + - ip smb + - ip socks + - ip ssh + - ip tftp settings + - ip traffic-flow + - ip traffic-flow ipfix + - ip traffic-flow target + - ip upnp + - ip upnp interfaces + - ip vrf + - ipv6 address + - ipv6 dhcp-client + - ipv6 dhcp-server + - ipv6 dhcp-server option + - ipv6 firewall address-list + - ipv6 firewall filter + - ipv6 firewall mangle + - ipv6 firewall nat + - ipv6 firewall raw + - ipv6 nd + - ipv6 nd prefix + - ipv6 nd prefix default + - ipv6 route + - ipv6 settings + - mpls + - mpls interface + - mpls ldp + - mpls ldp accept-filter + - mpls ldp advertise-filter + - mpls ldp interface + - port firmware + - port remote-access + - ppp aaa + - ppp profile + - ppp secret + - queue interface + - queue simple + - queue tree + - queue type + - radius + - radius incoming + - routing bgp aggregate + - routing bgp connection + - routing bgp instance + - routing bgp network + - routing bgp peer + - routing bgp template + - routing filter + - routing filter community-list + - routing filter num-list + - routing filter rule + - routing filter select-rule + - routing id + - routing igmp-proxy + - routing igmp-proxy interface + - routing mme + - routing ospf area + - routing ospf area range + - routing ospf instance + - routing ospf interface-template + - routing ospf static-neighbor + - routing pimsm instance + - routing pimsm interface-template + - routing rip + - routing ripng + - routing rule + - routing table + - snmp + - snmp community + - system clock + - system clock manual + - system health settings + - system identity + - system leds settings + - system logging + - system logging action + - system note + - system ntp client + - system ntp client servers + - system ntp server + - system package update + - system resource irq rps + - system routerboard settings + - system scheduler + - system script + - system upgrade mirror + - system ups + - system watchdog + - tool bandwidth-server + - tool e-mail + - tool graphing + - tool graphing interface + - tool graphing resource + - tool mac-server + - tool mac-server mac-winbox + - tool mac-server ping + - tool netwatch + - tool romon + - tool sms + - tool sniffer + - tool traffic-generator + - user + - user aaa + - user group + - user settings # END PATH LIST data: description: @@ -298,12 +298,12 @@ options: default: ignore handle_entries_content: description: - - For a single entry in O(data), this describes how to handle fields that are not mentioned - in that entry, but appear in the actual config. + - For a single entry in O(data), this describes how to handle fields that are not mentioned in that entry, but appear + in the actual config. - If V(ignore), they are not modified. - If V(remove), they are removed. If at least one cannot be removed, the module will fail. - - If V(remove_as_much_as_possible), all that can be removed will be removed. The ones that - cannot be removed will be kept. + - If V(remove_as_much_as_possible), all that can be removed will be removed. The ones that cannot be removed will be + kept. - Note that V(remove) and V(remove_as_much_as_possible) do not apply to write-only fields. type: str choices: @@ -315,8 +315,8 @@ options: description: - How to handle values passed in for read-only fields. - If V(ignore), they are not passed to the API. - - If V(validate), the values are not passed for creation, and for updating they are compared to the value returned for the object. - If they differ, the module fails. + - If V(validate), the values are not passed for creation, and for updating they are compared to the value returned for + the object. If they differ, the module fails. - If V(error), the module will fail if read-only fields are provided. type: str choices: @@ -329,9 +329,8 @@ options: description: - How to handle values passed in for write-only fields. - If V(create_only), they are passed on creation, and ignored for updating. - - If V(always_update), they are always passed to the API. This means that if such a value is present, - the module will always result in C(changed) since there is no way to validate whether the value - actually changed. + - If V(always_update), they are always passed to the API. This means that if such a value is present, the module will + always result in C(changed) since there is no way to validate whether the value actually changed. - If V(error), the module will fail if write-only fields are provided. type: str choices: @@ -343,21 +342,18 @@ options: restrict: description: - Restrict operation to entries matching the following criteria. - - This can be useful together with O(handle_absent_entries=remove) to operate on a subset of - the values. - - For example, for O(path=ip firewall filter), you can set O(restrict[].field=chain) and - O(restrict[].values=input) to restrict operation to the input chain, and ignore the - forward and output chains. + - This can be useful together with O(handle_absent_entries=remove) to operate on a subset of the values. + - For example, for O(path=ip firewall filter), you can set O(restrict[].field=chain) and O(restrict[].values=input) + to restrict operation to the input chain, and ignore the forward and output chains. version_added: 2.18.0 seealso: - module: community.routeros.api - module: community.routeros.api_facts - module: community.routeros.api_find_and_modify - module: community.routeros.api_info -''' +""" -EXAMPLES = ''' ---- +EXAMPLES = r""" - name: Setup DHCP server networks # Ensures that we have exactly two DHCP server networks (in the specified order) community.routeros.api_modify: @@ -411,43 +407,42 @@ EXAMPLES = ''' data: - action: drop chain: input -''' +""" -RETURN = ''' ---- +RETURN = r""" old_data: - description: - - A list of all elements for the current path before a change was made. - sample: - - '.id': '*1' - actual-interface: bridge - address: "192.168.88.1/24" - comment: defconf - disabled: false - dynamic: false - interface: bridge - invalid: false - network: 192.168.88.0 - type: list - elements: dict - returned: always + description: + - A list of all elements for the current path before a change was made. + sample: + - '.id': '*1' + actual-interface: bridge + address: "192.168.88.1/24" + comment: defconf + disabled: false + dynamic: false + interface: bridge + invalid: false + network: 192.168.88.0 + type: list + elements: dict + returned: always new_data: - description: - - A list of all elements for the current path after a change was made. - sample: - - '.id': '*1' - actual-interface: bridge - address: "192.168.1.1/24" - comment: awesome - disabled: false - dynamic: false - interface: bridge - invalid: false - network: 192.168.1.0 - type: list - elements: dict - returned: always -''' + description: + - A list of all elements for the current path after a change was made. + sample: + - '.id': '*1' + actual-interface: bridge + address: "192.168.1.1/24" + comment: awesome + disabled: false + dynamic: false + interface: bridge + invalid: false + network: 192.168.1.0 + type: list + elements: dict + returned: always +""" from collections import defaultdict diff --git a/plugins/modules/command.py b/plugins/modules/command.py index bf74d47..306f648 100644 --- a/plugins/modules/command.py +++ b/plugins/modules/command.py @@ -7,27 +7,23 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: command author: "Egor Zaitsev (@heuels)" short_description: Run commands on remote devices running MikroTik RouterOS description: - - Sends arbitrary commands to an RouterOS node and returns the results - read from the device. This module includes an - argument that will cause the module to wait for a specific condition - before returning or timing out if the condition is not met. - - The module always indicates a (changed) status. You can use - R(the changed_when task property,override_the_changed_result) to determine - whether a command task actually resulted in a change or not. + - Sends arbitrary commands to an RouterOS node and returns the results read from the device. This module includes an argument + that will cause the module to wait for a specific condition before returning or timing out if the condition is not met. + - The module always indicates a (changed) status. You can use R(the changed_when task property,override_the_changed_result) + to determine whether a command task actually resulted in a change or not. extends_documentation_fragment: - community.routeros.attributes attributes: check_mode: support: none details: - - Before community.routeros 3.0.0, the module claimed to support check mode. - It simply executed the command in check mode. + - Before community.routeros 3.0.0, the module claimed to support check mode. It simply executed the command in check + mode. diff_mode: support: none platform: @@ -36,58 +32,47 @@ attributes: options: commands: description: - - List of commands to send to the remote RouterOS device over the - configured provider. The resulting output from the command - is returned. If the O(wait_for) argument is provided, the - module is not returned until the condition is satisfied or - the number of retries has expired. + - List of commands to send to the remote RouterOS device over the configured provider. The resulting output from the + command is returned. If the O(wait_for) argument is provided, the module is not returned until the condition is satisfied + or the number of retries has expired. required: true type: list elements: str wait_for: description: - - List of conditions to evaluate against the output of the - command. The task will wait for each condition to be true - before moving forward. If the conditional is not true - within the configured number of retries, the task fails. - See examples. + - List of conditions to evaluate against the output of the command. The task will wait for each condition to be true + before moving forward. If the conditional is not true within the configured number of retries, the task fails. See + examples. type: list elements: str match: description: - - The O(match) argument is used in conjunction with the - O(wait_for) argument to specify the match policy. Valid - values are V(all) or V(any). If the value is set to V(all) - then all conditionals in the wait_for must be satisfied. If - the value is set to V(any) then only one of the values must be - satisfied. + - The O(match) argument is used in conjunction with the O(wait_for) argument to specify the match policy. Valid values + are V(all) or V(any). If the value is set to V(all) then all conditionals in the wait_for must be satisfied. If the + value is set to V(any) then only one of the values must be satisfied. default: all choices: ['any', 'all'] type: str retries: description: - - Specifies the number of retries a command should by tried - before it is considered failed. The command is run on the - target device every retry and evaluated against the - O(wait_for) conditions. + - Specifies the number of retries a command should by tried before it is considered failed. The command is run on the + target device every retry and evaluated against the O(wait_for) conditions. default: 10 type: int interval: description: - - Configures the interval in seconds to wait between retries - of the command. If the command does not pass the specified - conditions, the interval indicates how long to wait before - trying the command again. + - Configures the interval in seconds to wait between retries of the command. If the command does not pass the specified + conditions, the interval indicates how long to wait before trying the command again. default: 1 type: int seealso: - ref: ansible_collections.community.routeros.docsite.ssh-guide - description: How to connect to RouterOS devices with SSH + description: How to connect to RouterOS devices with SSH. - ref: ansible_collections.community.routeros.docsite.quoting - description: How to quote and unquote commands and arguments -''' + description: How to quote and unquote commands and arguments. +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Run command on remote devices community.routeros.command: commands: /system routerboard print @@ -113,19 +98,19 @@ EXAMPLES = """ - result[1] contains ether1 """ -RETURN = """ +RETURN = r""" stdout: - description: The set of responses from the commands + description: The set of responses from the commands. returned: always apart from low level errors (such as action plugin) type: list sample: ['...', '...'] stdout_lines: - description: The value of stdout split into a list + description: The value of stdout split into a list. returned: always apart from low level errors (such as action plugin) type: list sample: [['...', '...'], ['...'], ['...']] failed_conditions: - description: The list of conditionals that have failed + description: The list of conditionals that have failed. returned: failed type: list sample: ['...', '...'] diff --git a/plugins/modules/facts.py b/plugins/modules/facts.py index 50f9a21..21013aa 100644 --- a/plugins/modules/facts.py +++ b/plugins/modules/facts.py @@ -7,16 +7,13 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -DOCUMENTATION = ''' ---- +DOCUMENTATION = r""" module: facts author: "Egor Zaitsev (@heuels)" short_description: Collect facts from remote devices running MikroTik RouterOS description: - - Collects a base set of device facts from a remote device that - is running RouterOS. This module prepends all of the - base network fact keys with C(ansible_net_). The facts - module will always collect a base set of facts from the device + - Collects a base set of device facts from a remote device that is running RouterOS. This module prepends all of the base + network fact keys with C(ansible_net_). The facts module will always collect a base set of facts from the device and can enable or disable collection of additional facts. extends_documentation_fragment: - community.routeros.attributes @@ -29,12 +26,10 @@ attributes: options: gather_subset: description: - - When supplied, this argument will restrict the facts collected - to a given subset. Possible values for this argument include - V(all), V(hardware), V(config), V(interfaces), and V(routing). - - Can specify a list of values to include a larger subset. - Values can also be used with an initial V(!) to specify that a - specific subset should not be collected. + - When supplied, this argument will restrict the facts collected to a given subset. Possible values for this argument + include V(all), V(hardware), V(config), V(interfaces), and V(routing). + - Can specify a list of values to include a larger subset. Values can also be used with an initial V(!) to specify that + a specific subset should not be collected. required: false default: - '!config' @@ -42,10 +37,10 @@ options: elements: str seealso: - ref: ansible_collections.community.routeros.docsite.ssh-guide - description: How to connect to RouterOS devices with SSH -''' + description: How to connect to RouterOS devices with SSH. +""" -EXAMPLES = """ +EXAMPLES = r""" - name: Collect all facts from the device community.routeros.facts: gather_subset: all @@ -61,7 +56,7 @@ EXAMPLES = """ - "!hardware" """ -RETURN = """ +RETURN = r""" ansible_facts: description: "Dictionary of IP geolocation facts for a host's IP address." returned: always @@ -129,9 +124,9 @@ ansible_facts: ansible_net_config_nonverbose: description: - The current active config from the device in minimal form. - - This value is idempotent in the sense that if the facts module is run twice and the device's config - was not changed between the runs, the value is identical. This is achieved by running C(/export) - and stripping the timestamp from the comment in the first line. + - This value is idempotent in the sense that if the facts module is run twice and the device's config was not changed + between the runs, the value is identical. This is achieved by running C(/export) and stripping the timestamp from + the comment in the first line. returned: O(gather_subset) contains V(config) type: str version_added: 1.2.0 diff --git a/update-docs.py b/update-docs.py index 05a9ee7..4f164c8 100755 --- a/update-docs.py +++ b/update-docs.py @@ -42,7 +42,7 @@ def main(): path_choices = sorted([join_path(path) for path, path_info in PATHS.items() if path_info.fully_understood]) for file in MODULES: - update_file(file, ' # BEGIN PATH LIST', ' # END PATH LIST', ' - {choice}', path_choices) + update_file(file, ' # BEGIN PATH LIST', ' # END PATH LIST', ' - {choice}', path_choices) if __name__ == '__main__': From 1e0c582b9811f4923af36a7ab7fd3f43bf0b8d49 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 28 Dec 2024 16:52:27 +0100 Subject: [PATCH 19/96] Improve formulations. --- plugins/cliconf/routeros.py | 2 +- plugins/doc_fragments/api.py | 2 +- plugins/modules/api.py | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/cliconf/routeros.py b/plugins/cliconf/routeros.py index 1c3288f..dc2f4a9 100644 --- a/plugins/cliconf/routeros.py +++ b/plugins/cliconf/routeros.py @@ -10,7 +10,7 @@ author: "Egor Zaitsev (@heuels)" name: routeros short_description: Use routeros cliconf to run command on MikroTik RouterOS platform description: - - This routeros plugin provides low level abstraction apis for sending and receiving CLI commands from MikroTik RouterOS + - This routeros plugin provides low level abstraction APIs for sending and receiving CLI commands from MikroTik RouterOS network devices. """ diff --git a/plugins/doc_fragments/api.py b/plugins/doc_fragments/api.py index edef5f0..5b0b411 100644 --- a/plugins/doc_fragments/api.py +++ b/plugins/doc_fragments/api.py @@ -43,7 +43,7 @@ options: - ssl port: description: - - RouterOS api port. If O(tls) is set, port will apply to TLS/SSL connection. + - RouterOS API port. If O(tls) is set, port will apply to TLS/SSL connection. - Defaults are V(8728) for the HTTP API, and V(8729) for the HTTPS API. type: int force_no_cert: diff --git a/plugins/modules/api.py b/plugins/modules/api.py index ecd99e0..404569d 100644 --- a/plugins/modules/api.py +++ b/plugins/modules/api.py @@ -14,7 +14,7 @@ author: "Nikolay Dachev (@NikolayDachev)" short_description: Ansible module for RouterOS API description: - Ansible module for RouterOS API with the Python C(librouteros) library. - - This module can add, remove, update, query and execute arbitrary command in RouterOS via API. + - This module can add, remove, update, query, and execute arbitrary command in RouterOS through the API. notes: - O(add), O(remove), O(update), O(cmd), and O(query) are mutually exclusive. - Use the M(community.routeros.api_modify) and M(community.routeros.api_find_and_modify) modules for more specific modifications, @@ -37,7 +37,7 @@ options: path: description: - Main path for all other arguments. - - If other arguments are not set, api will return all items in selected path. + - If other arguments are not set, the module will return all items in selected path. - Example V(ip address). Equivalent of RouterOS CLI C(/ip address print). required: true type: str @@ -57,7 +57,7 @@ options: update: description: - Update config/value in RouterOS by '.id' in selected path. - - Example V(.id=*03 address=1.1.1.3/32) and path V(ip address) will replace existing ip address with C(.id=*03). + - Example V(.id=*03 address=1.1.1.3/32) and path V(ip address) will replace the existing IP address with C(.id=*03). - Equivalent in RouterOS CLI C(/ip address set address=1.1.1.3/32 numbers=1). - Note C(number) in RouterOS CLI is different from C(.id). type: str @@ -261,7 +261,7 @@ EXAMPLES = r""" RETURN = r""" message: - description: All outputs are in list with dictionary elements returned from RouterOS api. + description: All outputs are in list with dictionary elements returned from RouterOS API. sample: - address: 1.2.3.4 - address: 2.3.4.5 From 2a3460827dc2ed6dd28896e2e6f9341d4f218cbc Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 29 Dec 2024 15:48:00 +0100 Subject: [PATCH 20/96] Fix doc fragments indents. --- plugins/doc_fragments/attributes.py | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/plugins/doc_fragments/attributes.py b/plugins/doc_fragments/attributes.py index 8c5c145..d4f407f 100644 --- a/plugins/doc_fragments/attributes.py +++ b/plugins/doc_fragments/attributes.py @@ -27,24 +27,24 @@ attributes: INFO_MODULE = r''' options: {} attributes: - check_mode: - support: full - details: - - This action does not modify state. - diff_mode: - support: N/A - details: - - This action does not modify state. + check_mode: + support: full + details: + - This action does not modify state. + diff_mode: + support: N/A + details: + - This action does not modify state. ''' ACTIONGROUP_API = r''' options: {} attributes: - action_group: - description: Use C(group/community.routeros.api) in C(module_defaults) to set defaults for this module. - support: full - membership: - - community.routeros.api + action_group: + description: Use C(group/community.routeros.api) in C(module_defaults) to set defaults for this module. + support: full + membership: + - community.routeros.api ''' CONN = r""" @@ -69,16 +69,16 @@ attributes: FACTS_MODULE = r''' options: {} attributes: - check_mode: - support: full - details: - - This action does not modify state. - diff_mode: - support: N/A - details: - - This action does not modify state. - facts: - support: full + check_mode: + support: full + details: + - This action does not modify state. + diff_mode: + support: N/A + details: + - This action does not modify state. + facts: + support: full ''' FILES = r""" From 44e6bb6f7a8839db42f574442973bbf600e1614b Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 30 Dec 2024 21:11:17 +0100 Subject: [PATCH 21/96] Add 'idempotent' attribute (#337) * Add 'idempotent' attribute. * Mention check mode in attribute description. Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --------- Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> --- plugins/doc_fragments/attributes.py | 14 ++++++++++++++ plugins/modules/api.py | 4 ++++ plugins/modules/api_facts.py | 1 + plugins/modules/api_find_and_modify.py | 2 ++ plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 2 ++ plugins/modules/command.py | 4 ++++ plugins/modules/facts.py | 1 + 8 files changed, 29 insertions(+) diff --git a/plugins/doc_fragments/attributes.py b/plugins/doc_fragments/attributes.py index d4f407f..b8e68bf 100644 --- a/plugins/doc_fragments/attributes.py +++ b/plugins/doc_fragments/attributes.py @@ -21,6 +21,20 @@ attributes: platform: description: Target OS/families that can be operated against. support: N/A + idempotent: + description: + - When run twice in a row outside check mode, with the same arguments, the second invocation indicates no change. + - This assumes that the system controlled/queried by the module has not changed in a relevant way. +""" + + # Should be used together with the standard fragment + IDEMPOTENT_NOT_MODIFY_STATE = r""" +options: {} +attributes: + idempotent: + support: full + details: + - This action does not modify state. """ # Should be used together with the standard fragment diff --git a/plugins/modules/api.py b/plugins/modules/api.py index 404569d..7d90045 100644 --- a/plugins/modules/api.py +++ b/plugins/modules/api.py @@ -33,6 +33,10 @@ attributes: platforms: RouterOS action_group: version_added: 2.1.0 + idempotent: + support: N/A + details: + - Whether the executed command is idempotent depends on the operation performed. options: path: description: diff --git a/plugins/modules/api_facts.py b/plugins/modules/api_facts.py index e1fb70a..b6d1261 100644 --- a/plugins/modules/api_facts.py +++ b/plugins/modules/api_facts.py @@ -29,6 +29,7 @@ extends_documentation_fragment: - community.routeros.attributes.actiongroup_api - community.routeros.attributes.facts - community.routeros.attributes.facts_module + - community.routeros.attributes.idempotent_not_modify_state attributes: platform: support: full diff --git a/plugins/modules/api_find_and_modify.py b/plugins/modules/api_find_and_modify.py index f6aab9f..817451c 100644 --- a/plugins/modules/api_find_and_modify.py +++ b/plugins/modules/api_find_and_modify.py @@ -35,6 +35,8 @@ attributes: platform: support: full platforms: RouterOS + idempotent: + support: full options: path: description: diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index f696548..e68ded0 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -28,6 +28,7 @@ extends_documentation_fragment: - community.routeros.api.restrict - community.routeros.attributes - community.routeros.attributes.actiongroup_api + - community.routeros.attributes.idempotent_not_modify_state - community.routeros.attributes.info_module attributes: platform: diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index 4abc8fc..b4a7765 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -42,6 +42,8 @@ attributes: platform: support: full platforms: RouterOS + idempotent: + support: full options: path: description: diff --git a/plugins/modules/command.py b/plugins/modules/command.py index 306f648..90f9733 100644 --- a/plugins/modules/command.py +++ b/plugins/modules/command.py @@ -29,6 +29,10 @@ attributes: platform: support: full platforms: RouterOS + idempotent: + support: N/A + details: + - Whether the executed command is idempotent depends on the command. options: commands: description: diff --git a/plugins/modules/facts.py b/plugins/modules/facts.py index 21013aa..7b169b7 100644 --- a/plugins/modules/facts.py +++ b/plugins/modules/facts.py @@ -19,6 +19,7 @@ extends_documentation_fragment: - community.routeros.attributes - community.routeros.attributes.facts - community.routeros.attributes.facts_module + - community.routeros.attributes.idempotent_not_modify_state attributes: platform: support: full From 71882863a51269990eceefaf3dd34295da43fd0b Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 30 Dec 2024 21:13:39 +0100 Subject: [PATCH 22/96] Prepare 3.2.0 release. --- changelogs/fragments/3.2.0.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3.2.0.yml diff --git a/changelogs/fragments/3.2.0.yml b/changelogs/fragments/3.2.0.yml new file mode 100644 index 0000000..512efc9 --- /dev/null +++ b/changelogs/fragments/3.2.0.yml @@ -0,0 +1 @@ +release_summary: Feature release. diff --git a/galaxy.yml b/galaxy.yml index e59c543..c05b819 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.1.0 +version: 3.2.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From 4241179471fa7139e05ae118954d940b34c62712 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 30 Dec 2024 22:03:45 +0100 Subject: [PATCH 23/96] Release 3.2.0. --- CHANGELOG.md | 236 ++++++++++-------- CHANGELOG.rst | 13 + changelogs/changelog.yaml | 10 + changelogs/fragments/3.2.0.yml | 1 - .../331-add-routing-filter-community-list.yml | 2 - 5 files changed, 149 insertions(+), 113 deletions(-) delete mode 100644 changelogs/fragments/3.2.0.yml delete mode 100644 changelogs/fragments/331-add-routing-filter-community-list.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 135eb61..9105fc0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,143 +2,159 @@ **Topics** -- 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\.1\.0 + +## v3\.2\.0 ### Release Summary -Bugfix and feature release\. +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)\)\. + + +## 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)\)\. @@ -149,7 +165,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\. @@ -167,12 +183,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)\)\. @@ -183,12 +199,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)\)\. @@ -200,12 +216,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)\)\. @@ -229,12 +245,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)\)\. @@ -244,12 +260,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)\)\. @@ -258,12 +274,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)\)\. @@ -280,12 +296,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)\)\. @@ -295,12 +311,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)\)\. @@ -314,12 +330,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)\)\. @@ -333,12 +349,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)\) @@ -353,12 +369,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)\)\. @@ -390,12 +406,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)\)\. @@ -409,7 +425,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -430,7 +446,7 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - + ### Release Summary Bugfix release\. @@ -443,7 +459,7 @@ Bugfix release\. ## v2\.8\.1 - + ### Release Summary Bugfix release\. @@ -456,12 +472,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)\)\. @@ -481,12 +497,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)\)\. @@ -499,12 +515,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)\)\. @@ -519,12 +535,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)\)\. @@ -537,12 +553,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)\)\. @@ -581,7 +597,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -594,12 +610,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)\)\. @@ -614,7 +630,7 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. @@ -628,12 +644,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)\)\. @@ -652,12 +668,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)\)\. @@ -681,12 +697,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)\)\. @@ -722,12 +738,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)\)\. @@ -743,12 +759,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)\)\. @@ -757,7 +773,7 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. @@ -770,7 +786,7 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. @@ -783,7 +799,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\. @@ -796,12 +812,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 fdfeca0..4b28c9c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,19 @@ Community RouterOS Release Notes .. contents:: Topics +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). + v3.1.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 8522a87..1dd758d 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -824,3 +824,13 @@ releases: - 324-fix-firewall-log-and-log-prefix.yaml - 327-add-missing-ip-pool-fields.yml release_date: '2024-12-02' + 3.2.0: + changes: + 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). + release_summary: Feature release. + fragments: + - 3.2.0.yml + - 331-add-routing-filter-community-list.yml + release_date: '2024-12-30' diff --git a/changelogs/fragments/3.2.0.yml b/changelogs/fragments/3.2.0.yml deleted file mode 100644 index 512efc9..0000000 --- a/changelogs/fragments/3.2.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Feature release. diff --git a/changelogs/fragments/331-add-routing-filter-community-list.yml b/changelogs/fragments/331-add-routing-filter-community-list.yml deleted file mode 100644 index e4cb0ba..0000000 --- a/changelogs/fragments/331-add-routing-filter-community-list.yml +++ /dev/null @@ -1,2 +0,0 @@ -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). From dcdca90dd02aec91abf9fd0a301515c4078fac40 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 3 Jan 2025 14:49:49 +0100 Subject: [PATCH 24/96] Add extra sanity test for routeros action group. --- tests/sanity/extra/action-group.json | 12 ++ tests/sanity/extra/action-group.json.license | 3 + tests/sanity/extra/action-group.py | 119 +++++++++++++++++++ 3 files changed, 134 insertions(+) create mode 100644 tests/sanity/extra/action-group.json create mode 100644 tests/sanity/extra/action-group.json.license create mode 100755 tests/sanity/extra/action-group.py diff --git a/tests/sanity/extra/action-group.json b/tests/sanity/extra/action-group.json new file mode 100644 index 0000000..db6a92b --- /dev/null +++ b/tests/sanity/extra/action-group.json @@ -0,0 +1,12 @@ +{ + "include_symlinks": true, + "prefixes": [ + "meta/runtime.yml", + "plugins/modules/", + "tests/sanity/extra/action-group." + ], + "output": "path-message", + "requirements": [ + "pyyaml" + ] +} diff --git a/tests/sanity/extra/action-group.json.license b/tests/sanity/extra/action-group.json.license new file mode 100644 index 0000000..edff8c7 --- /dev/null +++ b/tests/sanity/extra/action-group.json.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 diff --git a/tests/sanity/extra/action-group.py b/tests/sanity/extra/action-group.py new file mode 100755 index 0000000..cc00945 --- /dev/null +++ b/tests/sanity/extra/action-group.py @@ -0,0 +1,119 @@ +#!/usr/bin/env python +# Copyright (c) 2024, Felix Fontein +# 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 +"""Make sure all modules that should show up in the action group.""" + +from __future__ import annotations + +import os +import re +import yaml + + +ACTION_GROUPS = { + # The format is as follows: + # * 'pattern': a regular expression matching all module names potentially belonging to the action group; + # * 'exclusions': a list of modules that are not part of the action group; all other modules matching 'pattern' must be part of it; + # * 'doc_fragment': the docs fragment that documents membership of the action group. + 'api': { + 'pattern': re.compile('^api.*$'), + 'exclusions': [], + 'doc_fragment': 'community.routeros.attributes.actiongroup_api', + }, +} + + +def main(): + """Main entry point.""" + + # Load redirects + meta_runtime = 'meta/runtime.yml' + self_path = 'tests/sanity/extra/action-group.py' + try: + with open(meta_runtime, 'rb') as f: + data = yaml.safe_load(f) + action_groups = data['action_groups'] + except Exception as exc: + print(f'{meta_runtime}: cannot load action groups: {exc}') + return + + for action_group in action_groups: + if action_group not in ACTION_GROUPS: + print(f'{meta_runtime}: found unknown action group {action_group!r}; likely {self_path} needs updating') + for action_group, action_group_data in list(ACTION_GROUPS.items()): + if action_group not in action_groups: + print(f'{meta_runtime}: cannot find action group {action_group!r}; likely {self_path} needs updating') + + modules_directory = 'plugins/modules/' + modules_suffix = '.py' + + for file in os.listdir(modules_directory): + if not file.endswith(modules_suffix): + continue + module_name = file[:-len(modules_suffix)] + + for action_group, action_group_data in ACTION_GROUPS.items(): + action_group_content = action_groups.get(action_group) or [] + path = os.path.join(modules_directory, file) + + if not action_group_data['pattern'].match(module_name): + if module_name in action_group_content: + print(f'{path}: module is in action group {action_group!r} despite not matching its pattern as defined in {self_path}') + continue + + should_be_in_action_group = module_name not in action_group_data['exclusions'] + + if should_be_in_action_group: + if module_name not in action_group_content: + print(f'{meta_runtime}: module {module_name!r} is not part of {action_group!r} action group') + else: + action_group_content.remove(module_name) + + documentation = [] + in_docs = False + with open(path, 'r', encoding='utf-8') as f: + for line in f: + if line.startswith('DOCUMENTATION ='): + in_docs = True + elif line.startswith(("'''", '"""')) and in_docs: + in_docs = False + elif in_docs: + documentation.append(line) + if in_docs: + print(f'{path}: cannot find DOCUMENTATION end') + if not documentation: + print(f'{path}: cannot find DOCUMENTATION') + continue + + try: + docs = yaml.safe_load('\n'.join(documentation)) + if not isinstance(docs, dict): + raise Exception('is not a top-level dictionary') + except Exception as exc: + print(f'{path}: cannot load DOCUMENTATION as YAML: {exc}') + continue + + docs_fragments = docs.get('extends_documentation_fragment') or [] + is_in_action_group = action_group_data['doc_fragment'] in docs_fragments + + if should_be_in_action_group != is_in_action_group: + if should_be_in_action_group: + print( + f'{path}: module does not document itself as part of action group {action_group!r}, but it should;' + f' you need to add {action_group_data["doc_fragment"]} to "extends_documentation_fragment" in DOCUMENTATION' + ) + else: + print(f'{path}: module documents itself as part of action group {action_group!r}, but it should not be') + + for action_group, action_group_data in ACTION_GROUPS.items(): + action_group_content = action_groups.get(action_group) or [] + for module_name in action_group_content: + print( + f'{meta_runtime}: module {module_name} mentioned in {action_group!r} action group' + f' does not exist or does not match pattern defined in {self_path}' + ) + + +if __name__ == '__main__': + main() From 1466c9f984e4570f8c4d530daa868e4348101dff Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 4 Jan 2025 11:25:03 +0100 Subject: [PATCH 25/96] Fix CI badge image URL. Add documentation badge. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f7b488d..bdea3c3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ SPDX-License-Identifier: GPL-3.0-or-later --> # Community RouterOS Collection -[![CI](https://github.com/ansible-collections/community.routeros/workflows/CI/badge.svg?event=push)](https://github.com/ansible-collections/community.routeros/actions) +[![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/ansible/devel/collections/community/routeros/) +[![CI](https://github.com/ansible-collections/community.routeros/actions/workflows/ansible-test.yml/badge.svg?branch=main)](https://github.com/ansible-collections/community.routeros/actions) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.routeros)](https://codecov.io/gh/ansible-collections/community.routeros) [![REUSE status](https://api.reuse.software/badge/github.com/ansible-collections/community.routeros)](https://api.reuse.software/info/github.com/ansible-collections/community.routeros) From f8f86f6ec0b814860128d60d5ea9ebeafcedd54e Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 4 Jan 2025 11:25:03 +0100 Subject: [PATCH 26/96] Fix CI badge image URL. Add documentation badge. (cherry picked from commit 1466c9f984e4570f8c4d530daa868e4348101dff) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9149046..b11b3b1 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,8 @@ SPDX-License-Identifier: GPL-3.0-or-later --> # Community RouterOS Collection -[![CI](https://github.com/ansible-collections/community.routeros/workflows/CI/badge.svg?event=push)](https://github.com/ansible-collections/community.routeros/actions) +[![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/ansible/latest/collections/community/routeros/) +[![CI](https://github.com/ansible-collections/community.routeros/actions/workflows/ansible-test.yml/badge.svg?branch=stable-2)](https://github.com/ansible-collections/community.routeros/actions) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.routeros)](https://codecov.io/gh/ansible-collections/community.routeros) [![REUSE status](https://api.reuse.software/badge/github.com/ansible-collections/community.routeros)](https://api.reuse.software/info/github.com/ansible-collections/community.routeros) From 364ef6c5fea745ad58bf877da3688bc32212f8e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCnch?= Date: Tue, 21 Jan 2025 20:48:38 +0100 Subject: [PATCH 27/96] Fixes #338: Add require-message-auth in radius path (#339) * Fixes #338: Add require-message-auth in radius path Add changelog fragment * Update changelogs/fragments/339-add-require-message-auth-for-radius.yml Co-authored-by: Felix Fontein --------- Co-authored-by: Felix Fontein --- .../fragments/339-add-require-message-auth-for-radius.yml | 2 ++ plugins/module_utils/_api_data.py | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/339-add-require-message-auth-for-radius.yml diff --git a/changelogs/fragments/339-add-require-message-auth-for-radius.yml b/changelogs/fragments/339-add-require-message-auth-for-radius.yml new file mode 100644 index 0000000..7ec322d --- /dev/null +++ b/changelogs/fragments/339-add-require-message-auth-for-radius.yml @@ -0,0 +1,2 @@ +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/pull/339). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 25dd4cb..da85dd3 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -4018,6 +4018,9 @@ PATHS = { 'src-address': KeyInfo(default='0.0.0.0'), 'timeout': KeyInfo(default='300ms'), }, + versioned_fields=[ + ([('7.15', '>=')], 'require-message-auth', KeyInfo(default='yes-for-request-resp')), + ], ), ), ('radius', 'incoming'): APIData( From 11454b802e880ab19cebeb5c47bdf5aac5ae5128 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 21 Jan 2025 21:03:02 +0100 Subject: [PATCH 28/96] Prepare 3.3.0. --- changelogs/fragments/3.3.0.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3.3.0.yml diff --git a/changelogs/fragments/3.3.0.yml b/changelogs/fragments/3.3.0.yml new file mode 100644 index 0000000..512efc9 --- /dev/null +++ b/changelogs/fragments/3.3.0.yml @@ -0,0 +1 @@ +release_summary: Feature release. diff --git a/galaxy.yml b/galaxy.yml index c05b819..f127f37 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.2.0 +version: 3.3.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From 85d24d180ee4b0a21aaacece744b81e7b3b5444b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20M=C3=BCnch?= Date: Fri, 24 Jan 2025 21:40:39 +0100 Subject: [PATCH 29/96] Fixes #284: Implement 'interface wireless access-list' and 'interface wireless connect-list' (#340) Add changelog fragment --- ...rface-wireless-access-and-connect-list.yml | 2 + plugins/module_utils/_api_data.py | 59 +++++++++++++++++++ plugins/modules/api_info.py | 2 + plugins/modules/api_modify.py | 2 + 4 files changed, 65 insertions(+) create mode 100644 changelogs/fragments/340-add-interface-wireless-access-and-connect-list.yml diff --git a/changelogs/fragments/340-add-interface-wireless-access-and-connect-list.yml b/changelogs/fragments/340-add-interface-wireless-access-and-connect-list.yml new file mode 100644 index 0000000..75b6b55 --- /dev/null +++ b/changelogs/fragments/340-add-interface-wireless-access-and-connect-list.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add the ``interface wireless access-list`` and ``interface wireless connect-list`` paths (https://github.com/ansible-collections/community.routeros/issues/284, https://github.com/ansible-collections/community.routeros/pull/340). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index da85dd3..f88950c 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2545,6 +2545,30 @@ PATHS = { }, ), ), + ('interface', 'wireless', 'access-list'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + fields={ + 'allow-signal-out-of-range': KeyInfo(default='10s'), + 'ap-tx-limit': KeyInfo(default=0), + 'authentication': KeyInfo(default=True), + 'client-tx-limit': KeyInfo(default=0), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'forwarding': KeyInfo(default=True), + 'interface': KeyInfo(default='any'), + 'mac-address': KeyInfo(default='00:00:00:00:00:00'), + 'management-protection-key': KeyInfo(default=''), + 'private-algo': KeyInfo(default='none'), + 'private-key': KeyInfo(default=''), + 'private-pre-shared-key': KeyInfo(default=''), + 'signal-range': KeyInfo(default='-120..120'), + 'time': KeyInfo(), + 'vlan-id': KeyInfo(default=1), + 'vlan-mode': KeyInfo(default='default'), + }, + ), + ), ('interface', 'wireless', 'cap'): APIData( unversioned=VersionedAPIData( single_value=True, @@ -2563,6 +2587,41 @@ PATHS = { }, ), ), + ('interface', 'wireless', 'connect-list'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + fields={ + '3gpp': KeyInfo(default=''), + 'allow-signal-out-of-range': KeyInfo(default='10s'), + 'area-prefix': KeyInfo(default=''), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'connect': KeyInfo(default=True), + 'disabled': KeyInfo(default=False), + 'interface': KeyInfo(required=True), + 'interworking': KeyInfo(default='any'), + 'iw-asra': KeyInfo(default='any'), + 'iw-authentication-types': KeyInfo(), + 'iw-connection-capabilities': KeyInfo(), + 'iw-esr': KeyInfo(default='any'), + 'iw-hessid': KeyInfo(default='00:00:00:00:00:00'), + 'iw-hotspot20': KeyInfo(default='any'), + 'iw-hotspot20-dgaf': KeyInfo(default='any'), + 'iw-internet': KeyInfo(default='any'), + 'iw-ipv4-availability': KeyInfo(default='any'), + 'iw-ipv6-availability': KeyInfo(default='any'), + 'iw-network-type': KeyInfo(default='wildcard'), + 'iw-realms': KeyInfo(), + 'iw-roaming-ois': KeyInfo(default=''), + 'iw-uesa': KeyInfo(default='any'), + 'iw-venue': KeyInfo(default='any'), + 'mac-address': KeyInfo(default='00:00:00:00:00:00'), + 'security-profile': KeyInfo(default='none'), + 'signal-range': KeyInfo(default='-120..120'), + 'ssid': KeyInfo(default=''), + 'wireless-protocol': KeyInfo(default='any'), + }, + ), + ), ('interface', 'wireless', 'security-profiles'): APIData( unversioned=VersionedAPIData( fully_understood=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index e68ded0..b4af74c 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -109,8 +109,10 @@ options: - interface wireguard - interface wireguard peers - interface wireless + - interface wireless access-list - interface wireless align - interface wireless cap + - interface wireless connect-list - interface wireless security-profiles - interface wireless sniffer - interface wireless snooper diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index b4a7765..f0ac26d 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -120,8 +120,10 @@ options: - interface wireguard - interface wireguard peers - interface wireless + - interface wireless access-list - interface wireless align - interface wireless cap + - interface wireless connect-list - interface wireless security-profiles - interface wireless sniffer - interface wireless snooper From 575af30d88d52cacb3b10b110e97803e20206da9 Mon Sep 17 00:00:00 2001 From: Peter Petrovich Date: Sun, 26 Jan 2025 12:34:43 +0100 Subject: [PATCH 30/96] DHCPv6 client: add new options from 7.15+ (#341) * script * custom-duid * use-interface-duid * validate-server-duid --- .../341-add-dhcpv6-client-use-interface-duid.yml | 2 ++ plugins/module_utils/_api_data.py | 8 ++++++++ 2 files changed, 10 insertions(+) create mode 100644 changelogs/fragments/341-add-dhcpv6-client-use-interface-duid.yml diff --git a/changelogs/fragments/341-add-dhcpv6-client-use-interface-duid.yml b/changelogs/fragments/341-add-dhcpv6-client-use-interface-duid.yml new file mode 100644 index 0000000..f034497 --- /dev/null +++ b/changelogs/fragments/341-add-dhcpv6-client-use-interface-duid.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add the ``use-interface-duid`` option for ``ipv6 dhcp-client`` path. This option prevents issues with Fritzbox modems and routers, when using virtual interfaces (like VLANs) may create duplicated records in hosts config, this breaks original "expose-host" function. Also add the ``script``, ``custom-duid`` and ``validate-server-duid`` as backport from 7.15 version update (https://github.com/ansible-collections/community.routeros/pull/341). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index f88950c..fc50f4c 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -3544,6 +3544,14 @@ PATHS = { 'request': KeyInfo(), 'use-peer-dns': KeyInfo(default=True), }, + versioned_fields=[ + # Mikrotik does not provide exact version in official changelogs. + # The 7.15 version is the earliest, found option in router config backups: + ([('7.15', '>=')], 'script', KeyInfo(default='')), + ([('7.15', '>=')], 'custom-duid', KeyInfo(default='')), + ([('7.15', '>=')], 'use-interface-duid', KeyInfo(default=False)), + ([('7.15', '>=')], 'validate-server-duid', KeyInfo(default=True)), + ], ), ), ('ipv6', 'dhcp-server'): APIData( From 388366542dc18946e265b757d719ed0156eb9f61 Mon Sep 17 00:00:00 2001 From: Peter Petrovich Date: Sun, 26 Jan 2025 12:52:36 +0100 Subject: [PATCH 31/96] Add 'interface 6to4' path, allows manage 6to4 tunnels like HE (#342) --- .../fragments/342-add-interface-6to4.yml | 2 ++ plugins/module_utils/_api_data.py | 19 +++++++++++++++++++ plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + 4 files changed, 23 insertions(+) create mode 100644 changelogs/fragments/342-add-interface-6to4.yml diff --git a/changelogs/fragments/342-add-interface-6to4.yml b/changelogs/fragments/342-add-interface-6to4.yml new file mode 100644 index 0000000..09396bb --- /dev/null +++ b/changelogs/fragments/342-add-interface-6to4.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add the ``interface 6to4`` path. Used to manage IPv6 tunnels via tunnel-brokers like HE, where native IPv6 is not provided (https://github.com/ansible-collections/community.routeros/pull/342). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index fc50f4c..ce5c555 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -226,6 +226,25 @@ def join_path(path): # 3. All bold attributes go into the `primary_keys` list -- this is not always true! PATHS = { + ('interface', '6to4'): APIData( + unversioned=VersionedAPIData( + fully_understood=True, + primary_keys=('name', ), + fields={ + 'clamp-tcp-mss': KeyInfo(default=True), + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'dont-fragment': KeyInfo(default=False), + 'dscp': KeyInfo(default='inherit'), + 'ipsec-secret': KeyInfo(can_disable=True), + 'keepalive': KeyInfo(default='10s,10', can_disable=True), + 'local-address': KeyInfo(default='0.0.0.0'), + 'mtu': KeyInfo(default='auto'), + 'name': KeyInfo(), + 'remote-address': KeyInfo(required=True), + } + ), + ), ('interface', 'bonding'): APIData( unversioned=VersionedAPIData( fully_understood=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index b4af74c..346a317 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -53,6 +53,7 @@ options: - caps-man provisioning - caps-man security - certificate settings + - interface 6to4 - interface bonding - interface bridge - interface bridge mlag diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index f0ac26d..ef50293 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -64,6 +64,7 @@ options: - caps-man provisioning - caps-man security - certificate settings + - interface 6to4 - interface bonding - interface bridge - interface bridge mlag From f6d50f8cc570c5c761d115ae4007713d3869c19e Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 27 Jan 2025 05:32:10 +0100 Subject: [PATCH 32/96] Release 3.3.0. --- CHANGELOG.md | 243 ++++++++++-------- CHANGELOG.rst | 16 ++ changelogs/changelog.yaml | 25 ++ changelogs/fragments/3.3.0.yml | 1 - ...39-add-require-message-auth-for-radius.yml | 2 - ...rface-wireless-access-and-connect-list.yml | 2 - ...1-add-dhcpv6-client-use-interface-duid.yml | 2 - .../fragments/342-add-interface-6to4.yml | 2 - 8 files changed, 172 insertions(+), 121 deletions(-) delete mode 100644 changelogs/fragments/3.3.0.yml delete mode 100644 changelogs/fragments/339-add-require-message-auth-for-radius.yml delete mode 100644 changelogs/fragments/340-add-interface-wireless-access-and-connect-list.yml delete mode 100644 changelogs/fragments/341-add-dhcpv6-client-use-interface-duid.yml delete mode 100644 changelogs/fragments/342-add-interface-6to4.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9105fc0..3458fc3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,137 +2,140 @@ **Topics** -- v3\.2\.0 +- 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\.2\.0 + +## v3\.3\.0 ### Release Summary @@ -142,17 +145,33 @@ 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)\)\. +* api\_info\, api\_modify \- add the interface 6to4 path\. Used to manage IPv6 tunnels via tunnel\-brokers like HE\, where native IPv6 is not provided \([https\://github\.com/ansible\-collections/community\.routeros/pull/342](https\://github\.com/ansible\-collections/community\.routeros/pull/342)\)\. +* api\_info\, api\_modify \- add the interface wireless access\-list and interface wireless connect\-list paths \([https\://github\.com/ansible\-collections/community\.routeros/issues/284](https\://github\.com/ansible\-collections/community\.routeros/issues/284)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/340](https\://github\.com/ansible\-collections/community\.routeros/pull/340)\)\. +* api\_info\, api\_modify \- add the use\-interface\-duid option for ipv6 dhcp\-client path\. This option prevents issues with Fritzbox modems and routers\, when using virtual interfaces \(like VLANs\) may create duplicated records in hosts config\, this breaks original \"expose\-host\" function\. Also add the script\, custom\-duid and validate\-server\-duid as backport from 7\.15 version update \([https\://github\.com/ansible\-collections/community\.routeros/pull/341](https\://github\.com/ansible\-collections/community\.routeros/pull/341)\)\. + + +## 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)\)\. ## 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)\)\. @@ -165,7 +184,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\. @@ -183,12 +202,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)\)\. @@ -199,12 +218,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)\)\. @@ -216,12 +235,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)\)\. @@ -245,12 +264,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)\)\. @@ -260,12 +279,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)\)\. @@ -274,12 +293,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)\)\. @@ -296,12 +315,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)\)\. @@ -311,12 +330,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)\)\. @@ -330,12 +349,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)\)\. @@ -349,12 +368,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)\) @@ -369,12 +388,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)\)\. @@ -406,12 +425,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)\)\. @@ -425,7 +444,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -446,7 +465,7 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - + ### Release Summary Bugfix release\. @@ -459,7 +478,7 @@ Bugfix release\. ## v2\.8\.1 - + ### Release Summary Bugfix release\. @@ -472,12 +491,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)\)\. @@ -497,12 +516,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)\)\. @@ -515,12 +534,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)\)\. @@ -535,12 +554,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)\)\. @@ -553,12 +572,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)\)\. @@ -597,7 +616,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -610,12 +629,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)\)\. @@ -630,7 +649,7 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. @@ -644,12 +663,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)\)\. @@ -668,12 +687,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)\)\. @@ -697,12 +716,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)\)\. @@ -738,12 +757,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)\)\. @@ -759,12 +778,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)\)\. @@ -773,7 +792,7 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. @@ -786,7 +805,7 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. @@ -799,7 +818,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\. @@ -812,12 +831,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 4b28c9c..8b57038 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,22 @@ Community RouterOS Release Notes .. contents:: Topics +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/pull/339). +- api_info, api_modify - add the ``interface 6to4`` path. Used to manage IPv6 tunnels via tunnel-brokers like HE, where native IPv6 is not provided (https://github.com/ansible-collections/community.routeros/pull/342). +- api_info, api_modify - add the ``interface wireless access-list`` and ``interface wireless connect-list`` paths (https://github.com/ansible-collections/community.routeros/issues/284, https://github.com/ansible-collections/community.routeros/pull/340). +- api_info, api_modify - add the ``use-interface-duid`` option for ``ipv6 dhcp-client`` path. This option prevents issues with Fritzbox modems and routers, when using virtual interfaces (like VLANs) may create duplicated records in hosts config, this breaks original "expose-host" function. Also add the ``script``, ``custom-duid`` and ``validate-server-duid`` as backport from 7.15 version update (https://github.com/ansible-collections/community.routeros/pull/341). + v3.2.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 1dd758d..a4fa82f 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -834,3 +834,28 @@ releases: - 3.2.0.yml - 331-add-routing-filter-community-list.yml release_date: '2024-12-30' + 3.3.0: + changes: + 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/pull/339). + - api_info, api_modify - add the ``interface 6to4`` path. Used to manage IPv6 + tunnels via tunnel-brokers like HE, where native IPv6 is not provided (https://github.com/ansible-collections/community.routeros/pull/342). + - api_info, api_modify - add the ``interface wireless access-list`` and ``interface + wireless connect-list`` paths (https://github.com/ansible-collections/community.routeros/issues/284, + https://github.com/ansible-collections/community.routeros/pull/340). + - api_info, api_modify - add the ``use-interface-duid`` option for ``ipv6 + dhcp-client`` path. This option prevents issues with Fritzbox modems and + routers, when using virtual interfaces (like VLANs) may create duplicated + records in hosts config, this breaks original "expose-host" function. Also + add the ``script``, ``custom-duid`` and ``validate-server-duid`` as backport + from 7.15 version update (https://github.com/ansible-collections/community.routeros/pull/341). + release_summary: Feature release. + fragments: + - 3.3.0.yml + - 339-add-require-message-auth-for-radius.yml + - 340-add-interface-wireless-access-and-connect-list.yml + - 341-add-dhcpv6-client-use-interface-duid.yml + - 342-add-interface-6to4.yml + release_date: '2025-01-27' diff --git a/changelogs/fragments/3.3.0.yml b/changelogs/fragments/3.3.0.yml deleted file mode 100644 index 512efc9..0000000 --- a/changelogs/fragments/3.3.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Feature release. diff --git a/changelogs/fragments/339-add-require-message-auth-for-radius.yml b/changelogs/fragments/339-add-require-message-auth-for-radius.yml deleted file mode 100644 index 7ec322d..0000000 --- a/changelogs/fragments/339-add-require-message-auth-for-radius.yml +++ /dev/null @@ -1,2 +0,0 @@ -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/pull/339). diff --git a/changelogs/fragments/340-add-interface-wireless-access-and-connect-list.yml b/changelogs/fragments/340-add-interface-wireless-access-and-connect-list.yml deleted file mode 100644 index 75b6b55..0000000 --- a/changelogs/fragments/340-add-interface-wireless-access-and-connect-list.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - api_info, api_modify - add the ``interface wireless access-list`` and ``interface wireless connect-list`` paths (https://github.com/ansible-collections/community.routeros/issues/284, https://github.com/ansible-collections/community.routeros/pull/340). diff --git a/changelogs/fragments/341-add-dhcpv6-client-use-interface-duid.yml b/changelogs/fragments/341-add-dhcpv6-client-use-interface-duid.yml deleted file mode 100644 index f034497..0000000 --- a/changelogs/fragments/341-add-dhcpv6-client-use-interface-duid.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - api_info, api_modify - add the ``use-interface-duid`` option for ``ipv6 dhcp-client`` path. This option prevents issues with Fritzbox modems and routers, when using virtual interfaces (like VLANs) may create duplicated records in hosts config, this breaks original "expose-host" function. Also add the ``script``, ``custom-duid`` and ``validate-server-duid`` as backport from 7.15 version update (https://github.com/ansible-collections/community.routeros/pull/341). diff --git a/changelogs/fragments/342-add-interface-6to4.yml b/changelogs/fragments/342-add-interface-6to4.yml deleted file mode 100644 index 09396bb..0000000 --- a/changelogs/fragments/342-add-interface-6to4.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - api_info, api_modify - add the ``interface 6to4`` path. Used to manage IPv6 tunnels via tunnel-brokers like HE, where native IPv6 is not provided (https://github.com/ansible-collections/community.routeros/pull/342). From a9f787fd761894da248a4d9bef079a9c3717ca9c Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 11 Feb 2025 22:50:43 +0100 Subject: [PATCH 33/96] Clean up workflow. --- .github/workflows/ansible-test.yml | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index 4431bea..fa0a9cb 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -36,15 +36,12 @@ jobs: # image for these stable branches. The list of branches where this is necessary will # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 # for the latest list. - runs-on: >- - ${{ contains(fromJson( - '["stable-2.9", "stable-2.10", "stable-2.11"]' - ), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }} + runs-on: ubuntu-latest steps: - name: Perform sanity testing uses: felixfontein/ansible-test-gh-action@main with: - ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.9", "stable-2.10", "stable-2.11"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} + ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.14"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} ansible-core-version: ${{ matrix.ansible }} codecov-token: ${{ secrets.CODECOV_TOKEN }} testing-type: sanity @@ -58,10 +55,7 @@ jobs: # image for these stable branches. The list of branches where this is necessary will # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 # for the latest list. - runs-on: >- - ${{ contains(fromJson( - '["stable-2.9", "stable-2.10", "stable-2.11"]' - ), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }} + runs-on: ubuntu-latest name: Units (Ⓐ${{ matrix.ansible }}) strategy: # As soon as the first unit test fails, cancel the others to free up the CI queue @@ -79,7 +73,7 @@ jobs: Ansible version ${{ matrix.ansible }} uses: felixfontein/ansible-test-gh-action@main with: - ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.9", "stable-2.10", "stable-2.11"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} + ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.14"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} ansible-core-version: ${{ matrix.ansible }} codecov-token: ${{ secrets.CODECOV_TOKEN }} testing-type: units @@ -93,10 +87,7 @@ jobs: # image for these stable branches. The list of branches where this is necessary will # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 # for the latest list. - runs-on: >- - ${{ contains(fromJson( - '["stable-2.9", "stable-2.10", "stable-2.11"]' - ), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }} + runs-on: ubuntu-latest name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}) strategy: fail-fast: false @@ -133,7 +124,7 @@ jobs: under Python ${{ matrix.python }} uses: felixfontein/ansible-test-gh-action@main with: - ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.9", "stable-2.10", "stable-2.11"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} + ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.14"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} ansible-core-version: ${{ matrix.ansible }} codecov-token: ${{ secrets.CODECOV_TOKEN }} integration-continue-on-error: 'false' From 9e4b6c197d26f36785f2297d7b10568fa6173f81 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 14 Feb 2025 23:26:11 +0100 Subject: [PATCH 34/96] Remove outdated comments. --- .github/workflows/ansible-test.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index fa0a9cb..4835b43 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -31,11 +31,6 @@ jobs: - stable-2.17 - stable-2.18 - devel - # Ansible-test on various stable branches does not yet work well with cgroups v2. - # Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04 - # image for these stable branches. The list of branches where this is necessary will - # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 - # for the latest list. runs-on: ubuntu-latest steps: - name: Perform sanity testing @@ -50,11 +45,6 @@ jobs: git+https://github.com/ansible-collections/ansible.netcommon.git,main units: - # Ansible-test on various stable branches does not yet work well with cgroups v2. - # Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04 - # image for these stable branches. The list of branches where this is necessary will - # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 - # for the latest list. runs-on: ubuntu-latest name: Units (Ⓐ${{ matrix.ansible }}) strategy: @@ -82,11 +72,6 @@ jobs: git+https://github.com/ansible-collections/ansible.netcommon.git,main integration: - # Ansible-test on various stable branches does not yet work well with cgroups v2. - # Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04 - # image for these stable branches. The list of branches where this is necessary will - # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 - # for the latest list. runs-on: ubuntu-latest name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}) strategy: From e302fed6cf1fda0f5e64f1af7113378fae69963f Mon Sep 17 00:00:00 2001 From: Tim de Boer Date: Tue, 18 Feb 2025 20:25:40 +0000 Subject: [PATCH 35/96] Added support for 'ip dns forwarders' (#343) --- .../fragments/343-add-ip-dns-forwarders.yml | 2 ++ plugins/module_utils/_api_data.py | 16 ++++++++++++++++ plugins/modules/api_info.py | 1 + plugins/modules/api_modify.py | 1 + 4 files changed, 20 insertions(+) create mode 100644 changelogs/fragments/343-add-ip-dns-forwarders.yml diff --git a/changelogs/fragments/343-add-ip-dns-forwarders.yml b/changelogs/fragments/343-add-ip-dns-forwarders.yml new file mode 100644 index 0000000..cd0a500 --- /dev/null +++ b/changelogs/fragments/343-add-ip-dns-forwarders.yml @@ -0,0 +1,2 @@ +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). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index ce5c555..d1e2bbb 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2997,6 +2997,22 @@ PATHS = { )), ], ), + ('ip', 'dns', 'forwarders'): APIData( + versioned=[ + ('7.17', '>=', VersionedAPIData( + fully_understood=True, + required_one_of=[['dns-servers', 'doh-servers']], + fields={ + 'comment': KeyInfo(can_disable=True, remove_value=''), + 'disabled': KeyInfo(default=False), + 'dns-servers': KeyInfo(default=''), + 'doh-servers': KeyInfo(default=''), + 'name': KeyInfo(required=True), + 'verify-doh-cert': KeyInfo(default=True), + }, + )), + ], + ), ('ip', 'dns', 'static'): APIData( unversioned=VersionedAPIData( fully_understood=True, diff --git a/plugins/modules/api_info.py b/plugins/modules/api_info.py index 346a317..b94e987 100644 --- a/plugins/modules/api_info.py +++ b/plugins/modules/api_info.py @@ -136,6 +136,7 @@ options: - ip dhcp-server option sets - ip dns - ip dns adlist + - ip dns forwarders - ip dns static - ip firewall address-list - ip firewall connection tracking diff --git a/plugins/modules/api_modify.py b/plugins/modules/api_modify.py index ef50293..1fb4dae 100644 --- a/plugins/modules/api_modify.py +++ b/plugins/modules/api_modify.py @@ -147,6 +147,7 @@ options: - ip dhcp-server option sets - ip dns - ip dns adlist + - ip dns forwarders - ip dns static - ip firewall address-list - ip firewall connection tracking From 3ba33ccd99f4d3cb13a7ce443ddb5f7e3235b940 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 24 Feb 2025 06:16:06 +0100 Subject: [PATCH 36/96] Remove primary key. (#345) --- changelogs/fragments/345-interface-wifi-provisioning.yml | 4 ++++ plugins/module_utils/_api_data.py | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/345-interface-wifi-provisioning.yml diff --git a/changelogs/fragments/345-interface-wifi-provisioning.yml b/changelogs/fragments/345-interface-wifi-provisioning.yml new file mode 100644 index 0000000..595b7f5 --- /dev/null +++ b/changelogs/fragments/345-interface-wifi-provisioning.yml @@ -0,0 +1,4 @@ +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/pull/345)." diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index d1e2bbb..5ff335e 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2037,7 +2037,6 @@ PATHS = { versioned=[ ('7.13', '>=', VersionedAPIData( fully_understood=True, - primary_keys=('action', ), fields={ 'action': KeyInfo(default='none'), 'address-ranges': KeyInfo(can_disable=True), From f54244b7d0b35dcb80f8f23fcf244ef62d53dfe9 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 24 Feb 2025 06:08:45 +0100 Subject: [PATCH 37/96] Prepare 3.4.0. --- changelogs/fragments/3.4.0.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3.4.0.yml diff --git a/changelogs/fragments/3.4.0.yml b/changelogs/fragments/3.4.0.yml new file mode 100644 index 0000000..80287c3 --- /dev/null +++ b/changelogs/fragments/3.4.0.yml @@ -0,0 +1 @@ +release_summary: Feature and bugfix release. diff --git a/galaxy.yml b/galaxy.yml index f127f37..704ec35 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.3.0 +version: 3.4.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From ffc928242b9c1e40bb828c51dfde0523cb997dd1 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 24 Feb 2025 06:33:52 +0100 Subject: [PATCH 38/96] Release 3.4.0. --- CHANGELOG.md | 376 +++++++++--------- CHANGELOG.rst | 18 + changelogs/changelog.yaml | 16 + changelogs/fragments/3.4.0.yml | 1 - .../fragments/343-add-ip-dns-forwarders.yml | 2 - .../345-interface-wifi-provisioning.yml | 4 - 6 files changed, 233 insertions(+), 184 deletions(-) delete mode 100644 changelogs/fragments/3.4.0.yml delete mode 100644 changelogs/fragments/343-add-ip-dns-forwarders.yml delete mode 100644 changelogs/fragments/345-interface-wifi-provisioning.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 3458fc3..3ce4976 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,149 +2,171 @@ **Topics** -- 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 - - Bugfixes -- v3\.0\.0 +- v3\.1\.0 - Release Summary + - Minor Changes + - Bugfixes +- v3\.0\.0 + - 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 - - Deprecated Features - - Bugfixes -- v2\.17\.0 +- v2\.18\.0 - Release Summary - Minor Changes -- v2\.16\.0 + - Deprecated Features + - Bugfixes +- v2\.17\.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\.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 - Bugfixes -- v2\.6\.0 +- v2\.7\.0 - Release Summary - Minor Changes - Bugfixes -- v2\.5\.0 +- v2\.6\.0 - Release Summary - Minor Changes - Bugfixes -- v2\.4\.0 +- v2\.5\.0 - Release Summary - Minor Changes - Bugfixes - - Known Issues -- v2\.3\.1 +- v2\.4\.0 - Release Summary - - Known Issues -- v2\.3\.0 - - Release Summary - Minor Changes - Bugfixes -- v2\.2\.1 + - Known Issues +- v2\.3\.1 + - Release Summary + - Known Issues +- v2\.3\.0 - Release Summary - - Bugfixes -- v2\.2\.0 - - Release Summary - Minor Changes + - Bugfixes +- v2\.2\.1 + - Release Summary - Bugfixes - - New Modules -- v2\.1\.0 +- v2\.2\.0 - Release Summary - Minor Changes - Bugfixes - - New Modules -- v2\.0\.0 + - New Modules +- v2\.1\.0 - Release Summary - Minor Changes - - Breaking Changes / Porting Guide - Bugfixes + - New Modules +- v2\.0\.0 + - 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 - - Release Summary - Bugfixes -- v1\.0\.0 +- v1\.1\.0 + - Release Summary + - Minor Changes +- v1\.0\.1 - Release Summary - Bugfixes -- v0\.1\.1 +- v1\.0\.0 - Release Summary - Bugfixes -- v0\.1\.0 +- v0\.1\.1 - Release Summary - - Minor Changes + - Bugfixes +- v0\.1\.0 + - Release Summary + - Minor Changes - -## v3\.3\.0 + +## v3\.4\.0 ### Release Summary -Feature release\. +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)\)\. + + +### 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)\)\. + + +## 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)\)\. * api\_info\, api\_modify \- add the interface 6to4 path\. Used to manage IPv6 tunnels via tunnel\-brokers like HE\, where native IPv6 is not provided \([https\://github\.com/ansible\-collections/community\.routeros/pull/342](https\://github\.com/ansible\-collections/community\.routeros/pull/342)\)\. * api\_info\, api\_modify \- add the interface wireless access\-list and interface wireless connect\-list paths \([https\://github\.com/ansible\-collections/community\.routeros/issues/284](https\://github\.com/ansible\-collections/community\.routeros/issues/284)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/340](https\://github\.com/ansible\-collections/community\.routeros/pull/340)\)\. @@ -153,12 +175,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)\)\. @@ -166,17 +188,17 @@ 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)\)\. - + ### 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)\)\. @@ -184,7 +206,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\. @@ -202,12 +224,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)\)\. @@ -218,12 +240,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)\)\. @@ -235,12 +257,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)\)\. @@ -256,7 +278,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)\)\. @@ -264,21 +286,6 @@ 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)\)\. -* api\_info\, api\_modify \- add missing path /system resource irq rps \([https\://github\.com/ansible\-collections/community\.routeros/pull/295](https\://github\.com/ansible\-collections/community\.routeros/pull/295)\)\. -* api\_info\, api\_modify \- add parameter host\-key\-type for ip ssh path \([https\://github\.com/ansible\-collections/community\.routeros/issues/280](https\://github\.com/ansible\-collections/community\.routeros/issues/280)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/297](https\://github\.com/ansible\-collections/community\.routeros/pull/297)\)\. - - -## v2\.16\.0 - ### Release Summary @@ -287,11 +294,12 @@ 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)\)\. -* api\_info\, api\_modify \- minor changes /interface ethernet path fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/288](https\://github\.com/ansible\-collections/community\.routeros/pull/288)\)\. +* 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)\)\. +* api\_info\, api\_modify \- add missing path /system resource irq rps \([https\://github\.com/ansible\-collections/community\.routeros/pull/295](https\://github\.com/ansible\-collections/community\.routeros/pull/295)\)\. +* api\_info\, api\_modify \- add parameter host\-key\-type for ip ssh path \([https\://github\.com/ansible\-collections/community\.routeros/issues/280](https\://github\.com/ansible\-collections/community\.routeros/issues/280)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/297](https\://github\.com/ansible\-collections/community\.routeros/pull/297)\)\. - -## v2\.15\.0 + +## v2\.16\.0 ### Release Summary @@ -301,6 +309,20 @@ 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)\)\. +* api\_info\, api\_modify \- minor changes /interface ethernet path fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/288](https\://github\.com/ansible\-collections/community\.routeros/pull/288)\)\. + + +## 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)\)\. * api\_info\, api\_modify \- add /ip route rule path for RouterOS 6\.x \([https\://github\.com/ansible\-collections/community\.routeros/pull/278](https\://github\.com/ansible\-collections/community\.routeros/pull/278)\)\. * api\_info\, api\_modify \- add /routing filter path for RouterOS 6\.x \([https\://github\.com/ansible\-collections/community\.routeros/pull/279](https\://github\.com/ansible\-collections/community\.routeros/pull/279)\)\. @@ -315,12 +337,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)\)\. @@ -330,18 +352,18 @@ 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)\)\. * 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)\)\. @@ -349,12 +371,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)\)\. @@ -368,12 +390,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)\) @@ -388,12 +410,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)\)\. @@ -417,7 +439,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)\)\. @@ -425,18 +447,18 @@ 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)\)\. * 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)\)\. @@ -444,7 +466,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -465,19 +487,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 @@ -486,35 +495,23 @@ 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)\)\. +* 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\.0 + +## v2\.8\.1 ### 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)\)\. -* api\_modify \- add support for API path snmp community \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. -* api\_modify \- add support for trap\-interfaces in API path snmp \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. -* api\_modify \- add support to disable IPv6 in API paths ipv6 settings \([https\://github\.com/ansible\-collections/community\.routeros/pull/158](https\://github\.com/ansible\-collections/community\.routeros/pull/158)\)\. -* 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)\)\. +Bugfix release\. ### 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)\)\. -* api\_modify \- fix handling of disabled keys on creation \([https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\. -* various plugins and modules \- remove unnecessary imports \([https\://github\.com/ansible\-collections/community\.routeros/pull/149](https\://github\.com/ansible\-collections/community\.routeros/pull/149)\)\. +* 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\.7\.0 + +## v2\.8\.0 ### Release Summary @@ -524,28 +521,53 @@ 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)\)\. +* 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)\)\. +* api\_modify \- add support for API path snmp community \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. +* api\_modify \- add support for trap\-interfaces in API path snmp \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. +* api\_modify \- add support to disable IPv6 in API paths ipv6 settings \([https\://github\.com/ansible\-collections/community\.routeros/pull/158](https\://github\.com/ansible\-collections/community\.routeros/pull/158)\)\. +* 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)\)\. +* api\_modify \- fix handling of disabled keys on creation \([https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\. +* various plugins and modules \- remove unnecessary imports \([https\://github\.com/ansible\-collections/community\.routeros/pull/149](https\://github\.com/ansible\-collections/community\.routeros/pull/149)\)\. + + +## 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)\)\. + + +### 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)\)\. ## 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)\)\. * 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)\)\. @@ -554,17 +576,17 @@ 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)\)\. - + ### 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)\)\. @@ -572,12 +594,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)\)\. @@ -598,7 +620,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)\)\. @@ -616,7 +638,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -629,19 +651,19 @@ 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)\)\. * 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)\)\. @@ -649,12 +671,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)\)\. @@ -663,17 +685,17 @@ 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)\)\. - + ### 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)\)\. @@ -687,12 +709,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)\)\. @@ -701,7 +723,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)\)\. @@ -716,12 +738,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)\)\. @@ -735,7 +757,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)\)\. @@ -757,12 +779,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)\)\. @@ -770,7 +792,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)\)\. @@ -778,12 +800,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)\)\. @@ -792,12 +814,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)\)\. @@ -805,12 +827,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)\)\. @@ -818,12 +840,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)\)\. @@ -831,12 +853,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 8b57038..34a847d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,24 @@ Community RouterOS Release Notes .. contents:: Topics +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). + +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/pull/345). + v3.3.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index a4fa82f..d76afb0 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -859,3 +859,19 @@ releases: - 341-add-dhcpv6-client-use-interface-duid.yml - 342-add-interface-6to4.yml release_date: '2025-01-27' + 3.4.0: + changes: + 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/pull/345). + 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). + release_summary: Feature and bugfix release. + fragments: + - 3.4.0.yml + - 343-add-ip-dns-forwarders.yml + - 345-interface-wifi-provisioning.yml + release_date: '2025-02-24' diff --git a/changelogs/fragments/3.4.0.yml b/changelogs/fragments/3.4.0.yml deleted file mode 100644 index 80287c3..0000000 --- a/changelogs/fragments/3.4.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Feature and bugfix release. diff --git a/changelogs/fragments/343-add-ip-dns-forwarders.yml b/changelogs/fragments/343-add-ip-dns-forwarders.yml deleted file mode 100644 index cd0a500..0000000 --- a/changelogs/fragments/343-add-ip-dns-forwarders.yml +++ /dev/null @@ -1,2 +0,0 @@ -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). diff --git a/changelogs/fragments/345-interface-wifi-provisioning.yml b/changelogs/fragments/345-interface-wifi-provisioning.yml deleted file mode 100644 index 595b7f5..0000000 --- a/changelogs/fragments/345-interface-wifi-provisioning.yml +++ /dev/null @@ -1,4 +0,0 @@ -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/pull/345)." From 6aaead1d4a6aee4a64cba06647d3e2e3cb012783 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 3 Mar 2025 19:00:16 +0100 Subject: [PATCH 39/96] Group CI updates. --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2f4ff90..f71b322 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -9,3 +9,7 @@ updates: directory: "/" schedule: interval: "weekly" + groups: + ci: + patterns: + - "*" From be9a7ed3ad9db5d8e83f768b8cd600d2af5347f7 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 7 Mar 2025 20:45:39 +0100 Subject: [PATCH 40/96] Improve tests (#348) * Simplify filter error tests. * Convert set_module_args to context manager. --- .../targets/filter_quoting/tasks/main.yml | 2 +- tests/unit/plugins/modules/test_api.py | 76 ++++---- tests/unit/plugins/modules/test_api_facts.py | 12 +- .../modules/test_api_find_and_modify.py | 68 +++---- tests/unit/plugins/modules/test_api_info.py | 72 ++++---- tests/unit/plugins/modules/test_api_modify.py | 172 +++++++++--------- tests/unit/plugins/modules/test_command.py | 36 ++-- tests/unit/plugins/modules/test_facts.py | 20 +- tests/unit/plugins/modules/utils.py | 7 +- 9 files changed, 234 insertions(+), 231 deletions(-) diff --git a/tests/integration/targets/filter_quoting/tasks/main.yml b/tests/integration/targets/filter_quoting/tasks/main.yml index e7a2d29..c80af59 100644 --- a/tests/integration/targets/filter_quoting/tasks/main.yml +++ b/tests/integration/targets/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: diff --git a/tests/unit/plugins/modules/test_api.py b/tests/unit/plugins/modules/test_api.py index 4cfdeef..5df8430 100644 --- a/tests/unit/plugins/modules/test_api.py +++ b/tests/unit/plugins/modules/test_api.py @@ -34,8 +34,8 @@ class TestRouterosApiModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -43,8 +43,8 @@ class TestRouterosApiModule(ModuleTestCase): @patch('ansible_collections.community.routeros.plugins.modules.api.ROS_api_module.api_add_path', new=fake_ros_api.path) def test_api_path(self): with self.assertRaises(AnsibleExitJson) as exc: - set_module_args(self.config_module_args.copy()) - self.module.main() + with set_module_args(self.config_module_args.copy()): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -54,8 +54,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['add'] = "name=unit_test_brige" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -65,8 +65,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['add'] = "name=unit_test_brige_exist" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -77,8 +77,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['remove'] = "*A1" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -88,8 +88,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['remove'] = "*A2" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -100,8 +100,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['cmd'] = "add name=unit_test_brige_arbitrary" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -111,8 +111,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['cmd'] = "add NONE_EXIST=unit_test_brige_arbitrary" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -123,8 +123,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['update'] = ".id=*A1 name=unit_test_brige" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -134,8 +134,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['update'] = ".id=*A2 name=unit_test_brige" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -146,8 +146,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['query'] = ".id name" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -162,8 +162,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['query'] = ".id other" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -174,8 +174,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['query'] = ".id name WHERE name == dummy_bridge_A2" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -188,8 +188,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['query'] = ".id name WHERE name != dummy_bridge_A2" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -204,8 +204,8 @@ class TestRouterosApiModule(ModuleTestCase): module_args['extended_query'] = { 'attributes': ['.id', 'name'], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -222,8 +222,8 @@ class TestRouterosApiModule(ModuleTestCase): module_args['extended_query'] = { 'attributes': ['.id', 'other'], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -243,8 +243,8 @@ class TestRouterosApiModule(ModuleTestCase): }, ], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -266,8 +266,8 @@ class TestRouterosApiModule(ModuleTestCase): }, ], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -298,8 +298,8 @@ class TestRouterosApiModule(ModuleTestCase): }, ], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) diff --git a/tests/unit/plugins/modules/test_api_facts.py b/tests/unit/plugins/modules/test_api_facts.py index 64985f8..f9c76be 100644 --- a/tests/unit/plugins/modules/test_api_facts.py +++ b/tests/unit/plugins/modules/test_api_facts.py @@ -437,8 +437,8 @@ class TestRouterosApiFactsModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -447,8 +447,8 @@ class TestRouterosApiFactsModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['gather_subset'] = ['!foobar'] - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -456,8 +456,8 @@ class TestRouterosApiFactsModule(ModuleTestCase): def test_full_run(self): with self.assertRaises(AnsibleExitJson) as exc: - set_module_args(self.config_module_args.copy()) - self.module.main() + with set_module_args(self.config_module_args.copy()): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) 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 e6eb00b..b25fbce 100644 --- a/tests/unit/plugins/modules/test_api_find_and_modify.py +++ b/tests/unit/plugins/modules/test_api_find_and_modify.py @@ -117,8 +117,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -136,8 +136,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'bar', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -155,8 +155,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'bar', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -173,8 +173,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): '!comment': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -190,8 +190,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): '!comment': 'gone', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -212,8 +212,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): }, 'require_matches_min': 10, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -234,8 +234,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): }, 'require_matches_min': 10, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -256,8 +256,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): }, 'require_matches_max': 1, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -277,8 +277,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'name': 'bam', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -303,8 +303,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'require_matches_min': 2, 'allow_no_matches': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -325,8 +325,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'values': { }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -349,8 +349,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -374,8 +374,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): }, '_ansible_diff': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -450,8 +450,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -502,8 +502,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': '', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -553,8 +553,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): '!comment': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -606,8 +606,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): '!connection-state': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) diff --git a/tests/unit/plugins/modules/test_api_info.py b/tests/unit/plugins/modules/test_api_info.py index 1c9d014..d20aa11 100644 --- a/tests/unit/plugins/modules/test_api_info.py +++ b/tests/unit/plugins/modules/test_api_info.py @@ -41,8 +41,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -53,8 +53,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): args.update({ 'path': 'something invalid' }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -68,8 +68,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): args.update({ 'path': 'ip dns static' }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -93,8 +93,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): args.update({ 'path': 'caps-man aaa', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -122,8 +122,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'caps-man aaa', 'hide_defaults': False, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -155,8 +155,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'caps-man aaa', 'unfiltered': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -189,8 +189,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'ip firewall filter', 'handle_disabled': 'exclamation', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -278,8 +278,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'ip firewall filter', 'handle_disabled': 'null-value', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -367,8 +367,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'ip firewall filter', 'handle_disabled': 'omit', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -402,8 +402,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'handle_disabled': 'omit', 'include_dynamic': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -460,8 +460,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'interface list', 'handle_disabled': 'omit', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -513,8 +513,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'handle_disabled': 'omit', 'include_builtin': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -605,8 +605,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'ip dhcp-server lease', 'handle_disabled': 'omit', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -688,8 +688,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): args.update({ 'path': 'interface gre', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -776,8 +776,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'handle_disabled': 'omit', 'hide_defaults': False, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -847,8 +847,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'handle_disabled': 'omit', 'restrict': [], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -899,8 +899,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'values': ['forward'], }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -970,8 +970,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) diff --git a/tests/unit/plugins/modules/test_api_modify.py b/tests/unit/plugins/modules/test_api_modify.py index f4aa777..20e29e1 100644 --- a/tests/unit/plugins/modules/test_api_modify.py +++ b/tests/unit/plugins/modules/test_api_modify.py @@ -318,8 +318,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -331,8 +331,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'path': 'something invalid', 'data': [], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -348,8 +348,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'foo': 'bar', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -366,8 +366,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): '!comment': None, }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -383,8 +383,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): '!disabled': None, }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -400,8 +400,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): '!comment': 'foo', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -416,8 +416,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'name': None, }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -432,8 +432,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'interface': 'eth0', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -448,8 +448,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'address': '192.168.88.1', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -466,8 +466,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'address': '192.168.88.1', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -498,8 +498,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -533,8 +533,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -556,8 +556,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -591,8 +591,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -656,8 +656,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -722,8 +722,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): ], '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -785,8 +785,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -844,8 +844,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -903,8 +903,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -963,8 +963,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1017,8 +1017,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1077,8 +1077,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1128,8 +1128,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1164,8 +1164,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1212,8 +1212,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1285,8 +1285,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'ensure_order': True, '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1340,8 +1340,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1363,8 +1363,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): ], 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1386,8 +1386,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1426,8 +1426,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): ], '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1466,8 +1466,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): ], 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1507,8 +1507,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1551,8 +1551,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1587,8 +1587,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1621,8 +1621,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1676,8 +1676,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1729,8 +1729,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1785,8 +1785,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'ensure_order': True, '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1847,8 +1847,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1879,8 +1879,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1911,8 +1911,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1969,8 +1969,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -2005,8 +2005,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) diff --git a/tests/unit/plugins/modules/test_command.py b/tests/unit/plugins/modules/test_command.py index 3fc5865..72fbfd6 100644 --- a/tests/unit/plugins/modules/test_command.py +++ b/tests/unit/plugins/modules/test_command.py @@ -47,54 +47,54 @@ class TestRouterosCommandModule(TestRouterosModule): self.run_commands.side_effect = load_from_file def test_command_simple(self): - set_module_args(dict(commands=['/system resource print'])) - result = self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print'])): + result = self.execute_module(changed=True) self.assertEqual(len(result['stdout']), 1) self.assertTrue('platform: "MikroTik"' in result['stdout'][0]) def test_command_multiple(self): - set_module_args(dict(commands=['/system resource print', '/system resource print'])) - result = self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print', '/system resource print'])): + result = self.execute_module(changed=True) self.assertEqual(len(result['stdout']), 2) self.assertTrue('platform: "MikroTik"' in result['stdout'][0]) def test_command_wait_for(self): wait_for = 'result[0] contains "MikroTik"' - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for)) - self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for)): + self.execute_module(changed=True) def test_command_wait_for_fails(self): wait_for = 'result[0] contains "test string"' - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for)) - self.execute_module(failed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for)): + self.execute_module(failed=True) self.assertEqual(self.run_commands.call_count, 10) def test_command_retries(self): wait_for = 'result[0] contains "test string"' - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, retries=2)) - self.execute_module(failed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, retries=2)): + self.execute_module(failed=True) self.assertEqual(self.run_commands.call_count, 2) def test_command_match_any(self): wait_for = ['result[0] contains "MikroTik"', 'result[0] contains "test string"'] - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, match='any')) - self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, match='any')): + self.execute_module(changed=True) def test_command_match_all(self): wait_for = ['result[0] contains "MikroTik"', 'result[0] contains "RB1100"'] - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, match='all')) - self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, match='all')): + self.execute_module(changed=True) def test_command_match_all_failure(self): wait_for = ['result[0] contains "MikroTik"', 'result[0] contains "test string"'] commands = ['/system resource print', '/system resource print'] - set_module_args(dict(commands=commands, wait_for=wait_for, match='all')) - self.execute_module(failed=True) + with set_module_args(dict(commands=commands, wait_for=wait_for, match='all')): + self.execute_module(failed=True) def test_command_wait_for_2(self): wait_for = 'result[0] contains "wireless"' - set_module_args(dict(commands=['/system package print'], wait_for=wait_for)) - self.execute_module(changed=True) + with set_module_args(dict(commands=['/system package print'], wait_for=wait_for)): + self.execute_module(changed=True) diff --git a/tests/unit/plugins/modules/test_facts.py b/tests/unit/plugins/modules/test_facts.py index 322fdda..a7e2c8b 100644 --- a/tests/unit/plugins/modules/test_facts.py +++ b/tests/unit/plugins/modules/test_facts.py @@ -39,8 +39,8 @@ class TestRouterosFactsModule(TestRouterosModule): self.run_commands.side_effect = load_from_file def test_facts_default(self): - set_module_args(dict(gather_subset='default')) - result = self.execute_module() + with set_module_args(dict(gather_subset='default')): + result = self.execute_module() self.assertEqual( result['ansible_facts']['ansible_net_hostname'], 'MikroTik' ) @@ -61,8 +61,8 @@ class TestRouterosFactsModule(TestRouterosModule): ) def test_facts_hardware(self): - set_module_args(dict(gather_subset='hardware')) - result = self.execute_module() + with set_module_args(dict(gather_subset='hardware')): + result = self.execute_module() self.assertEqual( result['ansible_facts']['ansible_net_spacefree_mb'], 64921.6 ) @@ -77,8 +77,8 @@ class TestRouterosFactsModule(TestRouterosModule): ) def test_facts_config(self): - set_module_args(dict(gather_subset='config')) - result = self.execute_module() + with set_module_args(dict(gather_subset='config')): + result = self.execute_module() self.assertIsInstance( result['ansible_facts']['ansible_net_config'], str ) @@ -88,8 +88,8 @@ class TestRouterosFactsModule(TestRouterosModule): ) def test_facts_interfaces(self): - set_module_args(dict(gather_subset='interfaces')) - result = self.execute_module() + with set_module_args(dict(gather_subset='interfaces')): + result = self.execute_module() self.assertIn( result['ansible_facts']['ansible_net_all_ipv4_addresses'][0], ['10.37.129.3', '10.37.0.0', '192.168.88.1'] ) @@ -118,8 +118,8 @@ class TestRouterosFactsModule(TestRouterosModule): self.assertEqual(result, None) def test_facts_routing(self): - set_module_args(dict(gather_subset='routing')) - result = self.execute_module() + with set_module_args(dict(gather_subset='routing')): + result = self.execute_module() self.assertIn( result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['name'], ['iBGP_BRAS.TYRMA'] ) diff --git a/tests/unit/plugins/modules/utils.py b/tests/unit/plugins/modules/utils.py index 419eef1..0926190 100644 --- a/tests/unit/plugins/modules/utils.py +++ b/tests/unit/plugins/modules/utils.py @@ -5,6 +5,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type +import contextlib as _contextlib import json from ansible_collections.community.routeros.tests.unit.compat import unittest @@ -13,14 +14,16 @@ from ansible.module_utils import basic from ansible.module_utils.common.text.converters import to_bytes +@_contextlib.contextmanager def set_module_args(args): if '_ansible_remote_tmp' not in args: args['_ansible_remote_tmp'] = '/tmp' if '_ansible_keep_remote_files' not in args: args['_ansible_keep_remote_files'] = False - args = json.dumps({'ANSIBLE_MODULE_ARGS': args}) - basic._ANSIBLE_ARGS = to_bytes(args) + serialized_args = to_bytes(json.dumps({'ANSIBLE_MODULE_ARGS': args})) + with patch.object(basic, '_ANSIBLE_ARGS', serialized_args): + yield class AnsibleExitJson(Exception): From c5f1fb50d7f3de3a1893fd8284c94be99e33b072 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 7 Mar 2025 20:45:39 +0100 Subject: [PATCH 41/96] Improve tests (#348) * Simplify filter error tests. * Convert set_module_args to context manager. (cherry picked from commit be9a7ed3ad9db5d8e83f768b8cd600d2af5347f7) --- .../targets/filter_quoting/tasks/main.yml | 2 +- tests/unit/plugins/modules/test_api.py | 76 ++++---- tests/unit/plugins/modules/test_api_facts.py | 12 +- .../modules/test_api_find_and_modify.py | 68 +++---- tests/unit/plugins/modules/test_api_info.py | 72 ++++---- tests/unit/plugins/modules/test_api_modify.py | 172 +++++++++--------- tests/unit/plugins/modules/test_command.py | 36 ++-- tests/unit/plugins/modules/test_facts.py | 20 +- tests/unit/plugins/modules/utils.py | 7 +- 9 files changed, 234 insertions(+), 231 deletions(-) diff --git a/tests/integration/targets/filter_quoting/tasks/main.yml b/tests/integration/targets/filter_quoting/tasks/main.yml index e7a2d29..c80af59 100644 --- a/tests/integration/targets/filter_quoting/tasks/main.yml +++ b/tests/integration/targets/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: diff --git a/tests/unit/plugins/modules/test_api.py b/tests/unit/plugins/modules/test_api.py index 4cfdeef..5df8430 100644 --- a/tests/unit/plugins/modules/test_api.py +++ b/tests/unit/plugins/modules/test_api.py @@ -34,8 +34,8 @@ class TestRouterosApiModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -43,8 +43,8 @@ class TestRouterosApiModule(ModuleTestCase): @patch('ansible_collections.community.routeros.plugins.modules.api.ROS_api_module.api_add_path', new=fake_ros_api.path) def test_api_path(self): with self.assertRaises(AnsibleExitJson) as exc: - set_module_args(self.config_module_args.copy()) - self.module.main() + with set_module_args(self.config_module_args.copy()): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -54,8 +54,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['add'] = "name=unit_test_brige" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -65,8 +65,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['add'] = "name=unit_test_brige_exist" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -77,8 +77,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['remove'] = "*A1" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -88,8 +88,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['remove'] = "*A2" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -100,8 +100,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['cmd'] = "add name=unit_test_brige_arbitrary" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -111,8 +111,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['cmd'] = "add NONE_EXIST=unit_test_brige_arbitrary" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -123,8 +123,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['update'] = ".id=*A1 name=unit_test_brige" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -134,8 +134,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['update'] = ".id=*A2 name=unit_test_brige" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -146,8 +146,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['query'] = ".id name" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -162,8 +162,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['query'] = ".id other" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -174,8 +174,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['query'] = ".id name WHERE name == dummy_bridge_A2" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -188,8 +188,8 @@ class TestRouterosApiModule(ModuleTestCase): with self.assertRaises(AnsibleExitJson) as exc: module_args = self.config_module_args.copy() module_args['query'] = ".id name WHERE name != dummy_bridge_A2" - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -204,8 +204,8 @@ class TestRouterosApiModule(ModuleTestCase): module_args['extended_query'] = { 'attributes': ['.id', 'name'], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -222,8 +222,8 @@ class TestRouterosApiModule(ModuleTestCase): module_args['extended_query'] = { 'attributes': ['.id', 'other'], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -243,8 +243,8 @@ class TestRouterosApiModule(ModuleTestCase): }, ], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -266,8 +266,8 @@ class TestRouterosApiModule(ModuleTestCase): }, ], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -298,8 +298,8 @@ class TestRouterosApiModule(ModuleTestCase): }, ], } - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) diff --git a/tests/unit/plugins/modules/test_api_facts.py b/tests/unit/plugins/modules/test_api_facts.py index 64985f8..f9c76be 100644 --- a/tests/unit/plugins/modules/test_api_facts.py +++ b/tests/unit/plugins/modules/test_api_facts.py @@ -437,8 +437,8 @@ class TestRouterosApiFactsModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -447,8 +447,8 @@ class TestRouterosApiFactsModule(ModuleTestCase): with self.assertRaises(AnsibleFailJson) as exc: module_args = self.config_module_args.copy() module_args['gather_subset'] = ['!foobar'] - set_module_args(module_args) - self.module.main() + with set_module_args(module_args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -456,8 +456,8 @@ class TestRouterosApiFactsModule(ModuleTestCase): def test_full_run(self): with self.assertRaises(AnsibleExitJson) as exc: - set_module_args(self.config_module_args.copy()) - self.module.main() + with set_module_args(self.config_module_args.copy()): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) 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 2f47af4..2405d3a 100644 --- a/tests/unit/plugins/modules/test_api_find_and_modify.py +++ b/tests/unit/plugins/modules/test_api_find_and_modify.py @@ -117,8 +117,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -136,8 +136,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'bar', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -155,8 +155,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': 'bar', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -173,8 +173,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): '!comment': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -190,8 +190,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): '!comment': 'gone', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -212,8 +212,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): }, 'require_matches_min': 10, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -234,8 +234,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): }, 'require_matches_min': 10, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -256,8 +256,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): }, 'require_matches_max': 1, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -277,8 +277,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'name': 'bam', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -303,8 +303,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'require_matches_min': 2, 'allow_no_matches': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -325,8 +325,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'values': { }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -349,8 +349,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -374,8 +374,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): }, '_ansible_diff': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -450,8 +450,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -502,8 +502,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): 'comment': '', }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -553,8 +553,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): '!comment': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -606,8 +606,8 @@ class TestRouterosApiFindAndModifyModule(ModuleTestCase): '!connection-state': None, }, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) diff --git a/tests/unit/plugins/modules/test_api_info.py b/tests/unit/plugins/modules/test_api_info.py index 1c9d014..d20aa11 100644 --- a/tests/unit/plugins/modules/test_api_info.py +++ b/tests/unit/plugins/modules/test_api_info.py @@ -41,8 +41,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -53,8 +53,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): args.update({ 'path': 'something invalid' }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -68,8 +68,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): args.update({ 'path': 'ip dns static' }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -93,8 +93,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): args.update({ 'path': 'caps-man aaa', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -122,8 +122,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'caps-man aaa', 'hide_defaults': False, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -155,8 +155,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'caps-man aaa', 'unfiltered': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -189,8 +189,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'ip firewall filter', 'handle_disabled': 'exclamation', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -278,8 +278,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'ip firewall filter', 'handle_disabled': 'null-value', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -367,8 +367,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'ip firewall filter', 'handle_disabled': 'omit', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -402,8 +402,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'handle_disabled': 'omit', 'include_dynamic': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -460,8 +460,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'interface list', 'handle_disabled': 'omit', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -513,8 +513,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'handle_disabled': 'omit', 'include_builtin': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -605,8 +605,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'path': 'ip dhcp-server lease', 'handle_disabled': 'omit', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -688,8 +688,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): args.update({ 'path': 'interface gre', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -776,8 +776,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'handle_disabled': 'omit', 'hide_defaults': False, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -847,8 +847,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'handle_disabled': 'omit', 'restrict': [], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -899,8 +899,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): 'values': ['forward'], }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -970,8 +970,8 @@ class TestRouterosApiInfoModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) diff --git a/tests/unit/plugins/modules/test_api_modify.py b/tests/unit/plugins/modules/test_api_modify.py index f4aa777..20e29e1 100644 --- a/tests/unit/plugins/modules/test_api_modify.py +++ b/tests/unit/plugins/modules/test_api_modify.py @@ -318,8 +318,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): def test_module_fail_when_required_args_missing(self): with self.assertRaises(AnsibleFailJson) as exc: - set_module_args({}) - self.module.main() + with set_module_args({}): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -331,8 +331,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'path': 'something invalid', 'data': [], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -348,8 +348,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'foo': 'bar', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -366,8 +366,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): '!comment': None, }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -383,8 +383,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): '!disabled': None, }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -400,8 +400,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): '!comment': 'foo', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -416,8 +416,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'name': None, }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -432,8 +432,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'interface': 'eth0', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -448,8 +448,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'address': '192.168.88.1', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -466,8 +466,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'address': '192.168.88.1', }], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['failed'], True) @@ -498,8 +498,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -533,8 +533,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -556,8 +556,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -591,8 +591,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -656,8 +656,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -722,8 +722,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): ], '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -785,8 +785,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -844,8 +844,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -903,8 +903,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -963,8 +963,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1017,8 +1017,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1077,8 +1077,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1128,8 +1128,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1164,8 +1164,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1212,8 +1212,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1285,8 +1285,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'ensure_order': True, '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1340,8 +1340,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1363,8 +1363,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): ], 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1386,8 +1386,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1426,8 +1426,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): ], '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1466,8 +1466,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): ], 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1507,8 +1507,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1551,8 +1551,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): }, ], }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1587,8 +1587,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1621,8 +1621,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'handle_entries_content': 'remove', }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1676,8 +1676,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1729,8 +1729,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1785,8 +1785,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'ensure_order': True, '_ansible_check_mode': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1847,8 +1847,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1879,8 +1879,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -1911,8 +1911,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_entries_content': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], True) @@ -1969,8 +1969,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) @@ -2005,8 +2005,8 @@ class TestRouterosApiModifyModule(ModuleTestCase): 'handle_absent_entries': 'remove', 'ensure_order': True, }) - set_module_args(args) - self.module.main() + with set_module_args(args): + self.module.main() result = exc.exception.args[0] self.assertEqual(result['changed'], False) diff --git a/tests/unit/plugins/modules/test_command.py b/tests/unit/plugins/modules/test_command.py index 3fc5865..72fbfd6 100644 --- a/tests/unit/plugins/modules/test_command.py +++ b/tests/unit/plugins/modules/test_command.py @@ -47,54 +47,54 @@ class TestRouterosCommandModule(TestRouterosModule): self.run_commands.side_effect = load_from_file def test_command_simple(self): - set_module_args(dict(commands=['/system resource print'])) - result = self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print'])): + result = self.execute_module(changed=True) self.assertEqual(len(result['stdout']), 1) self.assertTrue('platform: "MikroTik"' in result['stdout'][0]) def test_command_multiple(self): - set_module_args(dict(commands=['/system resource print', '/system resource print'])) - result = self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print', '/system resource print'])): + result = self.execute_module(changed=True) self.assertEqual(len(result['stdout']), 2) self.assertTrue('platform: "MikroTik"' in result['stdout'][0]) def test_command_wait_for(self): wait_for = 'result[0] contains "MikroTik"' - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for)) - self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for)): + self.execute_module(changed=True) def test_command_wait_for_fails(self): wait_for = 'result[0] contains "test string"' - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for)) - self.execute_module(failed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for)): + self.execute_module(failed=True) self.assertEqual(self.run_commands.call_count, 10) def test_command_retries(self): wait_for = 'result[0] contains "test string"' - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, retries=2)) - self.execute_module(failed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, retries=2)): + self.execute_module(failed=True) self.assertEqual(self.run_commands.call_count, 2) def test_command_match_any(self): wait_for = ['result[0] contains "MikroTik"', 'result[0] contains "test string"'] - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, match='any')) - self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, match='any')): + self.execute_module(changed=True) def test_command_match_all(self): wait_for = ['result[0] contains "MikroTik"', 'result[0] contains "RB1100"'] - set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, match='all')) - self.execute_module(changed=True) + with set_module_args(dict(commands=['/system resource print'], wait_for=wait_for, match='all')): + self.execute_module(changed=True) def test_command_match_all_failure(self): wait_for = ['result[0] contains "MikroTik"', 'result[0] contains "test string"'] commands = ['/system resource print', '/system resource print'] - set_module_args(dict(commands=commands, wait_for=wait_for, match='all')) - self.execute_module(failed=True) + with set_module_args(dict(commands=commands, wait_for=wait_for, match='all')): + self.execute_module(failed=True) def test_command_wait_for_2(self): wait_for = 'result[0] contains "wireless"' - set_module_args(dict(commands=['/system package print'], wait_for=wait_for)) - self.execute_module(changed=True) + with set_module_args(dict(commands=['/system package print'], wait_for=wait_for)): + self.execute_module(changed=True) diff --git a/tests/unit/plugins/modules/test_facts.py b/tests/unit/plugins/modules/test_facts.py index 322fdda..a7e2c8b 100644 --- a/tests/unit/plugins/modules/test_facts.py +++ b/tests/unit/plugins/modules/test_facts.py @@ -39,8 +39,8 @@ class TestRouterosFactsModule(TestRouterosModule): self.run_commands.side_effect = load_from_file def test_facts_default(self): - set_module_args(dict(gather_subset='default')) - result = self.execute_module() + with set_module_args(dict(gather_subset='default')): + result = self.execute_module() self.assertEqual( result['ansible_facts']['ansible_net_hostname'], 'MikroTik' ) @@ -61,8 +61,8 @@ class TestRouterosFactsModule(TestRouterosModule): ) def test_facts_hardware(self): - set_module_args(dict(gather_subset='hardware')) - result = self.execute_module() + with set_module_args(dict(gather_subset='hardware')): + result = self.execute_module() self.assertEqual( result['ansible_facts']['ansible_net_spacefree_mb'], 64921.6 ) @@ -77,8 +77,8 @@ class TestRouterosFactsModule(TestRouterosModule): ) def test_facts_config(self): - set_module_args(dict(gather_subset='config')) - result = self.execute_module() + with set_module_args(dict(gather_subset='config')): + result = self.execute_module() self.assertIsInstance( result['ansible_facts']['ansible_net_config'], str ) @@ -88,8 +88,8 @@ class TestRouterosFactsModule(TestRouterosModule): ) def test_facts_interfaces(self): - set_module_args(dict(gather_subset='interfaces')) - result = self.execute_module() + with set_module_args(dict(gather_subset='interfaces')): + result = self.execute_module() self.assertIn( result['ansible_facts']['ansible_net_all_ipv4_addresses'][0], ['10.37.129.3', '10.37.0.0', '192.168.88.1'] ) @@ -118,8 +118,8 @@ class TestRouterosFactsModule(TestRouterosModule): self.assertEqual(result, None) def test_facts_routing(self): - set_module_args(dict(gather_subset='routing')) - result = self.execute_module() + with set_module_args(dict(gather_subset='routing')): + result = self.execute_module() self.assertIn( result['ansible_facts']['ansible_net_bgp_peer']['iBGP_BRAS.TYRMA']['name'], ['iBGP_BRAS.TYRMA'] ) diff --git a/tests/unit/plugins/modules/utils.py b/tests/unit/plugins/modules/utils.py index 419eef1..0926190 100644 --- a/tests/unit/plugins/modules/utils.py +++ b/tests/unit/plugins/modules/utils.py @@ -5,6 +5,7 @@ from __future__ import absolute_import, division, print_function __metaclass__ = type +import contextlib as _contextlib import json from ansible_collections.community.routeros.tests.unit.compat import unittest @@ -13,14 +14,16 @@ from ansible.module_utils import basic from ansible.module_utils.common.text.converters import to_bytes +@_contextlib.contextmanager def set_module_args(args): if '_ansible_remote_tmp' not in args: args['_ansible_remote_tmp'] = '/tmp' if '_ansible_keep_remote_files' not in args: args['_ansible_keep_remote_files'] = False - args = json.dumps({'ANSIBLE_MODULE_ARGS': args}) - basic._ANSIBLE_ARGS = to_bytes(args) + serialized_args = to_bytes(json.dumps({'ANSIBLE_MODULE_ARGS': args})) + with patch.object(basic, '_ANSIBLE_ARGS', serialized_args): + yield class AnsibleExitJson(Exception): From 3a5b1175ffd7e73f8ccbf5b4a40ea771bb0a9dda Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Tue, 11 Mar 2025 21:56:44 +0100 Subject: [PATCH 42/96] Switch from ubuntu-20.04 to ubuntu-latest for old Ansible versions. (#349) --- .github/workflows/ansible-test.yml | 30 +++--------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index ad01212..b3c551e 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -37,15 +37,7 @@ jobs: - stable-2.17 - stable-2.18 - devel - # Ansible-test on various stable branches does not yet work well with cgroups v2. - # Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04 - # image for these stable branches. The list of branches where this is necessary will - # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 - # for the latest list. - runs-on: >- - ${{ contains(fromJson( - '["stable-2.9", "stable-2.10", "stable-2.11"]' - ), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }} + runs-on: ubuntu-latest steps: - name: Perform sanity testing uses: felixfontein/ansible-test-gh-action@main @@ -60,15 +52,7 @@ jobs: git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils units: - # Ansible-test on various stable branches does not yet work well with cgroups v2. - # Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04 - # image for these stable branches. The list of branches where this is necessary will - # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 - # for the latest list. - runs-on: >- - ${{ contains(fromJson( - '["stable-2.9", "stable-2.10", "stable-2.11"]' - ), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }} + runs-on: ubuntu-latest name: Units (Ⓐ${{ matrix.ansible }}) strategy: # As soon as the first unit test fails, cancel the others to free up the CI queue @@ -103,15 +87,7 @@ jobs: git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils integration: - # Ansible-test on various stable branches does not yet work well with cgroups v2. - # Since ubuntu-latest now uses Ubuntu 22.04, we need to fall back to the ubuntu-20.04 - # image for these stable branches. The list of branches where this is necessary will - # shrink over time, check out https://github.com/ansible-collections/news-for-maintainers/issues/28 - # for the latest list. - runs-on: >- - ${{ contains(fromJson( - '["stable-2.9", "stable-2.10", "stable-2.11"]' - ), matrix.ansible) && 'ubuntu-20.04' || 'ubuntu-latest' }} + runs-on: ubuntu-latest name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}) strategy: fail-fast: false From ab446b44492f7c6b765e77240bff468f27772092 Mon Sep 17 00:00:00 2001 From: hansmi Date: Wed, 12 Mar 2025 20:06:39 +0100 Subject: [PATCH 43/96] Fix typo in "API" (#351) --- plugins/modules/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/api.py b/plugins/modules/api.py index 7d90045..4e42912 100644 --- a/plugins/modules/api.py +++ b/plugins/modules/api.py @@ -67,7 +67,7 @@ options: type: str query: description: - - Query given path for selected query attributes from RouterOS aip. + - Query given path for selected query attributes from RouterOS API. - WHERE is key word which extend query. WHERE format is key operator value - with spaces. - WHERE valid operators are V(==) or V(eq), V(!=) or V(not), V(>) or V(more), V(<) or V(less). - Example path V(ip address) and query V(.id address) will return only C(.id) and C(address) for all items in V(ip address) From 90780b9cd010ae26d92ed316012af57fe93012f5 Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Wed, 12 Mar 2025 20:12:13 +0100 Subject: [PATCH 44/96] Fix typo in "API" (#351) (#352) (cherry picked from commit ab446b44492f7c6b765e77240bff468f27772092) Co-authored-by: hansmi --- plugins/modules/api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/modules/api.py b/plugins/modules/api.py index 4857a3c..469b9ea 100644 --- a/plugins/modules/api.py +++ b/plugins/modules/api.py @@ -65,7 +65,7 @@ options: type: str query: description: - - Query given path for selected query attributes from RouterOS aip. + - Query given path for selected query attributes from RouterOS API. - WHERE is key word which extend query. WHERE format is key operator value - with spaces. - WHERE valid operators are V(==) or V(eq), V(!=) or V(not), V(>) or V(more), V(<) or V(less). - Example path V(ip address) and query V(.id address) will return only C(.id) and C(address) for all items in V(ip address) path. From 30a79061f388ed30664216250f58213bc7be8bab Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 12 Mar 2025 21:34:12 +0100 Subject: [PATCH 45/96] Use shared unit test utils from community.internal_test_tools (#353) * Use shared unit test utils from community.internal_test_tools. * Make sure community.internal_test_tools is installed in CI. --- .github/workflows/ansible-test.yml | 3 + tests/sanity/ignore-2.17.txt | 1 - tests/sanity/ignore-2.18.txt | 1 - tests/sanity/ignore-2.19.txt | 1 - tests/unit/compat/__init__.py | 0 tests/unit/compat/builtins.py | 20 ---- tests/unit/compat/mock.py | 109 ------------------ tests/unit/compat/unittest.py | 25 ---- tests/unit/plugins/modules/routeros_module.py | 2 +- tests/unit/plugins/modules/test_api.py | 5 +- tests/unit/plugins/modules/test_api_facts.py | 5 +- .../modules/test_api_find_and_modify.py | 5 +- tests/unit/plugins/modules/test_api_info.py | 5 +- tests/unit/plugins/modules/test_api_modify.py | 5 +- tests/unit/plugins/modules/test_command.py | 5 +- tests/unit/plugins/modules/test_facts.py | 5 +- tests/unit/plugins/modules/utils.py | 57 --------- 17 files changed, 25 insertions(+), 229 deletions(-) delete mode 100644 tests/unit/compat/__init__.py delete mode 100644 tests/unit/compat/builtins.py delete mode 100644 tests/unit/compat/mock.py delete mode 100644 tests/unit/compat/unittest.py delete mode 100644 tests/unit/plugins/modules/utils.py diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index 4835b43..45ca774 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -43,6 +43,7 @@ jobs: test-deps: >- git+https://github.com/ansible-collections/ansible.utils.git,main git+https://github.com/ansible-collections/ansible.netcommon.git,main + git+https://github.com/ansible-collections/community.internal_test_tools.git,main units: runs-on: ubuntu-latest @@ -70,6 +71,7 @@ jobs: test-deps: >- git+https://github.com/ansible-collections/ansible.utils.git,main git+https://github.com/ansible-collections/ansible.netcommon.git,main + git+https://github.com/ansible-collections/community.internal_test_tools.git,main integration: runs-on: ubuntu-latest @@ -118,5 +120,6 @@ jobs: test-deps: >- git+https://github.com/ansible-collections/ansible.utils.git,main git+https://github.com/ansible-collections/ansible.netcommon.git,main + git+https://github.com/ansible-collections/community.internal_test_tools.git,main target-python-version: ${{ matrix.python }} testing-type: integration diff --git a/tests/sanity/ignore-2.17.txt b/tests/sanity/ignore-2.17.txt index 0a5234b..ce635c3 100644 --- a/tests/sanity/ignore-2.17.txt +++ b/tests/sanity/ignore-2.17.txt @@ -1,2 +1 @@ update-docs.py shebang -tests/unit/compat/mock.py pylint:use-yield-from # suggested construct does not work with Python 2 diff --git a/tests/sanity/ignore-2.18.txt b/tests/sanity/ignore-2.18.txt index 0a5234b..ce635c3 100644 --- a/tests/sanity/ignore-2.18.txt +++ b/tests/sanity/ignore-2.18.txt @@ -1,2 +1 @@ update-docs.py shebang -tests/unit/compat/mock.py pylint:use-yield-from # suggested construct does not work with Python 2 diff --git a/tests/sanity/ignore-2.19.txt b/tests/sanity/ignore-2.19.txt index 0a5234b..ce635c3 100644 --- a/tests/sanity/ignore-2.19.txt +++ b/tests/sanity/ignore-2.19.txt @@ -1,2 +1 @@ update-docs.py shebang -tests/unit/compat/mock.py pylint:use-yield-from # suggested construct does not work with Python 2 diff --git a/tests/unit/compat/__init__.py b/tests/unit/compat/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/unit/compat/builtins.py b/tests/unit/compat/builtins.py deleted file mode 100644 index d548601..0000000 --- a/tests/unit/compat/builtins.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2014, Toshio Kuratomi -# 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 - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -# -# Compat for python2.7 -# - -# One unittest needs to import builtins via __import__() so we need to have -# the string that represents it -try: - import __builtin__ # noqa: F401, pylint: disable=unused-import -except ImportError: - BUILTINS = 'builtins' -else: - BUILTINS = '__builtin__' diff --git a/tests/unit/compat/mock.py b/tests/unit/compat/mock.py deleted file mode 100644 index bdbea94..0000000 --- a/tests/unit/compat/mock.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (c) 2014, Toshio Kuratomi -# 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 - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -''' -Compat module for Python3.x's unittest.mock module -''' -import sys - -# Python 2.7 - -# Note: Could use the pypi mock library on python3.x as well as python2.x. It -# is the same as the python3 stdlib mock library - -try: - # Allow wildcard import because we really do want to import all of mock's - # symbols into this compat shim - # pylint: disable=wildcard-import,unused-wildcard-import - from unittest.mock import * # noqa: F401, pylint: disable=unused-import -except ImportError: - # Python 2 - # pylint: disable=wildcard-import,unused-wildcard-import - try: - from mock import * # noqa: F401, pylint: disable=unused-import - except ImportError: - print('You need the mock library installed on python2.x to run tests') - - -# Prior to 3.4.4, mock_open cannot handle binary read_data -if sys.version_info >= (3,) and sys.version_info < (3, 4, 4): - file_spec = None - - def _iterate_read_data(read_data): - # Helper for mock_open: - # Retrieve lines from read_data via a generator so that separate calls to - # readline, read, and readlines are properly interleaved - sep = b'\n' if isinstance(read_data, bytes) else '\n' - data_as_list = [l + sep for l in read_data.split(sep)] - - if data_as_list[-1] == sep: - # If the last line ended in a newline, the list comprehension will have an - # extra entry that's just a newline. Remove this. - data_as_list = data_as_list[:-1] - else: - # If there wasn't an extra newline by itself, then the file being - # emulated doesn't have a newline to end the last line remove the - # newline that our naive format() added - data_as_list[-1] = data_as_list[-1][:-1] - - for line in data_as_list: - yield line - - def mock_open(mock=None, read_data=''): - """ - A helper function to create a mock to replace the use of `open`. It works - for `open` called directly or used as a context manager. - - The `mock` argument is the mock object to configure. If `None` (the - default) then a `MagicMock` will be created for you, with the API limited - to methods or attributes available on standard file handles. - - `read_data` is a string for the `read` methoddline`, and `readlines` of the - file handle to return. This is an empty string by default. - """ - def _readlines_side_effect(*args, **kwargs): - if handle.readlines.return_value is not None: - return handle.readlines.return_value - return list(_data) - - def _read_side_effect(*args, **kwargs): - if handle.read.return_value is not None: - return handle.read.return_value - return type(read_data)().join(_data) - - def _readline_side_effect(): - if handle.readline.return_value is not None: - while True: - yield handle.readline.return_value - for line in _data: - yield line - - global file_spec - if file_spec is None: - import _io - file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO)))) - - if mock is None: - mock = MagicMock(name='open', spec=open) - - handle = MagicMock(spec=file_spec) - handle.__enter__.return_value = handle - - _data = _iterate_read_data(read_data) - - handle.write.return_value = None - handle.read.return_value = None - handle.readline.return_value = None - handle.readlines.return_value = None - - handle.read.side_effect = _read_side_effect - handle.readline.side_effect = _readline_side_effect() - handle.readlines.side_effect = _readlines_side_effect - - mock.return_value = handle - return mock diff --git a/tests/unit/compat/unittest.py b/tests/unit/compat/unittest.py deleted file mode 100644 index d50bab8..0000000 --- a/tests/unit/compat/unittest.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2014, Toshio Kuratomi -# 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 - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -''' -Compat module for Python2.7's unittest module -''' - -import sys - -# Allow wildcard import because we really do want to import all of -# unittests's symbols into this compat shim -# pylint: disable=wildcard-import,unused-wildcard-import -if sys.version_info < (2, 7): - try: - # Need unittest2 on python2.6 - from unittest2 import * # noqa: F401, pylint: disable=unused-import - except ImportError: - print('You need unittest2 installed on python2.6.x to run tests') -else: - from unittest import * # noqa: F401, pylint: disable=unused-import diff --git a/tests/unit/plugins/modules/routeros_module.py b/tests/unit/plugins/modules/routeros_module.py index 0ec44f7..4786da6 100644 --- a/tests/unit/plugins/modules/routeros_module.py +++ b/tests/unit/plugins/modules/routeros_module.py @@ -9,7 +9,7 @@ __metaclass__ = type import os import json -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') diff --git a/tests/unit/plugins/modules/test_api.py b/tests/unit/plugins/modules/test_api.py index 5df8430..9a03825 100644 --- a/tests/unit/plugins/modules/test_api.py +++ b/tests/unit/plugins/modules/test_api.py @@ -6,9 +6,10 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import FakeLibRouterosError, Key, Or, fake_ros_api -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api diff --git a/tests/unit/plugins/modules/test_api_facts.py b/tests/unit/plugins/modules/test_api_facts.py index f9c76be..7b019f9 100644 --- a/tests/unit/plugins/modules/test_api_facts.py +++ b/tests/unit/plugins/modules/test_api_facts.py @@ -6,9 +6,10 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import FakeLibRouterosError, Key, fake_ros_api -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api_facts 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 b25fbce..fe5e180 100644 --- a/tests/unit/plugins/modules/test_api_find_and_modify.py +++ b/tests/unit/plugins/modules/test_api_find_and_modify.py @@ -6,11 +6,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import ( FakeLibRouterosError, fake_ros_api, massage_expected_result_data, create_fake_path, ) -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api_find_and_modify diff --git a/tests/unit/plugins/modules/test_api_info.py b/tests/unit/plugins/modules/test_api_info.py index d20aa11..967a854 100644 --- a/tests/unit/plugins/modules/test_api_info.py +++ b/tests/unit/plugins/modules/test_api_info.py @@ -6,11 +6,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import ( FAKE_ROS_VERSION, FakeLibRouterosError, Key, fake_ros_api, ) -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api_info diff --git a/tests/unit/plugins/modules/test_api_modify.py b/tests/unit/plugins/modules/test_api_modify.py index 20e29e1..6edc046 100644 --- a/tests/unit/plugins/modules/test_api_modify.py +++ b/tests/unit/plugins/modules/test_api_modify.py @@ -6,11 +6,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import ( FAKE_ROS_VERSION, FakeLibRouterosError, fake_ros_api, massage_expected_result_data, create_fake_path, ) -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api_modify diff --git a/tests/unit/plugins/modules/test_command.py b/tests/unit/plugins/modules/test_command.py index 72fbfd6..06153f0 100644 --- a/tests/unit/plugins/modules/test_command.py +++ b/tests/unit/plugins/modules/test_command.py @@ -8,9 +8,10 @@ __metaclass__ = type import json -from ansible_collections.community.routeros.tests.unit.compat.mock import patch +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args + from ansible_collections.community.routeros.plugins.modules import command -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args from .routeros_module import TestRouterosModule, load_fixture diff --git a/tests/unit/plugins/modules/test_facts.py b/tests/unit/plugins/modules/test_facts.py index a7e2c8b..918f378 100644 --- a/tests/unit/plugins/modules/test_facts.py +++ b/tests/unit/plugins/modules/test_facts.py @@ -6,9 +6,10 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args + from ansible_collections.community.routeros.plugins.modules import facts -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args from .routeros_module import TestRouterosModule, load_fixture diff --git a/tests/unit/plugins/modules/utils.py b/tests/unit/plugins/modules/utils.py deleted file mode 100644 index 0926190..0000000 --- a/tests/unit/plugins/modules/utils.py +++ /dev/null @@ -1,57 +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 - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -import contextlib as _contextlib -import json - -from ansible_collections.community.routeros.tests.unit.compat import unittest -from ansible_collections.community.routeros.tests.unit.compat.mock import patch -from ansible.module_utils import basic -from ansible.module_utils.common.text.converters import to_bytes - - -@_contextlib.contextmanager -def set_module_args(args): - if '_ansible_remote_tmp' not in args: - args['_ansible_remote_tmp'] = '/tmp' - if '_ansible_keep_remote_files' not in args: - args['_ansible_keep_remote_files'] = False - - serialized_args = to_bytes(json.dumps({'ANSIBLE_MODULE_ARGS': args})) - with patch.object(basic, '_ANSIBLE_ARGS', serialized_args): - yield - - -class AnsibleExitJson(Exception): - pass - - -class AnsibleFailJson(Exception): - pass - - -def exit_json(*args, **kwargs): - if 'changed' not in kwargs: - kwargs['changed'] = False - raise AnsibleExitJson(kwargs) - - -def fail_json(*args, **kwargs): - kwargs['failed'] = True - raise AnsibleFailJson(kwargs) - - -class ModuleTestCase(unittest.TestCase): - - def setUp(self): - self.mock_module = patch.multiple(basic.AnsibleModule, exit_json=exit_json, fail_json=fail_json) - self.mock_module.start() - self.mock_sleep = patch('time.sleep') - self.mock_sleep.start() - set_module_args({}) - self.addCleanup(self.mock_module.stop) - self.addCleanup(self.mock_sleep.stop) From 5f21f8f7c6e4368aee70176b58125d4775a0287c Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 12 Mar 2025 21:47:20 +0100 Subject: [PATCH 46/96] Use shared unit test utils from community.internal_test_tools (#353) (#354) * Use shared unit test utils from community.internal_test_tools. * Make sure community.internal_test_tools is installed in CI. (cherry picked from commit 30a79061f388ed30664216250f58213bc7be8bab) --- .github/workflows/ansible-test.yml | 3 + tests/sanity/ignore-2.17.txt | 1 - tests/sanity/ignore-2.18.txt | 1 - tests/sanity/ignore-2.19.txt | 1 - tests/unit/compat/__init__.py | 0 tests/unit/compat/builtins.py | 20 ---- tests/unit/compat/mock.py | 109 ------------------ tests/unit/compat/unittest.py | 25 ---- tests/unit/plugins/modules/routeros_module.py | 2 +- tests/unit/plugins/modules/test_api.py | 5 +- tests/unit/plugins/modules/test_api_facts.py | 5 +- .../modules/test_api_find_and_modify.py | 5 +- tests/unit/plugins/modules/test_api_info.py | 5 +- tests/unit/plugins/modules/test_api_modify.py | 5 +- tests/unit/plugins/modules/test_command.py | 5 +- tests/unit/plugins/modules/test_facts.py | 5 +- tests/unit/plugins/modules/utils.py | 57 --------- 17 files changed, 25 insertions(+), 229 deletions(-) delete mode 100644 tests/unit/compat/__init__.py delete mode 100644 tests/unit/compat/builtins.py delete mode 100644 tests/unit/compat/mock.py delete mode 100644 tests/unit/compat/unittest.py delete mode 100644 tests/unit/plugins/modules/utils.py diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml index b3c551e..e062a88 100644 --- a/.github/workflows/ansible-test.yml +++ b/.github/workflows/ansible-test.yml @@ -50,6 +50,7 @@ jobs: pre-test-cmd: |- git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils + git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools units: runs-on: ubuntu-latest @@ -85,6 +86,7 @@ jobs: pre-test-cmd: |- git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils + git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools integration: runs-on: ubuntu-latest @@ -151,5 +153,6 @@ jobs: pre-test-cmd: |- git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ../../ansible/netcommon git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ../../ansible/utils + git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ../../community/internal_test_tools target-python-version: ${{ matrix.python }} testing-type: integration diff --git a/tests/sanity/ignore-2.17.txt b/tests/sanity/ignore-2.17.txt index 0a5234b..ce635c3 100644 --- a/tests/sanity/ignore-2.17.txt +++ b/tests/sanity/ignore-2.17.txt @@ -1,2 +1 @@ update-docs.py shebang -tests/unit/compat/mock.py pylint:use-yield-from # suggested construct does not work with Python 2 diff --git a/tests/sanity/ignore-2.18.txt b/tests/sanity/ignore-2.18.txt index 0a5234b..ce635c3 100644 --- a/tests/sanity/ignore-2.18.txt +++ b/tests/sanity/ignore-2.18.txt @@ -1,2 +1 @@ update-docs.py shebang -tests/unit/compat/mock.py pylint:use-yield-from # suggested construct does not work with Python 2 diff --git a/tests/sanity/ignore-2.19.txt b/tests/sanity/ignore-2.19.txt index 0a5234b..ce635c3 100644 --- a/tests/sanity/ignore-2.19.txt +++ b/tests/sanity/ignore-2.19.txt @@ -1,2 +1 @@ update-docs.py shebang -tests/unit/compat/mock.py pylint:use-yield-from # suggested construct does not work with Python 2 diff --git a/tests/unit/compat/__init__.py b/tests/unit/compat/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/unit/compat/builtins.py b/tests/unit/compat/builtins.py deleted file mode 100644 index d548601..0000000 --- a/tests/unit/compat/builtins.py +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright (c) 2014, Toshio Kuratomi -# 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 - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -# -# Compat for python2.7 -# - -# One unittest needs to import builtins via __import__() so we need to have -# the string that represents it -try: - import __builtin__ # noqa: F401, pylint: disable=unused-import -except ImportError: - BUILTINS = 'builtins' -else: - BUILTINS = '__builtin__' diff --git a/tests/unit/compat/mock.py b/tests/unit/compat/mock.py deleted file mode 100644 index bdbea94..0000000 --- a/tests/unit/compat/mock.py +++ /dev/null @@ -1,109 +0,0 @@ -# Copyright (c) 2014, Toshio Kuratomi -# 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 - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -''' -Compat module for Python3.x's unittest.mock module -''' -import sys - -# Python 2.7 - -# Note: Could use the pypi mock library on python3.x as well as python2.x. It -# is the same as the python3 stdlib mock library - -try: - # Allow wildcard import because we really do want to import all of mock's - # symbols into this compat shim - # pylint: disable=wildcard-import,unused-wildcard-import - from unittest.mock import * # noqa: F401, pylint: disable=unused-import -except ImportError: - # Python 2 - # pylint: disable=wildcard-import,unused-wildcard-import - try: - from mock import * # noqa: F401, pylint: disable=unused-import - except ImportError: - print('You need the mock library installed on python2.x to run tests') - - -# Prior to 3.4.4, mock_open cannot handle binary read_data -if sys.version_info >= (3,) and sys.version_info < (3, 4, 4): - file_spec = None - - def _iterate_read_data(read_data): - # Helper for mock_open: - # Retrieve lines from read_data via a generator so that separate calls to - # readline, read, and readlines are properly interleaved - sep = b'\n' if isinstance(read_data, bytes) else '\n' - data_as_list = [l + sep for l in read_data.split(sep)] - - if data_as_list[-1] == sep: - # If the last line ended in a newline, the list comprehension will have an - # extra entry that's just a newline. Remove this. - data_as_list = data_as_list[:-1] - else: - # If there wasn't an extra newline by itself, then the file being - # emulated doesn't have a newline to end the last line remove the - # newline that our naive format() added - data_as_list[-1] = data_as_list[-1][:-1] - - for line in data_as_list: - yield line - - def mock_open(mock=None, read_data=''): - """ - A helper function to create a mock to replace the use of `open`. It works - for `open` called directly or used as a context manager. - - The `mock` argument is the mock object to configure. If `None` (the - default) then a `MagicMock` will be created for you, with the API limited - to methods or attributes available on standard file handles. - - `read_data` is a string for the `read` methoddline`, and `readlines` of the - file handle to return. This is an empty string by default. - """ - def _readlines_side_effect(*args, **kwargs): - if handle.readlines.return_value is not None: - return handle.readlines.return_value - return list(_data) - - def _read_side_effect(*args, **kwargs): - if handle.read.return_value is not None: - return handle.read.return_value - return type(read_data)().join(_data) - - def _readline_side_effect(): - if handle.readline.return_value is not None: - while True: - yield handle.readline.return_value - for line in _data: - yield line - - global file_spec - if file_spec is None: - import _io - file_spec = list(set(dir(_io.TextIOWrapper)).union(set(dir(_io.BytesIO)))) - - if mock is None: - mock = MagicMock(name='open', spec=open) - - handle = MagicMock(spec=file_spec) - handle.__enter__.return_value = handle - - _data = _iterate_read_data(read_data) - - handle.write.return_value = None - handle.read.return_value = None - handle.readline.return_value = None - handle.readlines.return_value = None - - handle.read.side_effect = _read_side_effect - handle.readline.side_effect = _readline_side_effect() - handle.readlines.side_effect = _readlines_side_effect - - mock.return_value = handle - return mock diff --git a/tests/unit/compat/unittest.py b/tests/unit/compat/unittest.py deleted file mode 100644 index d50bab8..0000000 --- a/tests/unit/compat/unittest.py +++ /dev/null @@ -1,25 +0,0 @@ -# Copyright (c) 2014, Toshio Kuratomi -# 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 - -# Make coding more python3-ish -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -''' -Compat module for Python2.7's unittest module -''' - -import sys - -# Allow wildcard import because we really do want to import all of -# unittests's symbols into this compat shim -# pylint: disable=wildcard-import,unused-wildcard-import -if sys.version_info < (2, 7): - try: - # Need unittest2 on python2.6 - from unittest2 import * # noqa: F401, pylint: disable=unused-import - except ImportError: - print('You need unittest2 installed on python2.6.x to run tests') -else: - from unittest import * # noqa: F401, pylint: disable=unused-import diff --git a/tests/unit/plugins/modules/routeros_module.py b/tests/unit/plugins/modules/routeros_module.py index 0ec44f7..4786da6 100644 --- a/tests/unit/plugins/modules/routeros_module.py +++ b/tests/unit/plugins/modules/routeros_module.py @@ -9,7 +9,7 @@ __metaclass__ = type import os import json -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase fixture_path = os.path.join(os.path.dirname(__file__), 'fixtures') diff --git a/tests/unit/plugins/modules/test_api.py b/tests/unit/plugins/modules/test_api.py index 5df8430..9a03825 100644 --- a/tests/unit/plugins/modules/test_api.py +++ b/tests/unit/plugins/modules/test_api.py @@ -6,9 +6,10 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import FakeLibRouterosError, Key, Or, fake_ros_api -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api diff --git a/tests/unit/plugins/modules/test_api_facts.py b/tests/unit/plugins/modules/test_api_facts.py index f9c76be..7b019f9 100644 --- a/tests/unit/plugins/modules/test_api_facts.py +++ b/tests/unit/plugins/modules/test_api_facts.py @@ -6,9 +6,10 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import FakeLibRouterosError, Key, fake_ros_api -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api_facts 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 2405d3a..fe93905 100644 --- a/tests/unit/plugins/modules/test_api_find_and_modify.py +++ b/tests/unit/plugins/modules/test_api_find_and_modify.py @@ -6,11 +6,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import ( FakeLibRouterosError, fake_ros_api, massage_expected_result_data, create_fake_path, ) -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api_find_and_modify diff --git a/tests/unit/plugins/modules/test_api_info.py b/tests/unit/plugins/modules/test_api_info.py index d20aa11..967a854 100644 --- a/tests/unit/plugins/modules/test_api_info.py +++ b/tests/unit/plugins/modules/test_api_info.py @@ -6,11 +6,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import ( FAKE_ROS_VERSION, FakeLibRouterosError, Key, fake_ros_api, ) -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api_info diff --git a/tests/unit/plugins/modules/test_api_modify.py b/tests/unit/plugins/modules/test_api_modify.py index 20e29e1..6edc046 100644 --- a/tests/unit/plugins/modules/test_api_modify.py +++ b/tests/unit/plugins/modules/test_api_modify.py @@ -6,11 +6,12 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch, MagicMock +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase + from ansible_collections.community.routeros.tests.unit.plugins.modules.fake_api import ( FAKE_ROS_VERSION, FakeLibRouterosError, fake_ros_api, massage_expected_result_data, create_fake_path, ) -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args, AnsibleExitJson, AnsibleFailJson, ModuleTestCase from ansible_collections.community.routeros.plugins.modules import api_modify diff --git a/tests/unit/plugins/modules/test_command.py b/tests/unit/plugins/modules/test_command.py index 72fbfd6..06153f0 100644 --- a/tests/unit/plugins/modules/test_command.py +++ b/tests/unit/plugins/modules/test_command.py @@ -8,9 +8,10 @@ __metaclass__ = type import json -from ansible_collections.community.routeros.tests.unit.compat.mock import patch +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args + from ansible_collections.community.routeros.plugins.modules import command -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args from .routeros_module import TestRouterosModule, load_fixture diff --git a/tests/unit/plugins/modules/test_facts.py b/tests/unit/plugins/modules/test_facts.py index a7e2c8b..918f378 100644 --- a/tests/unit/plugins/modules/test_facts.py +++ b/tests/unit/plugins/modules/test_facts.py @@ -6,9 +6,10 @@ from __future__ import (absolute_import, division, print_function) __metaclass__ = type -from ansible_collections.community.routeros.tests.unit.compat.mock import patch +from ansible_collections.community.internal_test_tools.tests.unit.compat.mock import patch +from ansible_collections.community.internal_test_tools.tests.unit.plugins.modules.utils import set_module_args + from ansible_collections.community.routeros.plugins.modules import facts -from ansible_collections.community.routeros.tests.unit.plugins.modules.utils import set_module_args from .routeros_module import TestRouterosModule, load_fixture diff --git a/tests/unit/plugins/modules/utils.py b/tests/unit/plugins/modules/utils.py deleted file mode 100644 index 0926190..0000000 --- a/tests/unit/plugins/modules/utils.py +++ /dev/null @@ -1,57 +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 - -from __future__ import absolute_import, division, print_function -__metaclass__ = type - -import contextlib as _contextlib -import json - -from ansible_collections.community.routeros.tests.unit.compat import unittest -from ansible_collections.community.routeros.tests.unit.compat.mock import patch -from ansible.module_utils import basic -from ansible.module_utils.common.text.converters import to_bytes - - -@_contextlib.contextmanager -def set_module_args(args): - if '_ansible_remote_tmp' not in args: - args['_ansible_remote_tmp'] = '/tmp' - if '_ansible_keep_remote_files' not in args: - args['_ansible_keep_remote_files'] = False - - serialized_args = to_bytes(json.dumps({'ANSIBLE_MODULE_ARGS': args})) - with patch.object(basic, '_ANSIBLE_ARGS', serialized_args): - yield - - -class AnsibleExitJson(Exception): - pass - - -class AnsibleFailJson(Exception): - pass - - -def exit_json(*args, **kwargs): - if 'changed' not in kwargs: - kwargs['changed'] = False - raise AnsibleExitJson(kwargs) - - -def fail_json(*args, **kwargs): - kwargs['failed'] = True - raise AnsibleFailJson(kwargs) - - -class ModuleTestCase(unittest.TestCase): - - def setUp(self): - self.mock_module = patch.multiple(basic.AnsibleModule, exit_json=exit_json, fail_json=fail_json) - self.mock_module.start() - self.mock_sleep = patch('time.sleep') - self.mock_sleep.start() - set_module_args({}) - self.addCleanup(self.mock_module.stop) - self.addCleanup(self.mock_sleep.stop) From 873699631723bd6875b9292da7db9e0ea8642be5 Mon Sep 17 00:00:00 2001 From: hansmi Date: Thu, 13 Mar 2025 07:08:14 +0100 Subject: [PATCH 47/96] Change default for ddns-enabled to "auto" for RouterOS 7.17 and newer (#350) From the RouterOS 7.17 changelog: > *) cloud - changed ddns-enabled setting from "no" to "auto" (service > is enabled when BTH is enabled); `no` is not supported anymore, only `yes` and `auto` are. --- changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml | 2 ++ plugins/module_utils/_api_data.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml diff --git a/changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml b/changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml new file mode 100644 index 0000000..6d9d443 --- /dev/null +++ b/changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml @@ -0,0 +1,2 @@ +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). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 5ff335e..56e487a 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2777,8 +2777,11 @@ PATHS = { unversioned=VersionedAPIData( single_value=True, fully_understood=True, + versioned_fields=[ + ([('7.17', '<')], 'ddns-enabled', KeyInfo(default=False)), + ([('7.17', '>=')], 'ddns-enabled', KeyInfo(default='auto')), + ], fields={ - 'ddns-enabled': KeyInfo(default=False), 'ddns-update-interval': KeyInfo(default='none'), 'update-time': KeyInfo(default=True), }, From 2b1be7f011c62519327368159ed1721832f479fd Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Fri, 21 Mar 2025 22:07:58 +0100 Subject: [PATCH 48/96] Prepare 3.5.0. --- changelogs/fragments/3.5.0.yml | 1 + galaxy.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/3.5.0.yml diff --git a/changelogs/fragments/3.5.0.yml b/changelogs/fragments/3.5.0.yml new file mode 100644 index 0000000..512efc9 --- /dev/null +++ b/changelogs/fragments/3.5.0.yml @@ -0,0 +1 @@ +release_summary: Feature release. diff --git a/galaxy.yml b/galaxy.yml index 704ec35..3557098 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.4.0 +version: 3.5.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From 317fca85022ce863a40d5355544d4dae56c798e4 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 22 Mar 2025 11:57:24 +0100 Subject: [PATCH 49/96] Use shared unit test utils from community.internal_test_tools (#353) (#357) * Use shared unit test utils from community.internal_test_tools. * Make sure community.internal_test_tools is installed in CI. (cherry picked from commit 30a79061f388ed30664216250f58213bc7be8bab) From 9d382a1b10672089dc5a8dd08dca4b7e4268dd10 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 22 Mar 2025 12:39:33 +0100 Subject: [PATCH 50/96] Release 3.5.0. --- CHANGELOG.md | 256 ++++++++++-------- CHANGELOG.rst | 13 + changelogs/changelog.yaml | 10 + changelogs/fragments/3.5.0.yml | 1 - .../350-ip-cloud-ddns-enabled-auto.yml | 2 - 5 files changed, 159 insertions(+), 123 deletions(-) delete mode 100644 changelogs/fragments/3.5.0.yml delete mode 100644 changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ce4976..fd9b85b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,153 +2,169 @@ **Topics** -- 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\.4\.0 + +## v3\.5\.0 ### Release Summary -Feature and bugfix release\. +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)\)\. @@ -159,12 +175,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)\)\. @@ -175,12 +191,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)\)\. @@ -188,12 +204,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)\)\. @@ -206,7 +222,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\. @@ -224,12 +240,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)\)\. @@ -240,12 +256,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)\)\. @@ -257,12 +273,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)\)\. @@ -286,12 +302,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)\)\. @@ -301,12 +317,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)\)\. @@ -315,12 +331,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)\)\. @@ -337,12 +353,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)\)\. @@ -352,12 +368,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)\)\. @@ -371,12 +387,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)\)\. @@ -390,12 +406,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)\) @@ -410,12 +426,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)\)\. @@ -447,12 +463,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)\)\. @@ -466,7 +482,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -487,7 +503,7 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - + ### Release Summary Bugfix release\. @@ -500,7 +516,7 @@ Bugfix release\. ## v2\.8\.1 - + ### Release Summary Bugfix release\. @@ -513,12 +529,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)\)\. @@ -538,12 +554,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)\)\. @@ -556,12 +572,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)\)\. @@ -576,12 +592,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)\)\. @@ -594,12 +610,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)\)\. @@ -638,7 +654,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -651,12 +667,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)\)\. @@ -671,7 +687,7 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. @@ -685,12 +701,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)\)\. @@ -709,12 +725,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)\)\. @@ -738,12 +754,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)\)\. @@ -779,12 +795,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)\)\. @@ -800,12 +816,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)\)\. @@ -814,7 +830,7 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. @@ -827,7 +843,7 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. @@ -840,7 +856,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\. @@ -853,12 +869,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 34a847d..6a82da8 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,19 @@ Community RouterOS Release Notes .. contents:: Topics +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). + v3.4.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index d76afb0..ee957d5 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -875,3 +875,13 @@ releases: - 343-add-ip-dns-forwarders.yml - 345-interface-wifi-provisioning.yml release_date: '2025-02-24' + 3.5.0: + changes: + 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). + release_summary: Feature release. + fragments: + - 3.5.0.yml + - 350-ip-cloud-ddns-enabled-auto.yml + release_date: '2025-03-22' diff --git a/changelogs/fragments/3.5.0.yml b/changelogs/fragments/3.5.0.yml deleted file mode 100644 index 512efc9..0000000 --- a/changelogs/fragments/3.5.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Feature release. diff --git a/changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml b/changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml deleted file mode 100644 index 6d9d443..0000000 --- a/changelogs/fragments/350-ip-cloud-ddns-enabled-auto.yml +++ /dev/null @@ -1,2 +0,0 @@ -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). From a920caa16af3cc6822b73e356ba7ab7f8419e002 Mon Sep 17 00:00:00 2001 From: hansmi Date: Wed, 26 Mar 2025 06:51:10 +0100 Subject: [PATCH 51/96] Add "mdns-repeat-ifaces" field to "ip dns" (#358) RouterOS 7.16 introduced an mDNS proxy, configurable via `mdns-repeat-ifaces` under `/ip/dns`. --- changelogs/fragments/358-mdns-repeat-ifaces.yml | 2 ++ plugins/module_utils/_api_data.py | 1 + 2 files changed, 3 insertions(+) create mode 100644 changelogs/fragments/358-mdns-repeat-ifaces.yml diff --git a/changelogs/fragments/358-mdns-repeat-ifaces.yml b/changelogs/fragments/358-mdns-repeat-ifaces.yml new file mode 100644 index 0000000..3cd6d62 --- /dev/null +++ b/changelogs/fragments/358-mdns-repeat-ifaces.yml @@ -0,0 +1,2 @@ +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). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 56e487a..f239750 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2967,6 +2967,7 @@ PATHS = { ([('7.8', '>=')], 'doh-max-concurrent-queries', KeyInfo(default=50)), ([('7.8', '>=')], 'doh-max-server-connections', KeyInfo(default=5)), ([('7.8', '>=')], 'doh-timeout', KeyInfo(default='5s')), + ([('7.16', '>=')], 'mdns-repeat-ifaces', KeyInfo()), ], fields={ 'allow-remote-requests': KeyInfo(), From 3a34752296df4677ae48cd6e7c6d420803f1b599 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 29 Mar 2025 12:17:25 +0100 Subject: [PATCH 52/96] Migrate .reuse/dep5 to REUSE.toml. --- .reuse/dep5 | 5 ----- REUSE.toml | 11 +++++++++++ 2 files changed, 11 insertions(+), 5 deletions(-) delete mode 100644 .reuse/dep5 create mode 100644 REUSE.toml diff --git a/.reuse/dep5 b/.reuse/dep5 deleted file mode 100644 index 0c3745e..0000000 --- a/.reuse/dep5 +++ /dev/null @@ -1,5 +0,0 @@ -Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ - -Files: changelogs/fragments/* -Copyright: Ansible Project -License: GPL-3.0-or-later diff --git a/REUSE.toml b/REUSE.toml new file mode 100644 index 0000000..ff95bb8 --- /dev/null +++ b/REUSE.toml @@ -0,0 +1,11 @@ +# 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 + +version = 1 + +[[annotations]] +path = "changelogs/fragments/**" +precedence = "aggregate" +SPDX-FileCopyrightText = "Ansible Project" +SPDX-License-Identifier = "GPL-3.0-or-later" From 9dba8082f9de797066fe68b404362adf3a73960e Mon Sep 17 00:00:00 2001 From: Tim de Boer Date: Thu, 10 Apr 2025 12:03:08 +0100 Subject: [PATCH 53/96] Field name change in 'routing bgp connection' (from 'address-families' to 'afi') (#360) * Field name change in 'routing bgp connection' (from 'address-families' to 'afi') * Field name change in 'routing bgp connection' (from 'address-families' to 'afi') --- changelogs/fragments/360-bgp-connection-afi.yml | 2 ++ plugins/module_utils/_api_data.py | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/360-bgp-connection-afi.yml diff --git a/changelogs/fragments/360-bgp-connection-afi.yml b/changelogs/fragments/360-bgp-connection-afi.yml new file mode 100644 index 0000000..13e89ea --- /dev/null +++ b/changelogs/fragments/360-bgp-connection-afi.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_modify, api_info - field name change in ``routing bgp connection`` path implemented by RouterOS 7.19 and newer (https://github.com/ansible-collections/community.routeros/pull/360). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index f239750..10a6216 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -4982,10 +4982,13 @@ PATHS = { ('routing', 'bgp', 'connection'): APIData( unversioned=VersionedAPIData( fully_understood=True, + versioned_fields=[ + ([('7.19', '<')], 'address-families', KeyInfo()), + ([('7.19', '>=')], 'afi', KeyInfo()), + ], fields={ 'as': KeyInfo(), 'add-path-out': KeyInfo(), - 'address-families': KeyInfo(), 'cisco-vpls-nlri-len-fmt': KeyInfo(), 'cluster-id': KeyInfo(), 'comment': KeyInfo(), From e286d768c0c83e01cb2fd87ec5e7e4a0c7d3d905 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 19 Apr 2025 13:07:53 +0200 Subject: [PATCH 54/96] Use antsibull-nox for CI. (#361) --- .github/workflows/ansible-test.yml | 125 ------------------ .github/workflows/extra-tests.yml | 52 -------- .github/workflows/import-galaxy.yml | 20 --- .github/workflows/{reuse.yml => nox.yml} | 28 ++-- README.md | 2 +- antsibull-nox.toml | 57 ++++++++ noxfile.py | 50 +++++++ tests/sanity/extra/action-group.json | 12 -- tests/sanity/extra/action-group.json.license | 3 - tests/sanity/extra/action-group.py | 119 ----------------- tests/sanity/extra/extra-docs.json | 13 -- tests/sanity/extra/extra-docs.json.license | 3 - tests/sanity/extra/extra-docs.py | 29 ---- tests/sanity/extra/licenses.json | 4 - tests/sanity/extra/licenses.json.license | 3 - tests/sanity/extra/licenses.py | 110 --------------- tests/sanity/extra/licenses.py.license | 3 - tests/sanity/extra/no-unwanted-files.json | 7 - .../extra/no-unwanted-files.json.license | 3 - tests/sanity/extra/no-unwanted-files.py | 58 -------- tests/sanity/extra/update-docs.json | 11 -- tests/sanity/extra/update-docs.json.license | 3 - tests/sanity/extra/update-docs.py | 21 --- tests/sanity/ignore-2.10.txt | 12 +- tests/sanity/ignore-2.11.txt | 12 +- tests/sanity/ignore-2.12.txt | 2 +- tests/sanity/ignore-2.13.txt | 2 +- tests/sanity/ignore-2.14.txt | 2 +- tests/sanity/ignore-2.15.txt | 2 +- tests/sanity/ignore-2.16.txt | 2 +- tests/sanity/ignore-2.17.txt | 2 +- tests/sanity/ignore-2.18.txt | 2 +- tests/sanity/ignore-2.19.txt | 2 +- tests/sanity/ignore-2.9.txt | 12 +- tests/unit/requirements.yml | 2 +- update-docs.py => tests/update-docs.py | 29 ++-- 36 files changed, 168 insertions(+), 651 deletions(-) delete mode 100644 .github/workflows/ansible-test.yml delete mode 100644 .github/workflows/extra-tests.yml delete mode 100644 .github/workflows/import-galaxy.yml rename .github/workflows/{reuse.yml => nox.yml} (50%) create mode 100644 antsibull-nox.toml create mode 100644 noxfile.py delete mode 100644 tests/sanity/extra/action-group.json delete mode 100644 tests/sanity/extra/action-group.json.license delete mode 100755 tests/sanity/extra/action-group.py delete mode 100644 tests/sanity/extra/extra-docs.json delete mode 100644 tests/sanity/extra/extra-docs.json.license delete mode 100755 tests/sanity/extra/extra-docs.py delete mode 100644 tests/sanity/extra/licenses.json delete mode 100644 tests/sanity/extra/licenses.json.license delete mode 100755 tests/sanity/extra/licenses.py delete mode 100644 tests/sanity/extra/licenses.py.license delete mode 100644 tests/sanity/extra/no-unwanted-files.json delete mode 100644 tests/sanity/extra/no-unwanted-files.json.license delete mode 100755 tests/sanity/extra/no-unwanted-files.py delete mode 100644 tests/sanity/extra/update-docs.json delete mode 100644 tests/sanity/extra/update-docs.json.license delete mode 100644 tests/sanity/extra/update-docs.py rename update-docs.py => tests/update-docs.py (62%) mode change 100755 => 100644 diff --git a/.github/workflows/ansible-test.yml b/.github/workflows/ansible-test.yml deleted file mode 100644 index 45ca774..0000000 --- a/.github/workflows/ansible-test.yml +++ /dev/null @@ -1,125 +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 - -# For the comprehensive list of the inputs supported by the ansible-community/ansible-test-gh-action GitHub Action, see -# https://github.com/marketplace/actions/ansible-test - -name: CI -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) - schedule: - - cron: '15 5 * * *' - -jobs: - sanity: - name: Sanity (Ⓐ${{ matrix.ansible }}) - strategy: - matrix: - ansible: - # It's important that Sanity is tested against all stable-X.Y branches - # Testing against `devel` may fail as new tests are added. - - stable-2.15 - - stable-2.16 - - stable-2.17 - - stable-2.18 - - devel - runs-on: ubuntu-latest - steps: - - name: Perform sanity testing - uses: felixfontein/ansible-test-gh-action@main - with: - ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.14"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} - ansible-core-version: ${{ matrix.ansible }} - codecov-token: ${{ secrets.CODECOV_TOKEN }} - testing-type: sanity - test-deps: >- - git+https://github.com/ansible-collections/ansible.utils.git,main - git+https://github.com/ansible-collections/ansible.netcommon.git,main - git+https://github.com/ansible-collections/community.internal_test_tools.git,main - - units: - runs-on: ubuntu-latest - name: Units (Ⓐ${{ matrix.ansible }}) - strategy: - # As soon as the first unit test fails, cancel the others to free up the CI queue - fail-fast: true - matrix: - ansible: - - stable-2.16 - - stable-2.17 - - stable-2.18 - - devel - - steps: - - name: >- - Perform unit testing against - Ansible version ${{ matrix.ansible }} - uses: felixfontein/ansible-test-gh-action@main - with: - ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.14"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} - ansible-core-version: ${{ matrix.ansible }} - codecov-token: ${{ secrets.CODECOV_TOKEN }} - testing-type: units - test-deps: >- - git+https://github.com/ansible-collections/ansible.utils.git,main - git+https://github.com/ansible-collections/ansible.netcommon.git,main - git+https://github.com/ansible-collections/community.internal_test_tools.git,main - - integration: - runs-on: ubuntu-latest - name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}) - strategy: - fail-fast: false - matrix: - ansible: - - devel - python: - - "3.10" - - "3.11" - - "3.12" - - "3.13" - include: - # 2.15 - - ansible: stable-2.15 - python: "2.7" - - ansible: stable-2.15 - python: "3.6" - - ansible: stable-2.15 - python: "3.7" - # 2.16 - - ansible: stable-2.16 - python: "3.10" - # 2.17 - - ansible: stable-2.17 - python: "3.8" - # 2.18 - - ansible: stable-2.18 - python: "3.9" - - steps: - - name: >- - Perform integration testing against - Ansible version ${{ matrix.ansible }} - under Python ${{ matrix.python }} - uses: felixfontein/ansible-test-gh-action@main - with: - ansible-core-github-repository-slug: ${{ contains(fromJson('["stable-2.14"]'), matrix.ansible) && 'ansible-community/eol-ansible' || 'ansible/ansible' }} - ansible-core-version: ${{ matrix.ansible }} - codecov-token: ${{ secrets.CODECOV_TOKEN }} - integration-continue-on-error: 'false' - integration-diff: 'false' - integration-retry-on-error: 'true' - test-deps: >- - git+https://github.com/ansible-collections/ansible.utils.git,main - git+https://github.com/ansible-collections/ansible.netcommon.git,main - git+https://github.com/ansible-collections/community.internal_test_tools.git,main - target-python-version: ${{ matrix.python }} - testing-type: integration diff --git a/.github/workflows/extra-tests.yml b/.github/workflows/extra-tests.yml deleted file mode 100644 index 0fda77b..0000000 --- a/.github/workflows/extra-tests.yml +++ /dev/null @@ -1,52 +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: extra-tests -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-test for each ansible-base version - schedule: - - cron: '15 5 * * *' -env: - NAMESPACE: community - COLLECTION_NAME: routeros - -jobs: - extra-sanity: - name: Extra Sanity - 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-core - run: pip install https://github.com/ansible/ansible/archive/devel.tar.gz --disable-pip-version-check - - - name: Install collection dependencies - run: | - git clone --depth=1 --single-branch https://github.com/ansible-collections/community.internal_test_tools.git ./ansible_collections/community/internal_test_tools - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.netcommon.git ./ansible_collections/ansible/netcommon - git clone --depth=1 --single-branch https://github.com/ansible-collections/ansible.utils.git ./ansible_collections/ansible/utils - # NOTE: we're installing with git to work around Galaxy being a huge PITA (https://github.com/ansible/galaxy/issues/2429) - # run: ansible-galaxy collection install community.internal_test_tools ansible.netcommon -p . - - - name: Run sanity tests - run: ../../community/internal_test_tools/tools/run.py --color - working-directory: ./ansible_collections/${{env.NAMESPACE}}/${{env.COLLECTION_NAME}} diff --git a/.github/workflows/import-galaxy.yml b/.github/workflows/import-galaxy.yml deleted file mode 100644 index 0c0ee40..0000000 --- a/.github/workflows/import-galaxy.yml +++ /dev/null @@ -1,20 +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: import-galaxy -'on': - # Run CI against all pushes (direct commits, also merged PRs) to main, and all Pull Requests - push: - branches: - - main - - stable-* - pull_request: - -jobs: - import-galaxy: - permissions: - contents: read - name: Test to import built collection artifact with Galaxy importer - uses: ansible-community/github-action-test-galaxy-import/.github/workflows/test-galaxy-import.yml@main diff --git a/.github/workflows/reuse.yml b/.github/workflows/nox.yml similarity index 50% rename from .github/workflows/reuse.yml rename to .github/workflows/nox.yml index 78cc533..43cce99 100644 --- a/.github/workflows/reuse.yml +++ b/.github/workflows/nox.yml @@ -3,31 +3,33 @@ # 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: Verify REUSE - -on: +name: nox +'on': push: branches: - main - stable-* pull_request: - branches: - - main - - stable-* # Run CI once per day (at 05:15 UTC) schedule: - cron: '15 5 * * *' + workflow_dispatch: jobs: - check: - permissions: - contents: read + nox: runs-on: ubuntu-latest - + name: "Run extra sanity tests" steps: - - uses: actions/checkout@v4 + - name: Check out collection + uses: actions/checkout@v4 with: persist-credentials: false + - name: Run nox + uses: ansible-community/antsibull-nox@main - - name: REUSE Compliance Check - uses: fsfe/reuse-action@v5 + ansible-test: + uses: ansible-community/antsibull-nox/.github/workflows/reusable-nox-matrix.yml@main + with: + upload-codecov: true + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index bdea3c3..2d6aec1 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ SPDX-License-Identifier: GPL-3.0-or-later # Community RouterOS Collection [![Documentation](https://img.shields.io/badge/docs-brightgreen.svg)](https://docs.ansible.com/ansible/devel/collections/community/routeros/) -[![CI](https://github.com/ansible-collections/community.routeros/actions/workflows/ansible-test.yml/badge.svg?branch=main)](https://github.com/ansible-collections/community.routeros/actions) +[![CI](https://github.com/ansible-collections/community.routeros/actions/workflows/nox.yml/badge.svg?branch=main)](https://github.com/ansible-collections/community.routeros/actions) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.routeros)](https://codecov.io/gh/ansible-collections/community.routeros) [![REUSE status](https://api.reuse.software/badge/github.com/ansible-collections/community.routeros)](https://api.reuse.software/info/github.com/ansible-collections/community.routeros) diff --git a/antsibull-nox.toml b/antsibull-nox.toml new file mode 100644 index 0000000..6d73110 --- /dev/null +++ b/antsibull-nox.toml @@ -0,0 +1,57 @@ +# 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 + +[collection_sources] +"community.internal_test_tools" = "git+https://github.com/ansible-collections/community.internal_test_tools.git,main" +"community.netcommon" = "git+https://github.com/ansible-collections/ansible.netcommon.git,main" +"community.utils" = "git+https://github.com/ansible-collections/ansible.utils.git,main" + +[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_mypy = false + +[sessions.docs_check] +validate_collection_refs="all" + +[sessions.extra_checks] +run_no_unwanted_files = true +no_unwanted_files_module_extensions = [".py"] +no_unwanted_files_yaml_extensions = [".yml"] +run_action_groups = true + +[[sessions.extra_checks.action_groups_config]] +name = "api" +pattern = "^api.*$" +exclusions = [] +doc_fragment = "community.routeros.attributes.actiongroup_api" + +[sessions.build_import_check] +run_galaxy_importer = true + +[sessions.ansible_test_sanity] +include_devel = true + +[sessions.ansible_test_units] +include_devel = true + +[sessions.ansible_test_integration_w_default_container] +include_devel = true +controller_python_versions_only = true + +[sessions.ansible_test_integration_w_default_container.core_python_versions] +"2.15" = ["2.7", "3.6", "3.7"] +"2.16" = ["3.10"] +"2.17" = ["3.8"] +"2.18" = ["3.9"] diff --git a/noxfile.py b/noxfile.py new file mode 100644 index 0000000..d8c5173 --- /dev/null +++ b/noxfile.py @@ -0,0 +1,50 @@ + +# The following metadata allows Python runners and nox to install the required +# dependencies for running this Python script: +# +# /// script +# dependencies = ["nox>=2025.02.09", "antsibull-nox"] +# /// + +import os +import sys + +import nox + + +# We try to import antsibull-nox, and if that doesn't work, provide a more useful +# error message to the user. +try: + import antsibull_nox +except ImportError: + print("You need to install antsibull-nox in the same Python environment as nox.") + sys.exit(1) + + +IN_CI = os.environ.get("CI") == "true" + + +antsibull_nox.load_antsibull_nox_toml() + + +@nox.session(name="update-docs", default=True) +def update_docs_fragments(session: nox.Session) -> None: + """ + Update/check auto-generated parts of docs fragments. + """ + session.install("ansible-core") + prepare = antsibull_nox.sessions.prepare_collections( + session, install_in_site_packages=True + ) + if not prepare: + return + data = ["python", "tests/update-docs.py"] + if IN_CI: + data.append("--lint") + session.run(*data) + + +# Allow to run the noxfile with `python noxfile.py`, `pipx run noxfile.py`, or similar. +# Requires nox >= 2025.02.09 +if __name__ == "__main__": + nox.main() diff --git a/tests/sanity/extra/action-group.json b/tests/sanity/extra/action-group.json deleted file mode 100644 index db6a92b..0000000 --- a/tests/sanity/extra/action-group.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "include_symlinks": true, - "prefixes": [ - "meta/runtime.yml", - "plugins/modules/", - "tests/sanity/extra/action-group." - ], - "output": "path-message", - "requirements": [ - "pyyaml" - ] -} diff --git a/tests/sanity/extra/action-group.json.license b/tests/sanity/extra/action-group.json.license deleted file mode 100644 index edff8c7..0000000 --- a/tests/sanity/extra/action-group.json.license +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/tests/sanity/extra/action-group.py b/tests/sanity/extra/action-group.py deleted file mode 100755 index cc00945..0000000 --- a/tests/sanity/extra/action-group.py +++ /dev/null @@ -1,119 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2024, Felix Fontein -# 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 -"""Make sure all modules that should show up in the action group.""" - -from __future__ import annotations - -import os -import re -import yaml - - -ACTION_GROUPS = { - # The format is as follows: - # * 'pattern': a regular expression matching all module names potentially belonging to the action group; - # * 'exclusions': a list of modules that are not part of the action group; all other modules matching 'pattern' must be part of it; - # * 'doc_fragment': the docs fragment that documents membership of the action group. - 'api': { - 'pattern': re.compile('^api.*$'), - 'exclusions': [], - 'doc_fragment': 'community.routeros.attributes.actiongroup_api', - }, -} - - -def main(): - """Main entry point.""" - - # Load redirects - meta_runtime = 'meta/runtime.yml' - self_path = 'tests/sanity/extra/action-group.py' - try: - with open(meta_runtime, 'rb') as f: - data = yaml.safe_load(f) - action_groups = data['action_groups'] - except Exception as exc: - print(f'{meta_runtime}: cannot load action groups: {exc}') - return - - for action_group in action_groups: - if action_group not in ACTION_GROUPS: - print(f'{meta_runtime}: found unknown action group {action_group!r}; likely {self_path} needs updating') - for action_group, action_group_data in list(ACTION_GROUPS.items()): - if action_group not in action_groups: - print(f'{meta_runtime}: cannot find action group {action_group!r}; likely {self_path} needs updating') - - modules_directory = 'plugins/modules/' - modules_suffix = '.py' - - for file in os.listdir(modules_directory): - if not file.endswith(modules_suffix): - continue - module_name = file[:-len(modules_suffix)] - - for action_group, action_group_data in ACTION_GROUPS.items(): - action_group_content = action_groups.get(action_group) or [] - path = os.path.join(modules_directory, file) - - if not action_group_data['pattern'].match(module_name): - if module_name in action_group_content: - print(f'{path}: module is in action group {action_group!r} despite not matching its pattern as defined in {self_path}') - continue - - should_be_in_action_group = module_name not in action_group_data['exclusions'] - - if should_be_in_action_group: - if module_name not in action_group_content: - print(f'{meta_runtime}: module {module_name!r} is not part of {action_group!r} action group') - else: - action_group_content.remove(module_name) - - documentation = [] - in_docs = False - with open(path, 'r', encoding='utf-8') as f: - for line in f: - if line.startswith('DOCUMENTATION ='): - in_docs = True - elif line.startswith(("'''", '"""')) and in_docs: - in_docs = False - elif in_docs: - documentation.append(line) - if in_docs: - print(f'{path}: cannot find DOCUMENTATION end') - if not documentation: - print(f'{path}: cannot find DOCUMENTATION') - continue - - try: - docs = yaml.safe_load('\n'.join(documentation)) - if not isinstance(docs, dict): - raise Exception('is not a top-level dictionary') - except Exception as exc: - print(f'{path}: cannot load DOCUMENTATION as YAML: {exc}') - continue - - docs_fragments = docs.get('extends_documentation_fragment') or [] - is_in_action_group = action_group_data['doc_fragment'] in docs_fragments - - if should_be_in_action_group != is_in_action_group: - if should_be_in_action_group: - print( - f'{path}: module does not document itself as part of action group {action_group!r}, but it should;' - f' you need to add {action_group_data["doc_fragment"]} to "extends_documentation_fragment" in DOCUMENTATION' - ) - else: - print(f'{path}: module documents itself as part of action group {action_group!r}, but it should not be') - - for action_group, action_group_data in ACTION_GROUPS.items(): - action_group_content = action_groups.get(action_group) or [] - for module_name in action_group_content: - print( - f'{meta_runtime}: module {module_name} mentioned in {action_group!r} action group' - f' does not exist or does not match pattern defined in {self_path}' - ) - - -if __name__ == '__main__': - main() diff --git a/tests/sanity/extra/extra-docs.json b/tests/sanity/extra/extra-docs.json deleted file mode 100644 index 9a28d17..0000000 --- a/tests/sanity/extra/extra-docs.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "include_symlinks": false, - "prefixes": [ - "docs/docsite/", - "plugins/", - "roles/" - ], - "output": "path-line-column-message", - "requirements": [ - "ansible-core", - "antsibull-docs" - ] -} diff --git a/tests/sanity/extra/extra-docs.json.license b/tests/sanity/extra/extra-docs.json.license deleted file mode 100644 index edff8c7..0000000 --- a/tests/sanity/extra/extra-docs.json.license +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/tests/sanity/extra/extra-docs.py b/tests/sanity/extra/extra-docs.py deleted file mode 100755 index 251e6d7..0000000 --- a/tests/sanity/extra/extra-docs.py +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env python -# 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 -"""Check extra collection docs with antsibull-docs.""" -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import os -import sys -import subprocess - - -def main(): - """Main entry point.""" - env = os.environ.copy() - suffix = ':{env}'.format(env=env["ANSIBLE_COLLECTIONS_PATH"]) if 'ANSIBLE_COLLECTIONS_PATH' in env else '' - env['ANSIBLE_COLLECTIONS_PATH'] = '{root}{suffix}'.format(root=os.path.dirname(os.path.dirname(os.path.dirname(os.getcwd()))), suffix=suffix) - p = subprocess.run( - ['antsibull-docs', 'lint-collection-docs', '--plugin-docs', '--skip-rstcheck', '.'], - env=env, - check=False, - ) - if p.returncode not in (0, 3): - print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode)) - - -if __name__ == '__main__': - main() diff --git a/tests/sanity/extra/licenses.json b/tests/sanity/extra/licenses.json deleted file mode 100644 index 50e47ca..0000000 --- a/tests/sanity/extra/licenses.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "include_symlinks": false, - "output": "path-message" -} diff --git a/tests/sanity/extra/licenses.json.license b/tests/sanity/extra/licenses.json.license deleted file mode 100644 index edff8c7..0000000 --- a/tests/sanity/extra/licenses.json.license +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/tests/sanity/extra/licenses.py b/tests/sanity/extra/licenses.py deleted file mode 100755 index 80eb795..0000000 --- a/tests/sanity/extra/licenses.py +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env python -# Copyright (c) 2022, Felix Fontein -# 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 -"""Prevent files without a correct license identifier from being added to the source tree.""" -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import os -import glob -import sys - - -def format_license_list(licenses): - if not licenses: - return '(empty)' - return ', '.join(['"%s"' % license for license in licenses]) - - -def find_licenses(filename, relax=False): - spdx_license_identifiers = [] - other_license_identifiers = [] - has_copyright = False - try: - with open(filename, 'r', encoding='utf-8') as f: - for line in f: - line = line.rstrip() - if 'Copyright ' in line: - has_copyright = True - if 'Copyright: ' in line: - print('%s: found copyright line with "Copyright:". Please remove the colon.' % (filename, )) - if 'SPDX-FileCopyrightText: ' in line: - has_copyright = True - idx = line.find('SPDX-License-Identifier: ') - if idx >= 0: - lic_id = line[idx + len('SPDX-License-Identifier: '):] - spdx_license_identifiers.extend(lic_id.split(' OR ')) - if 'GNU General Public License' in line: - if 'v3.0+' in line: - other_license_identifiers.append('GPL-3.0-or-later') - if 'version 3 or later' in line: - other_license_identifiers.append('GPL-3.0-or-later') - if 'Simplified BSD License' in line: - other_license_identifiers.append('BSD-2-Clause') - if 'Apache License 2.0' in line: - other_license_identifiers.append('Apache-2.0') - if 'PSF License' in line or 'Python-2.0' in line: - other_license_identifiers.append('PSF-2.0') - if 'MIT License' in line: - other_license_identifiers.append('MIT') - except Exception as exc: - print('%s: error while processing file: %s' % (filename, exc)) - if len(set(spdx_license_identifiers)) < len(spdx_license_identifiers): - print('%s: found identical SPDX-License-Identifier values' % (filename, )) - if other_license_identifiers and set(other_license_identifiers) != set(spdx_license_identifiers): - print('%s: SPDX-License-Identifier yielded the license list %s, while manual guessing yielded the license list %s' % ( - filename, format_license_list(spdx_license_identifiers), format_license_list(other_license_identifiers))) - if not has_copyright and not relax: - print('%s: found no copyright notice' % (filename, )) - return sorted(spdx_license_identifiers) - - -def main(): - """Main entry point.""" - paths = sys.argv[1:] or sys.stdin.read().splitlines() - - # The following paths are allowed to have no license identifier - no_comments_allowed = [ - 'changelogs/fragments/*.yml', - 'changelogs/fragments/*.yaml', - ] - - # These files are completely ignored - ignore_paths = [ - '.ansible-test-timeout.json', - '.reuse/dep5', - 'LICENSES/*.txt', - 'COPYING', - ] - - no_comments_allowed = [fn for pattern in no_comments_allowed for fn in glob.glob(pattern)] - ignore_paths = [fn for pattern in ignore_paths for fn in glob.glob(pattern)] - - valid_licenses = [license_file[len('LICENSES/'):-len('.txt')] for license_file in glob.glob('LICENSES/*.txt')] - - for path in paths: - if path.startswith('./'): - path = path[2:] - if path in ignore_paths or path.startswith('tests/output/'): - continue - if os.stat(path).st_size == 0: - continue - if not path.endswith('.license') and os.path.exists(path + '.license'): - path = path + '.license' - valid_licenses_for_path = valid_licenses - if path.startswith('plugins/') and not path.startswith(('plugins/modules/', 'plugins/module_utils/')): - valid_licenses_for_path = [license for license in valid_licenses if license == 'GPL-3.0-or-later'] - licenses = find_licenses(path, relax=path in no_comments_allowed) - if not licenses: - if path not in no_comments_allowed: - print('%s: must have at least one license' % (path, )) - else: - for license in licenses: - if license not in valid_licenses_for_path: - print('%s: found not allowed license "%s", must be one of %s' % ( - path, license, format_license_list(valid_licenses_for_path))) - - -if __name__ == '__main__': - main() diff --git a/tests/sanity/extra/licenses.py.license b/tests/sanity/extra/licenses.py.license deleted file mode 100644 index 6c4958f..0000000 --- a/tests/sanity/extra/licenses.py.license +++ /dev/null @@ -1,3 +0,0 @@ -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: 2022, Felix Fontein diff --git a/tests/sanity/extra/no-unwanted-files.json b/tests/sanity/extra/no-unwanted-files.json deleted file mode 100644 index c789a7f..0000000 --- a/tests/sanity/extra/no-unwanted-files.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "include_symlinks": true, - "prefixes": [ - "plugins/" - ], - "output": "path-message" -} diff --git a/tests/sanity/extra/no-unwanted-files.json.license b/tests/sanity/extra/no-unwanted-files.json.license deleted file mode 100644 index edff8c7..0000000 --- a/tests/sanity/extra/no-unwanted-files.json.license +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/tests/sanity/extra/no-unwanted-files.py b/tests/sanity/extra/no-unwanted-files.py deleted file mode 100755 index b39df83..0000000 --- a/tests/sanity/extra/no-unwanted-files.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python -# 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 -"""Prevent unwanted files from being added to the source tree.""" -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import os -import os.path -import sys - - -def main(): - """Main entry point.""" - paths = sys.argv[1:] or sys.stdin.read().splitlines() - - allowed_extensions = ( - '.cs', - '.ps1', - '.psm1', - '.py', - ) - - skip_paths = set([ - ]) - - skip_directories = ( - ) - - yaml_directories = ( - 'plugins/test/', - 'plugins/filter/', - ) - - for path in paths: - if path in skip_paths: - continue - - if any(path.startswith(skip_directory) for skip_directory in skip_directories): - continue - - if os.path.islink(path): - print('%s: is a symbolic link' % (path, )) - elif not os.path.isfile(path): - print('%s: is not a regular file' % (path, )) - - ext = os.path.splitext(path)[1] - - if ext in ('.yml', ) and any(path.startswith(yaml_directory) for yaml_directory in yaml_directories): - continue - - if ext not in allowed_extensions: - print('%s: extension must be one of: %s' % (path, ', '.join(allowed_extensions))) - - -if __name__ == '__main__': - main() diff --git a/tests/sanity/extra/update-docs.json b/tests/sanity/extra/update-docs.json deleted file mode 100644 index 3a63af8..0000000 --- a/tests/sanity/extra/update-docs.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "include_symlinks": false, - "prefixes": [ - "docs/docsite/rst/api-guide.rst", - "plugins/modules/" - ], - "output": "path-line-column-message", - "requirements": [ - "ansible-core" - ] -} diff --git a/tests/sanity/extra/update-docs.json.license b/tests/sanity/extra/update-docs.json.license deleted file mode 100644 index edff8c7..0000000 --- a/tests/sanity/extra/update-docs.json.license +++ /dev/null @@ -1,3 +0,0 @@ -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 diff --git a/tests/sanity/extra/update-docs.py b/tests/sanity/extra/update-docs.py deleted file mode 100644 index 6015512..0000000 --- a/tests/sanity/extra/update-docs.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python -# 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 -"""Check whether update-docs.py modifies something.""" -from __future__ import (absolute_import, division, print_function) -__metaclass__ = type - -import sys -import subprocess - - -def main(): - """Main entry point.""" - p = subprocess.run([sys.executable, 'update-docs.py'], check=False) - if p.returncode not in (0, 1): - print('{0}:0:0: unexpected return code {1}'.format(sys.argv[0], p.returncode)) - - -if __name__ == '__main__': - main() diff --git a/tests/sanity/ignore-2.10.txt b/tests/sanity/ignore-2.10.txt index ece5b29..50c92fb 100644 --- a/tests/sanity/ignore-2.10.txt +++ b/tests/sanity/ignore-2.10.txt @@ -1,9 +1,9 @@ docs/docsite/rst/api-guide.rst rstcheck docs/docsite/rst/quoting.rst rstcheck docs/docsite/rst/ssh-guide.rst rstcheck -update-docs.py compile-2.6 -update-docs.py compile-2.7 -update-docs.py compile-3.5 -update-docs.py future-import-boilerplate -update-docs.py metaclass-boilerplate -update-docs.py shebang +tests/update-docs.py compile-2.6 +tests/update-docs.py compile-2.7 +tests/update-docs.py compile-3.5 +tests/update-docs.py future-import-boilerplate +tests/update-docs.py metaclass-boilerplate +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.11.txt b/tests/sanity/ignore-2.11.txt index 876765a..1c7f5da 100644 --- a/tests/sanity/ignore-2.11.txt +++ b/tests/sanity/ignore-2.11.txt @@ -1,6 +1,6 @@ -update-docs.py compile-2.6 -update-docs.py compile-2.7 -update-docs.py compile-3.5 -update-docs.py future-import-boilerplate -update-docs.py metaclass-boilerplate -update-docs.py shebang +tests/update-docs.py compile-2.6 +tests/update-docs.py compile-2.7 +tests/update-docs.py compile-3.5 +tests/update-docs.py future-import-boilerplate +tests/update-docs.py metaclass-boilerplate +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index ce635c3..65e5bca 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -1 +1 @@ -update-docs.py shebang +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index ce635c3..65e5bca 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -1 +1 @@ -update-docs.py shebang +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index ce635c3..65e5bca 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -1 +1 @@ -update-docs.py shebang +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.15.txt b/tests/sanity/ignore-2.15.txt index ce635c3..65e5bca 100644 --- a/tests/sanity/ignore-2.15.txt +++ b/tests/sanity/ignore-2.15.txt @@ -1 +1 @@ -update-docs.py shebang +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.16.txt b/tests/sanity/ignore-2.16.txt index ce635c3..65e5bca 100644 --- a/tests/sanity/ignore-2.16.txt +++ b/tests/sanity/ignore-2.16.txt @@ -1 +1 @@ -update-docs.py shebang +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.17.txt b/tests/sanity/ignore-2.17.txt index ce635c3..65e5bca 100644 --- a/tests/sanity/ignore-2.17.txt +++ b/tests/sanity/ignore-2.17.txt @@ -1 +1 @@ -update-docs.py shebang +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.18.txt b/tests/sanity/ignore-2.18.txt index ce635c3..65e5bca 100644 --- a/tests/sanity/ignore-2.18.txt +++ b/tests/sanity/ignore-2.18.txt @@ -1 +1 @@ -update-docs.py shebang +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.19.txt b/tests/sanity/ignore-2.19.txt index ce635c3..65e5bca 100644 --- a/tests/sanity/ignore-2.19.txt +++ b/tests/sanity/ignore-2.19.txt @@ -1 +1 @@ -update-docs.py shebang +tests/update-docs.py shebang diff --git a/tests/sanity/ignore-2.9.txt b/tests/sanity/ignore-2.9.txt index ece5b29..50c92fb 100644 --- a/tests/sanity/ignore-2.9.txt +++ b/tests/sanity/ignore-2.9.txt @@ -1,9 +1,9 @@ docs/docsite/rst/api-guide.rst rstcheck docs/docsite/rst/quoting.rst rstcheck docs/docsite/rst/ssh-guide.rst rstcheck -update-docs.py compile-2.6 -update-docs.py compile-2.7 -update-docs.py compile-3.5 -update-docs.py future-import-boilerplate -update-docs.py metaclass-boilerplate -update-docs.py shebang +tests/update-docs.py compile-2.6 +tests/update-docs.py compile-2.7 +tests/update-docs.py compile-3.5 +tests/update-docs.py future-import-boilerplate +tests/update-docs.py metaclass-boilerplate +tests/update-docs.py shebang diff --git a/tests/unit/requirements.yml b/tests/unit/requirements.yml index 6a22736..107fe12 100644 --- a/tests/unit/requirements.yml +++ b/tests/unit/requirements.yml @@ -4,4 +4,4 @@ # SPDX-License-Identifier: GPL-3.0-or-later collections: -- ansible.netcommon + - community.internal_test_tools diff --git a/update-docs.py b/tests/update-docs.py old mode 100755 new mode 100644 similarity index 62% rename from update-docs.py rename to tests/update-docs.py index 4f164c8..5f28f8e --- a/update-docs.py +++ b/tests/update-docs.py @@ -11,9 +11,6 @@ Updates DOCUMENTATION of modules using module_utils._api_data with the correct l import sys -# Ensure that we can import things from ansible_collections -sys.path.append('../../..') - from ansible_collections.community.routeros.plugins.module_utils._api_data import ( PATHS, join_path, @@ -26,24 +23,34 @@ MODULES = [ ] -def update_file(file, begin_line, end_line, choice_line, path_choices): +def update_file(file: str, begin_line: str, end_line: str, choice_line: str, path_choices: list[str]) -> bool: with open(file, 'r', encoding='utf-8') as f: lines = f.read().splitlines() begin_index = lines.index(begin_line) end_index = lines.index(end_line, begin_index + 1) new_lines = lines[:begin_index + 1] + [choice_line.format(choice=choice) for choice in path_choices] + lines[end_index:] - if lines != new_lines: - print(f'{file} has been updated') - with open(file, 'w', encoding='utf-8') as f: - f.write('\n'.join(new_lines) + '\n') + if lines == new_lines: + return False + print(f'{file} has been updated') + with open(file, 'w', encoding='utf-8') as f: + f.write('\n'.join(new_lines) + '\n') + return True -def main(): +def main(args: list[str]) -> int: path_choices = sorted([join_path(path) for path, path_info in PATHS.items() if path_info.fully_understood]) + changes = False for file in MODULES: - update_file(file, ' # BEGIN PATH LIST', ' # END PATH LIST', ' - {choice}', path_choices) + changes |= update_file(file, ' # BEGIN PATH LIST', ' # END PATH LIST', ' - {choice}', path_choices) + + lint = "--lint" in args + if not lint or not changes: + return 0 + + print("Run 'nox -Re update-docs'!") + return 1 if __name__ == '__main__': - main() + sys.exit(main(sys.argv[1:])) From 4b9925ac23c17c2723c0b0ac7cb87ac646107476 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 19 Apr 2025 13:11:42 +0200 Subject: [PATCH 55/96] Re-add reuse check. --- antsibull-nox.toml | 2 ++ noxfile.py | 3 +++ 2 files changed, 5 insertions(+) diff --git a/antsibull-nox.toml b/antsibull-nox.toml index 6d73110..541f4e7 100644 --- a/antsibull-nox.toml +++ b/antsibull-nox.toml @@ -25,6 +25,8 @@ run_mypy = false [sessions.docs_check] validate_collection_refs="all" +[sessions.license_check] + [sessions.extra_checks] run_no_unwanted_files = true no_unwanted_files_module_extensions = [".py"] diff --git a/noxfile.py b/noxfile.py index d8c5173..16187f9 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,3 +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 # The following metadata allows Python runners and nox to install the required # dependencies for running this Python script: From 8aed0204cfd413e6c7da39e9c9a5b24f976a5a9a Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 19 Apr 2025 16:20:32 +0200 Subject: [PATCH 56/96] Declare 2.x.y EOL. (#362) --- changelogs/fragments/2.20.1.yml | 6 ++++++ galaxy.yml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/2.20.1.yml diff --git a/changelogs/fragments/2.20.1.yml b/changelogs/fragments/2.20.1.yml new file mode 100644 index 0000000..b1b938e --- /dev/null +++ b/changelogs/fragments/2.20.1.yml @@ -0,0 +1,6 @@ +release_summary: | + This is the final community.routeros 2.x.y release. + + Please upgrade to community.routeros 3.x.y as soon as possible to receive further bugfixes. + + Thanks to everyone who contributed to community.routeros 2.x.y releases! diff --git a/galaxy.yml b/galaxy.yml index 7c40eda..4c73628 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 2.20.0 +version: 2.20.1 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From 19363bb42477b05d8c34160263af77b7872ef705 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sat, 19 Apr 2025 16:24:18 +0200 Subject: [PATCH 57/96] Release 2.2.0.1. --- CHANGELOG.md | 142 ++++++++++++++++++-------------- CHANGELOG.rst | 12 +++ changelogs/changelog.yaml | 15 ++++ changelogs/fragments/2.20.1.yml | 6 -- 4 files changed, 105 insertions(+), 70 deletions(-) delete mode 100644 changelogs/fragments/2.20.1.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index d104e3f..b7b9752 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,128 +2,142 @@ **Topics** -- v2\.20\.0 +- v2\.20\.1 - Release Summary +- v2\.20\.0 + - 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 - 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 + - Release Summary - Minor Changes - Bugfixes - v2\.12\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.11\.0 - - Release Summary + - Release Summary - Minor Changes - v2\.10\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.9\.0 - - Release Summary + - 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 + - Release Summary - Minor Changes - Bugfixes - v2\.7\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.6\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.5\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.4\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - Known Issues - v2\.3\.1 - - Release Summary + - Release Summary - Known Issues - v2\.3\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v2\.2\.1 - - Release Summary + - Release Summary - Bugfixes - v2\.2\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - New Modules - v2\.1\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - New Modules - v2\.0\.0 - - Release Summary + - Release Summary - Minor Changes - Breaking Changes / Porting Guide - Bugfixes - New Plugins - Filter - v1\.2\.0 - - Release Summary + - Release Summary - Minor Changes - Bugfixes - v1\.1\.0 - - Release Summary + - Release Summary - Minor Changes - v1\.0\.1 - - Release Summary + - Release Summary - Bugfixes - v1\.0\.0 - - Release Summary + - Release Summary - Bugfixes - v0\.1\.1 - - Release Summary + - Release Summary - Bugfixes - v0\.1\.0 - - Release Summary + - Release Summary - Minor Changes + +## v2\.20\.1 + + +### Release Summary + +This is the final community\.routeros 2\.x\.y release\. + +Please upgrade to community\.routeros 3\.x\.y as soon as possible to receive further bugfixes\. + +Thanks to everyone who contributed to community\.routeros 2\.x\.y releases\! + ## v2\.20\.0 - + ### Release Summary Feature release\. @@ -139,7 +153,7 @@ Feature release\. ## v2\.19\.0 - + ### Release Summary Feature release\. @@ -156,7 +170,7 @@ Feature release\. ## v2\.18\.0 - + ### Release Summary Feature release\. @@ -185,7 +199,7 @@ Feature release\. ## v2\.17\.0 - + ### Release Summary Feature release\. @@ -200,7 +214,7 @@ Feature release\. ## v2\.16\.0 - + ### Release Summary Feature release\. @@ -214,7 +228,7 @@ Feature release\. ## v2\.15\.0 - + ### Release Summary Feature release\. @@ -236,7 +250,7 @@ Feature release\. ## v2\.14\.0 - + ### Release Summary Feature release\. @@ -251,7 +265,7 @@ Feature release\. ## v2\.13\.0 - + ### Release Summary Bugfix and feature release\. @@ -270,7 +284,7 @@ Bugfix and feature release\. ## v2\.12\.0 - + ### Release Summary Feature release\. @@ -289,7 +303,7 @@ Feature release\. ## v2\.11\.0 - + ### Release Summary Feature and bugfix release\. @@ -309,7 +323,7 @@ Feature and bugfix release\. ## v2\.10\.0 - + ### Release Summary Bugfix and feature release\. @@ -346,7 +360,7 @@ Bugfix and feature release\. ## v2\.9\.0 - + ### Release Summary Bugfix and feature release\. @@ -365,7 +379,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -386,7 +400,7 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - + ### Release Summary Bugfix release\. @@ -399,7 +413,7 @@ Bugfix release\. ## v2\.8\.1 - + ### Release Summary Bugfix release\. @@ -412,7 +426,7 @@ Bugfix release\. ## v2\.8\.0 - + ### Release Summary Bugfix and feature release\. @@ -437,7 +451,7 @@ Bugfix and feature release\. ## v2\.7\.0 - + ### Release Summary Bugfix and feature release\. @@ -455,7 +469,7 @@ Bugfix and feature release\. ## v2\.6\.0 - + ### Release Summary Regular bugfix and feature release\. @@ -475,7 +489,7 @@ Regular bugfix and feature release\. ## v2\.5\.0 - + ### Release Summary Feature and bugfix release\. @@ -493,7 +507,7 @@ Feature and bugfix release\. ## v2\.4\.0 - + ### Release Summary Feature release improving the api\* modules\. @@ -537,7 +551,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -550,7 +564,7 @@ Maintenance release with improved documentation\. ## v2\.3\.0 - + ### Release Summary Feature and bugfix release\. @@ -570,7 +584,7 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. @@ -584,7 +598,7 @@ Bugfix release\. ## v2\.2\.0 - + ### Release Summary New feature release\. @@ -608,7 +622,7 @@ New feature release\. ## v2\.1\.0 - + ### Release Summary Feature and bugfix release with new modules\. @@ -637,7 +651,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\. @@ -678,7 +692,7 @@ A new major release with breaking changes in the behavior of community\.ro ## v1\.2\.0 - + ### Release Summary Bugfix and feature release\. @@ -699,7 +713,7 @@ Bugfix and feature release\. ## v1\.1\.0 - + ### Release Summary This release allow dashes in usernames for SSH\-based modules\. @@ -713,7 +727,7 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. @@ -726,7 +740,7 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. @@ -739,7 +753,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\. @@ -752,7 +766,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 108831a..7a3b0a5 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,18 @@ Community RouterOS Release Notes .. contents:: Topics +v2.20.1 +======= + +Release Summary +--------------- + +This is the final community.routeros 2.x.y release. + +Please upgrade to community.routeros 3.x.y as soon as possible to receive further bugfixes. + +Thanks to everyone who contributed to community.routeros 2.x.y releases! + v2.20.0 ======= diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index 7185a2c..0ca7cbd 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -795,3 +795,18 @@ releases: - 322-add-l2tp-client-interface-configuration.yml - 323-add-ros-7.16-parameters.yml release_date: '2024-10-17' + 2.20.1: + changes: + release_summary: 'This is the final community.routeros 2.x.y release. + + + Please upgrade to community.routeros 3.x.y as soon as possible to receive + further bugfixes. + + + Thanks to everyone who contributed to community.routeros 2.x.y releases! + + ' + fragments: + - 2.20.1.yml + release_date: '2025-04-19' diff --git a/changelogs/fragments/2.20.1.yml b/changelogs/fragments/2.20.1.yml deleted file mode 100644 index b1b938e..0000000 --- a/changelogs/fragments/2.20.1.yml +++ /dev/null @@ -1,6 +0,0 @@ -release_summary: | - This is the final community.routeros 2.x.y release. - - Please upgrade to community.routeros 3.x.y as soon as possible to receive further bugfixes. - - Thanks to everyone who contributed to community.routeros 2.x.y releases! From 770e4d2c8dfc9eb661aee19b27abda6430acde81 Mon Sep 17 00:00:00 2001 From: hansmi Date: Sun, 20 Apr 2025 21:48:26 +0200 Subject: [PATCH 58/96] Rename Wireguard peer "is-responder" to "responder" for RouterOS 7.17 (#364) RouterOS 7.17 renamed the `is-responder` property in `/interface/wireguard/peers` to `responder`. --- changelogs/fragments/364-wireguard-responder.yml | 2 ++ plugins/module_utils/_api_data.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/364-wireguard-responder.yml diff --git a/changelogs/fragments/364-wireguard-responder.yml b/changelogs/fragments/364-wireguard-responder.yml new file mode 100644 index 0000000..73cd675 --- /dev/null +++ b/changelogs/fragments/364-wireguard-responder.yml @@ -0,0 +1,2 @@ +minor_changes: + - 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). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 10a6216..222155d 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -2441,7 +2441,8 @@ PATHS = { }, versioned_fields=[ ([('7.15', '>=')], 'name', KeyInfo()), - ([('7.15', '>=')], 'is-responder', KeyInfo()), + ([('7.15', '>='), ('7.17', '<')], 'is-responder', KeyInfo()), + ([('7.17', '>=')], 'responder', KeyInfo()), ], ), ), From 81237dbde4d0495680e23366d7098a368cae7e0a Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 20 Apr 2025 21:49:40 +0200 Subject: [PATCH 59/96] Prepare 3.6.0. --- changelogs/fragments/3.6.0.yml | 1 + changelogs/fragments/360-bgp-connection-afi.yml | 2 +- galaxy.yml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/3.6.0.yml diff --git a/changelogs/fragments/3.6.0.yml b/changelogs/fragments/3.6.0.yml new file mode 100644 index 0000000..512efc9 --- /dev/null +++ b/changelogs/fragments/3.6.0.yml @@ -0,0 +1 @@ +release_summary: Feature release. diff --git a/changelogs/fragments/360-bgp-connection-afi.yml b/changelogs/fragments/360-bgp-connection-afi.yml index 13e89ea..ff73916 100644 --- a/changelogs/fragments/360-bgp-connection-afi.yml +++ b/changelogs/fragments/360-bgp-connection-afi.yml @@ -1,2 +1,2 @@ minor_changes: - - api_modify, api_info - field name change in ``routing bgp connection`` path implemented by RouterOS 7.19 and newer (https://github.com/ansible-collections/community.routeros/pull/360). + - 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). diff --git a/galaxy.yml b/galaxy.yml index 3557098..2bd801f 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -7,7 +7,7 @@ namespace: community name: routeros -version: 3.5.0 +version: 3.6.0 readme: README.md authors: - Egor Zaitsev (github.com/heuels) From 180e87fd5dd000d1e646491676fa6fd39684ad7e Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Mon, 21 Apr 2025 13:40:42 +0200 Subject: [PATCH 60/96] Release 3.6.0. --- CHANGELOG.md | 262 ++++++++++-------- CHANGELOG.rst | 15 + changelogs/changelog.yaml | 16 ++ changelogs/fragments/3.6.0.yml | 1 - .../fragments/358-mdns-repeat-ifaces.yml | 2 - .../fragments/360-bgp-connection-afi.yml | 2 - .../fragments/364-wireguard-responder.yml | 2 - 7 files changed, 171 insertions(+), 129 deletions(-) delete mode 100644 changelogs/fragments/3.6.0.yml delete mode 100644 changelogs/fragments/358-mdns-repeat-ifaces.yml delete mode 100644 changelogs/fragments/360-bgp-connection-afi.yml delete mode 100644 changelogs/fragments/364-wireguard-responder.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index fd9b85b..136ba21 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,147 +2,150 @@ **Topics** -- 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\.5\.0 + +## v3\.6\.0 ### Release Summary @@ -152,17 +155,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)\)\. @@ -175,12 +193,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)\)\. @@ -191,12 +209,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)\)\. @@ -204,12 +222,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)\)\. @@ -222,7 +240,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\. @@ -240,12 +258,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)\)\. @@ -256,12 +274,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)\)\. @@ -273,12 +291,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)\)\. @@ -302,12 +320,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)\)\. @@ -317,12 +335,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)\)\. @@ -331,12 +349,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)\)\. @@ -353,12 +371,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)\)\. @@ -368,12 +386,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)\)\. @@ -387,12 +405,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)\)\. @@ -406,12 +424,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)\) @@ -426,12 +444,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)\)\. @@ -463,12 +481,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)\)\. @@ -482,7 +500,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -503,7 +521,7 @@ for the rendered HTML version of the documentation of the latest release\. ## v2\.8\.2 - + ### Release Summary Bugfix release\. @@ -516,7 +534,7 @@ Bugfix release\. ## v2\.8\.1 - + ### Release Summary Bugfix release\. @@ -529,12 +547,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)\)\. @@ -554,12 +572,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)\)\. @@ -572,12 +590,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)\)\. @@ -592,12 +610,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)\)\. @@ -610,12 +628,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)\)\. @@ -654,7 +672,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -667,12 +685,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)\)\. @@ -687,7 +705,7 @@ Feature and bugfix release\. ## v2\.2\.1 - + ### Release Summary Bugfix release\. @@ -701,12 +719,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)\)\. @@ -725,12 +743,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)\)\. @@ -754,12 +772,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)\)\. @@ -795,12 +813,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)\)\. @@ -816,12 +834,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)\)\. @@ -830,7 +848,7 @@ This release allow dashes in usernames for SSH\-based modules\. ## v1\.0\.1 - + ### Release Summary Maintenance release with a bugfix for api\. @@ -843,7 +861,7 @@ Maintenance release with a bugfix for api\. ## v1\.0\.0 - + ### Release Summary This is the first production \(non\-prerelease\) release of community\.routeros\. @@ -856,7 +874,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\. @@ -869,12 +887,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 6a82da8..744afef 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,21 @@ Community RouterOS Release Notes .. contents:: Topics +v3.6.0 +====== + +Release Summary +--------------- + +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). +- 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). +- 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). + v3.5.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index ee957d5..5bb0119 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -885,3 +885,19 @@ releases: - 3.5.0.yml - 350-ip-cloud-ddns-enabled-auto.yml release_date: '2025-03-22' + 3.6.0: + changes: + 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). + - 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). + - 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). + release_summary: Feature release. + fragments: + - 3.6.0.yml + - 358-mdns-repeat-ifaces.yml + - 360-bgp-connection-afi.yml + - 364-wireguard-responder.yml + release_date: '2025-04-21' diff --git a/changelogs/fragments/3.6.0.yml b/changelogs/fragments/3.6.0.yml deleted file mode 100644 index 512efc9..0000000 --- a/changelogs/fragments/3.6.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Feature release. diff --git a/changelogs/fragments/358-mdns-repeat-ifaces.yml b/changelogs/fragments/358-mdns-repeat-ifaces.yml deleted file mode 100644 index 3cd6d62..0000000 --- a/changelogs/fragments/358-mdns-repeat-ifaces.yml +++ /dev/null @@ -1,2 +0,0 @@ -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). diff --git a/changelogs/fragments/360-bgp-connection-afi.yml b/changelogs/fragments/360-bgp-connection-afi.yml deleted file mode 100644 index ff73916..0000000 --- a/changelogs/fragments/360-bgp-connection-afi.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - 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). diff --git a/changelogs/fragments/364-wireguard-responder.yml b/changelogs/fragments/364-wireguard-responder.yml deleted file mode 100644 index 73cd675..0000000 --- a/changelogs/fragments/364-wireguard-responder.yml +++ /dev/null @@ -1,2 +0,0 @@ -minor_changes: - - 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). From d1db4bec9210ac12678f7f814eb4bf24809831df Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Thu, 24 Apr 2025 20:38:56 +0200 Subject: [PATCH 61/96] 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 62/96] 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 63/96] 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 64/96] 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 65/96] 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 66/96] 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 67/96] 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 68/96] 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 69/96] 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 70/96] 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 71/96] 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 72/96] 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 73/96] 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 74/96] 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 75/96] 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 76/96] 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 77/96] 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 78/96] 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 79/96] 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 80/96] 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 81/96] 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 82/96] 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 83/96] 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 84/96] 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 85/96] 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 86/96] 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 87/96] 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 88/96] 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 89/96] 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 90/96] 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 91/96] 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\]: ?"), ] From e301f822d715df3d50429c7ace2a3bcaf0e19d33 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 10 Aug 2025 17:29:56 +0200 Subject: [PATCH 92/96] Update release summary. --- changelogs/fragments/3.9.0.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelogs/fragments/3.9.0.yml b/changelogs/fragments/3.9.0.yml index 63e0654..56de6d9 100644 --- a/changelogs/fragments/3.9.0.yml +++ b/changelogs/fragments/3.9.0.yml @@ -1 +1 @@ -release_summary: Feature release. \ No newline at end of file +release_summary: Bugfix and feature release. From e40a3b011cc8cb194005a0a6b98bfb424d798ad1 Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Sun, 10 Aug 2025 17:34:56 +0200 Subject: [PATCH 93/96] Release 3.9.0. --- CHANGELOG.md | 450 +++++++++--------- CHANGELOG.rst | 22 + changelogs/changelog.yaml | 27 ++ changelogs/fragments/3.9.0.yml | 1 - changelogs/fragments/380-ipv6-settings.yml | 3 - changelogs/fragments/381-logging-cef.yml | 2 - .../fragments/382-mangle-passthrough.yml | 2 - .../385-vrf-support-for-ovpn-server.yml | 7 - ...86-fix-pattern-to-handle-long-identity.yml | 3 - 9 files changed, 287 insertions(+), 230 deletions(-) delete mode 100644 changelogs/fragments/3.9.0.yml delete mode 100644 changelogs/fragments/380-ipv6-settings.yml delete mode 100644 changelogs/fragments/381-logging-cef.yml delete mode 100644 changelogs/fragments/382-mangle-passthrough.yml delete mode 100644 changelogs/fragments/385-vrf-support-for-ovpn-server.yml delete mode 100644 changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 88a7efe..af8c632 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,179 +2,205 @@ **Topics** -- v3\.8\.1 +- v3\.9\.0 - Release Summary - - Bugfixes -- v3\.8\.0 - - Release Summary - Minor Changes -- v3\.7\.0 + - Bugfixes +- v3\.8\.1 + - Release Summary + - Bugfixes +- 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 - - Bugfixes -- v3\.0\.0 +- v3\.1\.0 - Release Summary + - Minor Changes + - Bugfixes +- v3\.0\.0 + - 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 - - Deprecated Features - - Bugfixes -- v2\.17\.0 +- v2\.18\.0 - Release Summary - Minor Changes -- v2\.16\.0 + - Deprecated Features + - Bugfixes +- v2\.17\.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\.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 - Bugfixes -- v2\.6\.0 +- v2\.7\.0 - Release Summary - Minor Changes - Bugfixes -- v2\.5\.0 +- v2\.6\.0 - Release Summary - Minor Changes - Bugfixes -- v2\.4\.0 +- v2\.5\.0 - Release Summary - Minor Changes - Bugfixes - - Known Issues -- v2\.3\.1 +- v2\.4\.0 - Release Summary - - Known Issues -- v2\.3\.0 - - Release Summary - Minor Changes - Bugfixes -- v2\.2\.1 + - Known Issues +- v2\.3\.1 + - Release Summary + - Known Issues +- v2\.3\.0 - Release Summary - - Bugfixes -- v2\.2\.0 - - Release Summary - Minor Changes + - Bugfixes +- v2\.2\.1 + - Release Summary - Bugfixes - - New Modules -- v2\.1\.0 +- v2\.2\.0 - Release Summary - Minor Changes - Bugfixes - - New Modules -- v2\.0\.0 + - New Modules +- v2\.1\.0 - Release Summary - Minor Changes - - Breaking Changes / Porting Guide - Bugfixes + - New Modules +- v2\.0\.0 + - 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 - - Release Summary - Bugfixes -- v1\.0\.0 +- v1\.1\.0 + - Release Summary + - Minor Changes +- v1\.0\.1 - Release Summary - Bugfixes -- v0\.1\.1 +- v1\.0\.0 - Release Summary - Bugfixes -- v0\.1\.0 +- v0\.1\.1 - Release Summary - - Minor Changes + - Bugfixes +- v0\.1\.0 + - Release Summary + - Minor Changes - -## v3\.8\.1 + +## v3\.9\.0 ### Release Summary -Bugfix release\. +Bugfix and feature release\. + + +### 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](https\://github\.com/ansible\-collections/community\.routeros/pull/381)\)\. +* 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](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](https\://github\.com/ansible\-collections/community\.routeros/pull/380)\)\. +* 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](https\://github\.com/ansible\-collections/community\.routeros/pull/382)\)\. +* 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](https\://github\.com/ansible\-collections/community\.routeros/pull/383)\)\. ### 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](https\://github\.com/ansible\-collections/community\.routeros/pull/386)\)\. + + +## 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\. - + ### 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](https\://github\.com/ansible\-collections/community\.routeros/pull/375)\)\. @@ -185,20 +211,6 @@ Feature release\. ## 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/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\.6\.0 - ### Release Summary @@ -207,12 +219,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 @@ -222,22 +233,37 @@ 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)\)\. - + ### 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)\)\. @@ -245,12 +271,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)\)\. @@ -261,12 +287,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)\)\. @@ -274,17 +300,17 @@ 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)\)\. - + ### 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)\)\. @@ -292,7 +318,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\. @@ -310,12 +336,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)\)\. @@ -326,12 +352,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)\)\. @@ -343,12 +369,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)\)\. @@ -364,7 +390,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)\)\. @@ -372,21 +398,6 @@ 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)\)\. -* api\_info\, api\_modify \- add missing path /system resource irq rps \([https\://github\.com/ansible\-collections/community\.routeros/pull/295](https\://github\.com/ansible\-collections/community\.routeros/pull/295)\)\. -* api\_info\, api\_modify \- add parameter host\-key\-type for ip ssh path \([https\://github\.com/ansible\-collections/community\.routeros/issues/280](https\://github\.com/ansible\-collections/community\.routeros/issues/280)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/297](https\://github\.com/ansible\-collections/community\.routeros/pull/297)\)\. - - -## v2\.16\.0 - ### Release Summary @@ -395,11 +406,12 @@ 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)\)\. -* api\_info\, api\_modify \- minor changes /interface ethernet path fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/288](https\://github\.com/ansible\-collections/community\.routeros/pull/288)\)\. +* 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)\)\. +* api\_info\, api\_modify \- add missing path /system resource irq rps \([https\://github\.com/ansible\-collections/community\.routeros/pull/295](https\://github\.com/ansible\-collections/community\.routeros/pull/295)\)\. +* api\_info\, api\_modify \- add parameter host\-key\-type for ip ssh path \([https\://github\.com/ansible\-collections/community\.routeros/issues/280](https\://github\.com/ansible\-collections/community\.routeros/issues/280)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/297](https\://github\.com/ansible\-collections/community\.routeros/pull/297)\)\. - -## v2\.15\.0 + +## v2\.16\.0 ### Release Summary @@ -409,6 +421,20 @@ 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)\)\. +* api\_info\, api\_modify \- minor changes /interface ethernet path fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/288](https\://github\.com/ansible\-collections/community\.routeros/pull/288)\)\. + + +## 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)\)\. * api\_info\, api\_modify \- add /ip route rule path for RouterOS 6\.x \([https\://github\.com/ansible\-collections/community\.routeros/pull/278](https\://github\.com/ansible\-collections/community\.routeros/pull/278)\)\. * api\_info\, api\_modify \- add /routing filter path for RouterOS 6\.x \([https\://github\.com/ansible\-collections/community\.routeros/pull/279](https\://github\.com/ansible\-collections/community\.routeros/pull/279)\)\. @@ -423,12 +449,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)\)\. @@ -438,18 +464,18 @@ 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)\)\. * 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)\)\. @@ -457,12 +483,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)\)\. @@ -476,12 +502,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)\) @@ -496,12 +522,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)\)\. @@ -525,7 +551,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)\)\. @@ -533,18 +559,18 @@ 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)\)\. * 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)\)\. @@ -552,7 +578,7 @@ Bugfix and feature release\. ## v2\.8\.3 - + ### Release Summary Maintenance release with updated documentation\. @@ -573,19 +599,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 @@ -594,35 +607,23 @@ 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)\)\. +* 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\.0 + +## v2\.8\.1 ### 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)\)\. -* api\_modify \- add support for API path snmp community \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. -* api\_modify \- add support for trap\-interfaces in API path snmp \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. -* api\_modify \- add support to disable IPv6 in API paths ipv6 settings \([https\://github\.com/ansible\-collections/community\.routeros/pull/158](https\://github\.com/ansible\-collections/community\.routeros/pull/158)\)\. -* 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)\)\. +Bugfix release\. ### 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)\)\. -* api\_modify \- fix handling of disabled keys on creation \([https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\. -* various plugins and modules \- remove unnecessary imports \([https\://github\.com/ansible\-collections/community\.routeros/pull/149](https\://github\.com/ansible\-collections/community\.routeros/pull/149)\)\. +* 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\.7\.0 + +## v2\.8\.0 ### Release Summary @@ -632,28 +633,53 @@ 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)\)\. +* 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)\)\. +* api\_modify \- add support for API path snmp community \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. +* api\_modify \- add support for trap\-interfaces in API path snmp \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\. +* api\_modify \- add support to disable IPv6 in API paths ipv6 settings \([https\://github\.com/ansible\-collections/community\.routeros/pull/158](https\://github\.com/ansible\-collections/community\.routeros/pull/158)\)\. +* 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)\)\. +* api\_modify \- fix handling of disabled keys on creation \([https\://github\.com/ansible\-collections/community\.routeros/pull/154](https\://github\.com/ansible\-collections/community\.routeros/pull/154)\)\. +* various plugins and modules \- remove unnecessary imports \([https\://github\.com/ansible\-collections/community\.routeros/pull/149](https\://github\.com/ansible\-collections/community\.routeros/pull/149)\)\. + + +## 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)\)\. + + +### 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)\)\. ## 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)\)\. * 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)\)\. @@ -662,17 +688,17 @@ 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)\)\. - + ### 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)\)\. @@ -680,12 +706,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)\)\. @@ -706,7 +732,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)\)\. @@ -724,7 +750,7 @@ Feature release improving the api\* modules\. ## v2\.3\.1 - + ### Release Summary Maintenance release with improved documentation\. @@ -737,19 +763,19 @@ 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)\)\. * 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)\)\. @@ -757,12 +783,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)\)\. @@ -771,17 +797,17 @@ 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)\)\. - + ### 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)\)\. @@ -795,12 +821,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)\)\. @@ -809,7 +835,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)\)\. @@ -824,12 +850,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)\)\. @@ -843,7 +869,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)\)\. @@ -865,12 +891,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)\)\. @@ -878,7 +904,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)\)\. @@ -886,12 +912,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)\)\. @@ -900,12 +926,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)\)\. @@ -913,12 +939,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)\)\. @@ -926,12 +952,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)\)\. @@ -939,12 +965,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 2e73ef4..3fc3b05 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,28 @@ Community RouterOS Release Notes .. contents:: Topics +v3.9.0 +====== + +Release Summary +--------------- + +Bugfix and feature release. + +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). +- 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). +- 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). +- 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). + +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). + v3.8.1 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index df9d0e0..1ba1857 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -944,3 +944,30 @@ releases: - 3.8.1.yml - 384-warnings.yml release_date: '2025-07-26' + 3.9.0: + changes: + 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). + 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). + - 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). + - 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). + - 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). + release_summary: Bugfix and feature release. + fragments: + - 3.9.0.yml + - 380-ipv6-settings.yml + - 381-logging-cef.yml + - 382-mangle-passthrough.yml + - 385-vrf-support-for-ovpn-server.yml + - 386-fix-pattern-to-handle-long-identity.yml + release_date: '2025-08-10' diff --git a/changelogs/fragments/3.9.0.yml b/changelogs/fragments/3.9.0.yml deleted file mode 100644 index 56de6d9..0000000 --- a/changelogs/fragments/3.9.0.yml +++ /dev/null @@ -1 +0,0 @@ -release_summary: Bugfix and feature release. diff --git a/changelogs/fragments/380-ipv6-settings.yml b/changelogs/fragments/380-ipv6-settings.yml deleted file mode 100644 index a8c6e9b..0000000 --- a/changelogs/fragments/380-ipv6-settings.yml +++ /dev/null @@ -1,3 +0,0 @@ -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/changelogs/fragments/381-logging-cef.yml b/changelogs/fragments/381-logging-cef.yml deleted file mode 100644 index 849f82a..0000000 --- a/changelogs/fragments/381-logging-cef.yml +++ /dev/null @@ -1,2 +0,0 @@ -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/changelogs/fragments/382-mangle-passthrough.yml b/changelogs/fragments/382-mangle-passthrough.yml deleted file mode 100644 index 2123dfa..0000000 --- a/changelogs/fragments/382-mangle-passthrough.yml +++ /dev/null @@ -1,2 +0,0 @@ -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/changelogs/fragments/385-vrf-support-for-ovpn-server.yml b/changelogs/fragments/385-vrf-support-for-ovpn-server.yml deleted file mode 100644 index 4790a9d..0000000 --- a/changelogs/fragments/385-vrf-support-for-ovpn-server.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -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/changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml b/changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml deleted file mode 100644 index b9a749f..0000000 --- a/changelogs/fragments/386-fix-pattern-to-handle-long-identity.yml +++ /dev/null @@ -1,3 +0,0 @@ ---- -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). From 3b05f8a4cd559543e3e58222af083a1125916107 Mon Sep 17 00:00:00 2001 From: hansmi Date: Mon, 11 Aug 2025 19:59:46 +0200 Subject: [PATCH 94/96] Add show-at-cli-login property for system note (#392) RouterOS 7.14 (March 2024) added `show-at-cli-login` in `system note`. --- changelogs/fragments/392-sys-note-cli-login.yml | 2 ++ plugins/module_utils/_api_data.py | 3 +++ 2 files changed, 5 insertions(+) create mode 100644 changelogs/fragments/392-sys-note-cli-login.yml diff --git a/changelogs/fragments/392-sys-note-cli-login.yml b/changelogs/fragments/392-sys-note-cli-login.yml new file mode 100644 index 0000000..618db86 --- /dev/null +++ b/changelogs/fragments/392-sys-note-cli-login.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - add ``show-at-cli-login`` property in ``system note`` (https://github.com/ansible-collections/community.routeros/pull/392). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index 2b44b8b..fb4f919 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -4421,6 +4421,9 @@ PATHS = { unversioned=VersionedAPIData( single_value=True, fully_understood=True, + versioned_fields=[ + ([('7.14', '>=')], 'show-at-cli-login', KeyInfo(default=False)), + ], fields={ 'note': KeyInfo(default=''), 'show-at-login': KeyInfo(default=True), From db716c13687a7c09de769076e111ff95a68f54a8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Aug 2025 13:12:53 +0200 Subject: [PATCH 95/96] Bump actions/checkout from 4 to 5 in the ci group (#393) Bumps the ci group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: ci ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/nox.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nox.yml b/.github/workflows/nox.yml index 43cce99..a539157 100644 --- a/.github/workflows/nox.yml +++ b/.github/workflows/nox.yml @@ -21,7 +21,7 @@ jobs: name: "Run extra sanity tests" steps: - name: Check out collection - uses: actions/checkout@v4 + uses: actions/checkout@v5 with: persist-credentials: false - name: Run nox From fb070e4ac65e851bd3bb7d5afdb594c9d2ab07fe Mon Sep 17 00:00:00 2001 From: hansmi Date: Sun, 17 Aug 2025 12:55:56 +0200 Subject: [PATCH 96/96] Set default value for interface list include/exclude (#394) Without a default value a pre-existing value isn't removed unless the caller specifies the property. --- changelogs/fragments/394-iface-list-defaults.yml | 2 ++ plugins/module_utils/_api_data.py | 4 ++-- tests/unit/plugins/modules/test_api_info.py | 8 -------- 3 files changed, 4 insertions(+), 10 deletions(-) create mode 100644 changelogs/fragments/394-iface-list-defaults.yml diff --git a/changelogs/fragments/394-iface-list-defaults.yml b/changelogs/fragments/394-iface-list-defaults.yml new file mode 100644 index 0000000..7e517a6 --- /dev/null +++ b/changelogs/fragments/394-iface-list-defaults.yml @@ -0,0 +1,2 @@ +minor_changes: + - api_info, api_modify - set default value for ``include`` and ``exclude`` properties in ``system note`` to an empty string (https://github.com/ansible-collections/community.routeros/pull/394). diff --git a/plugins/module_utils/_api_data.py b/plugins/module_utils/_api_data.py index fb4f919..f1d131d 100644 --- a/plugins/module_utils/_api_data.py +++ b/plugins/module_utils/_api_data.py @@ -441,8 +441,8 @@ PATHS = { fully_understood=True, fields={ 'comment': KeyInfo(can_disable=True, remove_value=''), - 'exclude': KeyInfo(), - 'include': KeyInfo(), + 'exclude': KeyInfo(default=''), + 'include': KeyInfo(default=''), 'name': KeyInfo(), }, ), diff --git a/tests/unit/plugins/modules/test_api_info.py b/tests/unit/plugins/modules/test_api_info.py index 967a854..0fac95a 100644 --- a/tests/unit/plugins/modules/test_api_info.py +++ b/tests/unit/plugins/modules/test_api_info.py @@ -470,8 +470,6 @@ class TestRouterosApiInfoModule(ModuleTestCase): { '.id': '*2000010', 'name': 'WAN', - 'include': '', - 'exclude': '', 'comment': 'defconf', }, ]) @@ -523,24 +521,18 @@ class TestRouterosApiInfoModule(ModuleTestCase): { '.id': '*2000000', 'name': 'all', - 'include': '', - 'exclude': '', 'builtin': True, 'comment': 'contains all interfaces', }, { '.id': '*2000001', 'name': 'none', - 'include': '', - 'exclude': '', 'builtin': True, 'comment': 'contains no interfaces', }, { '.id': '*2000010', 'name': 'WAN', - 'include': '', - 'exclude': '', 'builtin': False, 'comment': 'defconf', },