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/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/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/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
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)
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)