Compare commits

..

397 commits
1.0.0 ... main

Author SHA1 Message Date
Claudio Luck
f6aeae1abd
Handle IP addresses configured on disappeared interfaces (#391)
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
* Handle IP addresses configured on disappeared interfaces

* Handle IP addresses configured on disappeared interfaces

Always set type property, add changelog fragment

* Handle IP addresses configured on disappeared interfaces (wording)

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Claudio Luck <claudio.luck@datact.ch>
Co-authored-by: Felix Fontein <felix@fontein.de>
2025-08-19 22:46:38 +02:00
hansmi
fb070e4ac6
Set default value for interface list include/exclude (#394)
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
Without a default value a pre-existing value isn't removed unless the
caller specifies the property.
2025-08-17 12:55:56 +02:00
dependabot[bot]
db716c1368
Bump actions/checkout from 4 to 5 in the ci group (#393)
Some checks failed
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Build Ansible Docs (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-08-12 13:12:53 +02:00
hansmi
3b05f8a4cd
Add show-at-cli-login property for system note (#392)
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
RouterOS 7.14 (March 2024) added `show-at-cli-login` in `system note`.
2025-08-11 19:59:46 +02:00
Felix Fontein
e40a3b011c Release 3.9.0.
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
2025-08-10 17:34:56 +02:00
Felix Fontein
e301f822d7 Update release summary. 2025-08-10 17:29:56 +02:00
Jefferson Raylan
7395011b0c
fix: Fix pattern to handle long system identity (#386)
Some checks failed
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Build Ansible Docs (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
* 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<MY_VERYVERY-LONG-SYSTEM-IDENTIY-NAME] > `

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 <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-07-31 22:02:47 +02:00
Felix Fontein
8edc8018a7
Ansible-core devel EE: use Python 3.12. (#387)
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
2025-07-31 07:18:42 +02:00
Felix Fontein
e78df4a4cf Prepare 3.9.0.
Some checks failed
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Build Ansible Docs (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-07-28 22:35:44 +02:00
Michael Jenny
c9d15bc43a
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 <felix@fontein.de>

* rename

* remove license field

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-07-28 22:34:15 +02:00
Tr4sK
008b5f893a
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 <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-07-28 22:33:40 +02:00
hansmi
b70b4a72b3
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
2025-07-28 22:33:24 +02:00
hansmi
1f38be9e56
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.
2025-07-28 22:33:11 +02:00
Felix Fontein
e988b18acf Normalize changelog configs.
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
2025-07-27 16:35:29 +02:00
Felix Fontein
6e9d2e1379 Release 3.8.1.
Some checks are pending
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
Collection Docs / Build Ansible Docs (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
2025-07-26 14:38:22 +02:00
Felix Fontein
1c182725ce
Prevent deprecation warnings when using ansible-core 2.19. (#385)
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
2025-07-25 22:26:39 +02:00
Felix Fontein
9099fcd698 Prepare 3.8.1. 2025-07-25 22:19:29 +02:00
Felix Fontein
852e21a2f2
Move EE tests to antsibull-nox. (#384)
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
2025-07-25 18:59:28 +02:00
Felix Fontein
bb7eadbc9f Avoid tabs.
Some checks failed
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-07-06 18:05:28 +02:00
Felix Fontein
d9be02bdb8 Adjust README.
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-07-01 22:34:37 +02:00
Felix Fontein
3475751b30
Add stable-2.19 to CI; add ignore-2.20.txt (#378)
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Waiting to run
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
* Add ignore-2.20.txt.

* Restrict stable-2.19 versions.
2025-07-01 07:24:51 +02:00
Felix Fontein
6008397375 Add linting check for RST code blocks.
Some checks failed
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-06-18 21:48:53 +02:00
Felix Fontein
b751d79a98 Update yamllint config, fix YAML.
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-06-17 07:19:14 +02:00
Felix Fontein
aa83116c78 Release 3.8.0.
Some checks failed
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-06-14 16:49:40 +02:00
Felix Fontein
4571d777de Prepare 3.8.0.
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-06-13 08:11:36 +02:00
Michael Jenny
c7b2275f2c
Support RouterOS path /interface ethernet switch port-isolation and /routing bfd configuration (#375)
* 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 <felix@fontein.de>

* 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 <felix@fontein.de>

* Update changelogs/fragments/375-port_isolation-and-routing_bfd_configuration.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Michael Jenny <mjenny@ansible.zvcloud.de>
2025-06-13 08:10:37 +02:00
SdVSysAdmin
49e4b83594
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 <papier@sdv.fr>
2025-06-13 08:10:27 +02:00
Felix Fontein
88806047e3 Enable no-trailing-whitespace test.
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-06-04 15:19:28 +02:00
Felix Fontein
221a697af9 Release 3.7.0.
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-05-31 16:57:51 +02:00
Felix Fontein
ab1026504c
Allow to ignore dynamic and builtin entries. (#373) 2025-05-31 16:50:52 +02:00
Felix Fontein
bfd6b0bb13 Prepare 3.7.0.
Some checks failed
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-05-29 14:59:45 +02:00
Michael Jenny
f5b952751e
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 <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-05-29 14:58:38 +02:00
Felix Fontein
5b81c157fe Add reformat commit to .git-blame-ignore-revs.
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-04-26 12:22:44 +02:00
Felix Fontein
08152376de Fix linting errors. 2025-04-26 12:18:29 +02:00
Felix Fontein
3af45c33f1 Add yamllint to antsibull-nox and add config files. 2025-04-26 12:18:29 +02:00
Felix Fontein
e52978b6d2 Fix info on blanket license statement for changelog fragments.
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-04-24 22:48:23 +02:00
Felix Fontein
d1db4bec92
Adjust EE tests. (#366)
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Waiting to run
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
2025-04-24 20:38:56 +02:00
Felix Fontein
180e87fd5d Release 3.6.0.
Some checks failed
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-04-21 13:40:42 +02:00
Felix Fontein
81237dbde4 Prepare 3.6.0.
Some checks are pending
Collection Docs / Build Ansible Docs (push) Waiting to run
Collection Docs / Publish Ansible Docs (push) Blocked by required conditions
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Waiting to run
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Waiting to run
nox / Run extra sanity tests (push) Waiting to run
nox / ansible-test (push) Waiting to run
2025-04-20 21:49:40 +02:00
hansmi
770e4d2c8d
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`.
2025-04-20 21:48:26 +02:00
Felix Fontein
4b9925ac23 Re-add reuse check.
Some checks failed
Collection Docs / Build Ansible Docs (push) Has been cancelled
execution environment / Build and test EE (ansible-core devel @ RHEL UBI 9) (push) Has been cancelled
execution environment / Build and test EE (ansible-core 2.15 @ Rocky Linux 9) (push) Has been cancelled
nox / Run extra sanity tests (push) Has been cancelled
nox / ansible-test (push) Has been cancelled
Collection Docs / Publish Ansible Docs (push) Has been cancelled
2025-04-19 13:11:42 +02:00
Felix Fontein
e286d768c0
Use antsibull-nox for CI. (#361) 2025-04-19 13:07:53 +02:00
Tim de Boer
9dba8082f9
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')
2025-04-10 13:03:08 +02:00
Felix Fontein
3a34752296 Migrate .reuse/dep5 to REUSE.toml. 2025-03-29 12:17:25 +01:00
hansmi
a920caa16a
Add "mdns-repeat-ifaces" field to "ip dns" (#358)
RouterOS 7.16 introduced an mDNS proxy, configurable via
`mdns-repeat-ifaces` under `/ip/dns`.
2025-03-26 06:51:10 +01:00
Felix Fontein
9d382a1b10 Release 3.5.0. 2025-03-22 12:39:33 +01:00
Felix Fontein
2b1be7f011 Prepare 3.5.0. 2025-03-21 22:07:58 +01:00
hansmi
8736996317
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.
2025-03-13 07:08:14 +01:00
Felix Fontein
30a79061f3
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.
2025-03-12 21:34:12 +01:00
hansmi
ab446b4449
Fix typo in "API" (#351) 2025-03-12 20:06:39 +01:00
Felix Fontein
be9a7ed3ad
Improve tests (#348)
* Simplify filter error tests.

* Convert set_module_args to context manager.
2025-03-07 20:45:39 +01:00
Felix Fontein
6aaead1d4a Group CI updates. 2025-03-03 19:00:16 +01:00
Felix Fontein
ffc928242b Release 3.4.0. 2025-02-24 06:33:52 +01:00
Felix Fontein
f54244b7d0 Prepare 3.4.0. 2025-02-24 06:19:51 +01:00
Felix Fontein
3ba33ccd99
Remove primary key. (#345) 2025-02-24 06:16:06 +01:00
Tim de Boer
e302fed6cf
Added support for 'ip dns forwarders' (#343) 2025-02-18 21:25:40 +01:00
Felix Fontein
9e4b6c197d Remove outdated comments. 2025-02-14 23:26:11 +01:00
Felix Fontein
a9f787fd76 Clean up workflow. 2025-02-11 22:50:43 +01:00
Felix Fontein
f6d50f8cc5 Release 3.3.0. 2025-01-27 05:32:10 +01:00
Peter Petrovich
388366542d
Add 'interface 6to4' path, allows manage 6to4 tunnels like HE (#342) 2025-01-26 12:52:36 +01:00
Peter Petrovich
575af30d88
DHCPv6 client: add new options from 7.15+ (#341)
* script
* custom-duid
* use-interface-duid
* validate-server-duid
2025-01-26 12:34:43 +01:00
Johannes Münch
85d24d180e
Fixes #284: Implement 'interface wireless access-list' and 'interface wireless connect-list' (#340)
Add changelog fragment
2025-01-24 21:40:39 +01:00
Felix Fontein
11454b802e Prepare 3.3.0. 2025-01-21 21:03:08 +01:00
Johannes Münch
364ef6c5fe
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 <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2025-01-21 20:48:38 +01:00
Felix Fontein
1466c9f984 Fix CI badge image URL. Add documentation badge. 2025-01-04 11:25:03 +01:00
Felix Fontein
dcdca90dd0 Add extra sanity test for routeros action group. 2025-01-03 14:49:49 +01:00
Felix Fontein
4241179471 Release 3.2.0. 2024-12-30 22:03:45 +01:00
Felix Fontein
71882863a5 Prepare 3.2.0 release. 2024-12-30 21:13:39 +01:00
Felix Fontein
44e6bb6f7a
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>
2024-12-30 21:11:17 +01:00
Felix Fontein
2a3460827d Fix doc fragments indents. 2024-12-29 15:48:00 +01:00
Felix Fontein
1e0c582b98 Improve formulations. 2024-12-28 16:52:27 +01:00
Felix Fontein
539119c57d
Reformat documentation with 'andebox yaml-doc' (#335)
* Reformat documentation with 'andebox yaml-doc'.

* Revert unwanted changes.
2024-12-28 15:34:20 +01:00
Felix Fontein
77de6d90bf Improve language. 2024-12-28 14:27:15 +01:00
Felix Fontein
995ab18e7b
Fix some issues pointed out by zizmor. (#333) 2024-12-14 14:56:14 +01:00
Serhiy
a7340eae1a
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
2024-12-14 14:20:58 +01:00
Felix Fontein
0bf4b3ef8c Release 3.1.0. 2024-12-02 20:45:03 +01:00
Felix Fontein
c3e57efa9d Forgot to bump version. 2024-12-02 20:44:15 +01:00
Felix Fontein
8dbad9a8d4 Prepare 3.1.0. 2024-12-02 20:39:54 +01:00
Felix Fontein
c27c1906aa Re-classify change as feature. 2024-12-02 20:39:48 +01:00
liquorice-head
249b1a92e2
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 <felix@fontein.de>

* Update test_api_info.py

* fix tests

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: alsmirnov <alsmirnov@ourgapps.com>
2024-11-23 00:19:05 +01:00
dependabot[bot]
14d89a3cfa
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] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-19 06:41:47 +01:00
gardar
d44262d820
fix: add missing fields to ip pool path (#327)
* fix: add missing fields to `ip pool` path

Signed-off-by: gardar <gardar@users.noreply.github.com>

* fix: remove unneeded copy-from

Signed-off-by: gardar <gardar@users.noreply.github.com>

---------

Signed-off-by: gardar <gardar@users.noreply.github.com>
2024-11-04 19:05:52 +01:00
Felix Fontein
5936c1ecef Release 3.0.0. 2024-10-20 10:38:22 +02:00
Felix Fontein
5fdbd52303 Fix reuse workflow branches. 2024-10-19 12:34:51 +02:00
Felix Fontein
e18de43407
Prepare 3.0.0 release (#318)
* Prepare 3.0.0 release.

* Install using ansible-galaxy via git instead of cloning directly.
2024-10-18 21:01:46 +02:00
Felix Fontein
26e3aa3e0a Release 2.20.0. 2024-10-17 21:10:19 +02:00
Felix Fontein
031490c974 Fix typo. 2024-10-17 21:09:42 +02:00
Felix Fontein
c5e913fc13 Prepare 2.20.0 release. 2024-10-14 20:59:23 +02:00
Johannes Münch
b499d9d7d9
Add new parameters from RouterOS 7.16 release (#323)
* Add new parameters from RouterOS 7.16 release

h3. /interface/bridge

- `forward-reserved-addresses` with default value `False`
- `max-learned-entries` with default value `auto`

h3. /ip/neighbor/discovery-settings

- `lldp-mac-phy-config` with default value `False` (from Router OS 7.15
release)
- `discover-interval` with default value `30s`
- `lldp-vlan-info` with default value `False`

h3. /ip/settings

- `ipv4-multipath-hash-policy` with default value `l3`

h3. /ipv6/settings

- `multipath-hash-policy` with default value `l3`

h3. /ip/dhcp-server/option

- `comment`

h3. /ip/dhcp-server/option/sets

- `comment`

h3. /ip/dhcp-server/matcher

- `comment`

h3. /tool/netwatch

- `acccept-icmp-time-exceeded` with default value `False`
- `ttl` with defaut value `255`

h3. /ip/service

- `max-sessions` with default value `20`

Add changelog fragment

* Update changelogs/fragments/323-add-ros-7.16-parameters.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-10-14 20:50:36 +02:00
liquorice-head
945e4d4d45
add l2tp client interface configuration support (#322)
* Update api_modify.py

* Update api_info.py

* Update _api_data.py

* Create 322-add-l2tp-client-interface-configuration.yml

* Update api_info.py

* Update api_modify.py

* Update _api_data.py

* Update changelogs/fragments/322-add-l2tp-client-interface-configuration.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update _api_data.py

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-10-13 21:36:36 +02:00
hansmi
22ff089787
Add cpu-frequency, memory-frequency, preboot-etherboot* properties (#320)
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2024-10-10 21:43:40 +02:00
hansmi
5adc664b04
Support DHCP matching type added in RouterOS 7.16 (#321) 2024-10-10 21:43:30 +02:00
Felix Fontein
c864078549
Add stable-2.18 to CI. (#317) 2024-09-24 13:47:53 +03:00
Felix Fontein
ff7e6162d7 Release 2.19.0. 2024-09-10 09:43:54 +02:00
Felix Fontein
fed11d36f7 Prepare 2.19.0. 2024-09-10 09:37:29 +02:00
Tr4sK
136250a802
Add default to snmp community api_data (#311)
* Add default to snmp community api_data

* Add changelog fragment

* fix typo

* suggestion from felixfontein

* suggestion from felixfontein

* Apply suggestions from code review

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-09-10 09:08:10 +02:00
hansmi
1942b3ddbb
Support "mld-version" and "multicast-querier" on bridge interfaces (#315)
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2024-09-09 22:57:41 +02:00
Tim de Boer
89b34bdd79
Added support for 'routing filter num-list' (#313)
* Added support for 'routing filter num-list'

* Added support for 'routing filter num-list', changelog

* Added support for 'routing filter num-list', changelog
2024-09-09 22:57:25 +02:00
Felix Fontein
8158d90d79
Remove link to Google Groups mailing list. (#314)
Ref: https://groups.google.com/g/ansible-project/c/B0oKR0aQqXs
2024-09-08 16:16:27 +02:00
hansmi
6c2101d4d8
Add support for the "ip dns adlist" path (#310)
Upstream documentation:
https://help.mikrotik.com/docs/display/ROS/DNS#DNS-Adlist
2024-08-22 08:57:28 +02:00
Felix Fontein
274e249f26 Improve communication link description. 2024-08-15 21:40:46 +02:00
hansmi
b4ea8b2fe7
Add support for the "routing igmp-proxy" path (#309)
Upstream documentation:
https://help.mikrotik.com/docs/display/ROS/IGMP+Proxy
2024-08-15 12:12:25 +02:00
Felix Fontein
5fb0bf0212 Improve RouterOS link. 2024-08-12 21:35:45 +02:00
Felix Fontein
1a2faec1c0 Release 2.18.0. 2024-08-12 21:20:16 +02:00
Felix Fontein
0a9b749508
api_modify/api_info: add restrict option (#305)
* Allow to restrict api_info output.

* Allow to restrict what api_modify modifies.

* Add changelog.

* Fix docs.

* Move shared code/docs to module utils and doc fragments.

* Refactor and allow to match by regex.

* Simplify rules, allow to invert rule matcher.

* Add more tests.
2024-08-12 21:16:59 +02:00
Felix Fontein
49cd8a2b2f
Announce dropping support for ansible-core < 2.15 in next major release. (#308) 2024-08-12 21:15:15 +02:00
Felix Fontein
1859ef9d35
Improve communication info. (#307) 2024-08-12 17:05:12 +02:00
Felix Fontein
877c9fa4fe
Fix default of ingress-filtering for ROS < 7. (#306) 2024-08-11 22:29:36 +02:00
Felix Fontein
78466d0de4 Prepare 2.18.0 release. 2024-08-11 20:12:54 +02:00
hansmi
6986e2fc25
Support name and is-responder properties on Wireguard peers (#304)
From the RouterOS 7.15 changelog:

```
*) wireguard - added option to mark peer as responder only;
*) wireguard - added peer "name" field and display it in logs;
```
2024-08-05 20:46:28 +02:00
hansmi
64ee613a0d
Add support for the "ipv6 nd prefix" path (#303)
Upstream documentation:
https://help.mikrotik.com/docs/display/ROS/IPv6+Neighbor+Discovery#IPv6NeighborDiscovery-Prefix
2024-08-01 17:06:02 +02:00
hansmi
ba806c0593
Add support for the "routing ospf static-neighbor" path (#302)
Upstream documentation:
https://help.mikrotik.com/docs/display/ROS/OSPF#OSPF-StaticNeighbourconfiguration

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2024-08-01 16:40:16 +02:00
hansmi
8c62d46198
Add IPv4 DHCP option matcher, minor fixes (#300)
* Fix typos in comment on IPsec policy "template" field

* Move IPv4 DHCP server API data next to other DHCP APIs

* Set default for "force" field on DHCP options

Without the default value removing it from the options after it's been
set once leads to an error:

> Key "force" cannot be removed for name="…"

* Add IPv4 DHCP option matcher

RouterOS 7.4 and newer implement matchers for the Vendor ID provided by
DHCP clients. RouterOS 7.16 will add a new `matching-type` property, but
it's not in a stable release yet.

Upstream documentation:
https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-Genericmatcher
2024-07-21 23:18:31 +02:00
Felix Fontein
5ee2af49b8 Small README change to hopefully trigger code coverage upload. 2024-07-12 19:11:49 +02:00
Felix Fontein
971145b284 Reformat and re-order changelogs/changelog.yaml. 2024-07-11 22:44:30 +02:00
Felix Fontein
f1232ee637 Release 2.17.0. 2024-07-09 22:31:11 +02:00
Felix Fontein
a6361844cd Prepare 2.17.0. 2024-07-09 22:19:52 +02:00
dependabot[bot]
05de3f2f05
Bump fsfe/reuse-action from 3 to 4 (#299)
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 3 to 4.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v3...v4)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-09 11:33:52 +02:00
Felix Fontein
d7b7f32e16 Update Galaxy description. 2024-07-08 15:59:21 +02:00
Felix Fontein
f45c85b818
Add link to forum. (#298) 2024-07-05 22:33:46 +02:00
Johannes Münch
3c717e40f9
Add parameter host-key-type for ip ssh path (#297)
Add changelog fragment
2024-06-29 17:33:08 +02:00
Felix Fontein
c2b43ac395
Adjust docs publishing workflow. (#296)
Ref: https://github.com/ansible-community/github-docs-build/issues/92
2024-06-29 17:22:39 +02:00
Igor
a6d2580a9e
Add support for '/system resource irq rps' path (#295) 2024-06-27 11:58:54 +02:00
Johannes Münch
91fef4e3a9
Add system health settings path (#294)
Add changelog fragment

Change changelog fragment to lower-case
2024-06-27 11:58:24 +02:00
Felix Fontein
dc7fa11f5d
Stop building EE with RHEL UBI 8. (#293) 2024-06-21 21:38:11 +02:00
Felix Fontein
2f46ff03fd Release 2.16.0. 2024-06-16 21:14:03 +02:00
Felix Fontein
d1be11ec08
Use ansible-community/eol-ansible for 2.9/2.10/2.11 tests. (#292) 2024-06-15 14:21:44 +02:00
Felix Fontein
f43a5ce446
Stop building EE with CentOS Stream 8, which no longer has builds. (#290) 2024-06-04 07:42:57 +02:00
Felix Fontein
6aebd8e359
From now on automatically add period to new plugins in changelog, and use FQCNs. (#289) 2024-05-20 08:45:26 +02:00
Felix Fontein
f5e8213498 Prepare 2.16.0. 2024-05-18 16:30:04 +02:00
samburney
331a97b12d
Add support for 'ppp secret' path (#286)
* Add support for 'ppp secret' path

* Add changelog fragment
2024-05-18 15:59:49 +02:00
Igor
1953a79942
minor changes '/interface ethernet' path fields (#288)
* minor changes '/interface ethernet' path fields

* add changelog fragment
2024-05-18 15:58:42 +02:00
Felix Fontein
24caea65d1
Add REUSE badge. (#287) 2024-05-15 21:47:43 +02:00
Felix Fontein
6116cde9dd
Pass codecov token to ansible-test-gh-action. (#285) 2024-05-11 23:12:16 +02:00
Felix Fontein
3862d1cea7 Release 2.15.0. 2024-04-20 11:48:35 +02:00
Igor
4a078c5913
Add RouterOS 6.x support for '/routing filter' path (#279)
* Add RouterOS 6.x support for '/routing filter' path

* add changelogs fragments
2024-04-18 12:30:25 +02:00
Igor
9d34cca66b
Add RouterOS 6.x support for '/ip route rule' path (#278)
* Add RouterOS 6.x support for '/ip route rule' path

* add changelogs fragments
2024-04-18 12:29:58 +02:00
Igor
018125ddfa
Add support for '/routing bgp' paths (#277)
* Add support for '/routing bgp' paths

* resolve conflicts

* add changelogs fragments
2024-04-18 12:29:44 +02:00
Igor
c6be3918ec
Add support for '/ip dhcp-relay' path (#276)
* Add support for '/ip dhcp-relay' path

* add changelogs fragments
2024-04-18 12:29:25 +02:00
Felix Fontein
18deb0b46b
Include changelog in docsite. (#281) 2024-04-18 12:23:21 +02:00
Felix Fontein
55817c112a Prepare 2.15.0 release. 2024-04-18 07:57:07 +02:00
samburney
6fde8f3baf
Add support for additional '/mpls' paths (#272)
* Add support for additional '/mpls' paths
- Enable '/mpls interface' for use in api_info/api_modify and update fields.
- Add '/mpls ldp accept-filter' path.
- Add '/mpls ldp advertise-filter' path.
- Add '/mpls ldp interface' path.

* Add changelogs/fragments/272-additional_mpls_path_support.yml

* Fixed new paths in api_info.py and api_modify.py

* Remove dot.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-04-18 07:55:57 +02:00
samburney
78d2fdd0f2
Add support for '/queue type' path (#274)
* Add support for '/queue type' path

* Add changelogs/fragments/274-add_queue_type_path.yml
2024-04-17 23:30:14 +02:00
samburney
62a795f995
Add support for '/interface pppoe-server server' path (#273)
* Add support for '/interface pppoe-server server' path

* Fixed one-session-per-host default value

* Add changelogs/fragments/273-add_interface_pppoe-server_support.yml
2024-04-17 23:29:57 +02:00
samburney
59f6591621
Add RouterOS 7.x support to '/mpls ldp' path (#271)
* Added RouterOS 7.x support to '/mpls ldp' path

* Updated /mpls ldp path
- Reordered fields to match CLI
- Set 'vrf' field as primary key
- Fixed distribute-for-default field
- Added missing fields from RouterOS 7.x

* Add changelog fragment
2024-04-17 23:28:40 +02:00
samburney
99581a00f7
Fix IPv6 address 'from-pool' default value (#270)
* Fix ipv6 address 'from-pool' default value

* Add changelog fragment for #270
2024-04-17 23:28:06 +02:00
samburney
506b3eba39
Add '/queue simple' path (#269)
* Add '/queue simple' path

* Add changelogs/fragments/260-add-queue_simple-path.yml

* Updated queue-simple path:
- Updated all default values to match those from the API
- Re-ordered fields to match API output
- Target is not required; added default value

* 'target' *is* required, however it interracts strangely with values of 0.0.0.0/0 and '' (Empty string).

* Updated PR in document fragment
2024-04-17 23:27:48 +02:00
Felix Fontein
8351bff0e9
Add stable-2.17 to CI; copy 2.17 ignore.txt files to 2.18. (#275) 2024-04-03 07:59:10 +02:00
Felix Fontein
a3fbe88f2f Release 2.14.0. 2024-03-25 14:04:48 +01:00
Andrei Costescu
edcd760dbf
Add interface wifi paths (#266)
* Add interface wifi paths

* Update changelog

* Remove most defaults
2024-03-25 13:57:24 +01:00
Felix Fontein
10a419465a Prepare 2.14.0 release. 2024-03-24 22:16:24 +01:00
Felix Fontein
d8ae2f41d2
Ignore pylint warnings for construct that does not work with Python 2 (#268)
* Ignore pylint warnings for construct that does not work with Python 2.

* Revert "Ignore pylint warnings for construct that does not work with Python 2."

This reverts commit 407b2ef93a.

* Different approach: use ignore.txt since otherwise ansible-core 2.14 tests fail.
2024-03-23 12:28:34 +01:00
dependabot[bot]
3d737d679d
Bump fsfe/reuse-action from 2 to 3 (#267)
Bumps [fsfe/reuse-action](https://github.com/fsfe/reuse-action) from 2 to 3.
- [Release notes](https://github.com/fsfe/reuse-action/releases)
- [Commits](https://github.com/fsfe/reuse-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: fsfe/reuse-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-05 07:12:46 +01:00
Felix Fontein
2ea1fef535
KeyInfo: prevent read_only usage with can_disable, remove_value, absent_value, default, or required (#265)
* Prevent read_only usage with can_disable, remove_value, absent_value, default, or required.

* Add test.
2024-03-03 09:03:25 +01:00
hansmi
84009262d0
Remove default value for "running" field in "interface wireless" (#264)
The `running` field can't be configured. By having a default value it's
written and shows up in diffs.
2024-03-03 08:32:41 +01:00
hansmi
ffd5a6370c
Add missing fields in "system package update" (#263)
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2024-03-02 12:49:37 +01:00
Felix Fontein
f616004caf Release 2.13.0. 2024-02-25 20:58:01 +01:00
Felix Fontein
afdda50ab0 Prepare 2.13.0 release. 2024-02-23 20:44:36 +01:00
Maurizio Pasquinelli
232a013c64
Fix date removal in nonverbose config (#262)
* Fix date removal in nonverbose config

As in newer versions of RouterOS the date format is 2024-10-02 and no longer 2024/10/02, the regex did no longer match all cases. This is fixed.

* Add changelog fragment
2024-02-20 20:29:41 +01:00
liquorice-head
10fbc564a7
Change ip vrf for router OS v7 (#259)
* Update api_info.py

* Update api_modify.py

* Update _api_data.py

* Update _api_data.py

* Update _api_data.py

* Update api_info.py

* Update api_modify.py

* Update api_info.py

* Update api_modify.py

* Create 259-add-routeros7-support-for-ip-vrf.yml

* Update changelogs/fragments/259-add-routeros7-support-for-ip-vrf.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-02-17 22:49:12 +01:00
Felix Fontein
6f7abfa8bc
Add MarkDown changelog. (#261) 2024-02-11 11:41:40 +01:00
Johannes Münch
542a362cee
Fixes #256: make path user group modifiable and add comment attribute (#257)
* Fixes #256: make path `user group` modifiable and add `comment` attribute`

Add changelog fragment

* Update changelogs/fragments/257-make-user_group-modifiable.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2024-02-01 18:48:14 +01:00
Felix Fontein
d1401bdb58 Release 2.12.0. 2024-01-21 08:47:39 +01:00
Felix Fontein
b56ba388f9
Simplifiy workflows. (#251) 2024-01-17 23:09:09 +01:00
Felix Fontein
3777b283b2
Use import galaxy workflow from https://github.com/ansible-collections/community.docker/pull/754. (#249) 2024-01-13 17:08:19 +01:00
Tim de Boer
d5a2686d20
Changed primary key of 'tool netwatch' (#247)
* Changed primary key of 'tool netwatch'

* Removed the primary key after discussion on PR #247

* Added changelog fragment
2024-01-07 14:04:20 +01:00
Johannes Münch
79dabbb67e
#162: Add 'routing rule' path (#246) 2024-01-06 16:52:17 +01:00
Felix Fontein
56ce47aef5
Update docs (#248)
* Add reference to module defaults groups docs.

* Fix bad quote.
2024-01-06 09:38:12 +01:00
Felix Fontein
9c75b9c5cd Fix module default group example. 2024-01-06 08:47:41 +01:00
derdeagle
1d6feda0b7
Add the 'radius' path (#245)
* Fixes #241: Add the 'radius' path

* Add changelog fragment

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
2023-12-28 08:35:28 +01:00
derdeagle
e4e5f64b46
Add '/routing bgp template' path (#243)
* Add '/routing bgp template' path

* Add changelog fragment

* Update changelogs/fragments/243-add-routing-bgp-template-path.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-26 16:46:40 +01:00
derdeagle
4fff1f1bbb
Add '/interface ovpn-client' path (#244)
* Fixes #242: Add '/interface ovpn-client' path

* Add changelog fragment

* Update changelogs/fragments/244-add-interface-ovpn-client-path.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-26 16:46:21 +01:00
Felix Fontein
a1492b4405 Bump both artifact actions to v4. 2023-12-18 19:28:45 +01:00
Felix Fontein
9b1b28599f Next release will be 2.12.0. 2023-12-14 07:53:29 +01:00
hansmi
332955aff5
Add support for the "tx-power" wireless parameter (#239)
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-12-14 07:52:37 +01:00
Yuri Timenkov
c5e51f9a93
Support for WifiWave2. (#226)
* Support for WifiWave2.

Added configuration profiles to configure Mikrotik APs which
have only WifiWave2 package.

* Addressed review comments

1. Sorted lexicographically new entries
2. Added versioning

* Added few related paths

* Fixed typos

* Lowered min version

* Added wifiwave2 interfaces

* Added upper version limit to WifiWave2

According to the documentation, new RouterOS version uses another
package.

* Addressed review comments
2023-12-14 07:51:48 +01:00
dependabot[bot]
482e5b2b7e
Bump actions/setup-python from 4 to 5 (#240)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 4 to 5.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-12 07:14:45 +01:00
Felix Fontein
ac89aa0ab7
Allow to declare some versions as unsupported, and to provide an explicit message. (#238) 2023-12-07 08:01:47 +01:00
Felix Fontein
eda8f64e8d Release 2.11.0. 2023-12-03 13:18:18 +01:00
derdeagle
ad6faf275d
Fixes #236: Add missing parameters for the "ip firewall" subpaths and set the default value for the "disabled" parameter for most paths (#237)
* Fixes #236: Add missing parameters

The parameters "address-list", "address-list-timeout", and "realm" were
missing for some subpaths of "ip firewall" and are now added.
Additionally the default value of "False" for the "disabled" parameter
has been set so that an e.g. firewall rule, which was disabled
(disabled=True) is enabled (disabled=False) after removing the
"disabled" argument in the data.

Some more parameters can now be removed, e.g. "jump-target", "log", and "log-prefix",
which are not mandatory.

* Add missing changes for #236

Additionally fixed the PR id in the changelog fragment.

* Update changelogs/fragments/237-add-missing-ip-firewall-attributes.yml

Full stop added at the end of the changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/237-add-missing-ip-firewall-attributes.yml

Full stop added at the end of the changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fix unit tests

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-12-03 13:02:08 +01:00
Felix Fontein
7de154e907 Prepare 2.11.0 release. 2023-11-30 06:41:36 +01:00
derdeagle
dac3b79a17
Fixes #230: Add missing DoH parameters in the "ip dns" path (#235)
- doh-max-concurrent-queries
- doh-max-server-connections
- doh-timeout

The parameters mentioned above seem to be added in version 7.8 as far as
I could tell from the changelogs.

Co-authored-by: Johannes Münch <git@washiza.eu>
2023-11-24 21:07:40 +01:00
derdeagle
92c6226394
Fix some bugs and adapt RouterOS v.7.12 changes (#234)
* Fix some bugs and adapt RouterOS v.7.12 changes

/ip traffic-flow target: make it a multiple value (single_value=False)
field
/routing id: add comment attribute
/tool e-mail: add versioning to the parameters as "address" was renamed to "server" in 7.12
/routing bgp connection: add missing attributes

* Add changelog fragment

* Fix duplicate key 'output.network'

* Split up the changelog fragment

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
2023-11-19 10:39:33 +01:00
hansmi
479f3106bf
Make wireless parameter "running" read-only (#233)
Commit e4a21311 added API data for the "interface wireless" path. It
contained the read-only "running" parameter. Writing to the parameter
fails:

  Error while modifying for name="…" (ID *3): unknown parameter running

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-11-11 23:10:10 +01:00
Felix Fontein
1beddb5854
Fix CI. (#232) 2023-11-07 22:57:17 +01:00
Felix Fontein
a823d66b33
Fix typos, improve markup (#231)
* Fix typos.

* Improve markup.
2023-10-29 08:28:00 +01:00
Felix Fontein
8a4b37c909 Next expected release is 2.11.0. 2023-10-08 12:45:40 +02:00
Felix Fontein
46d77ccc5c Release 2.10.0. 2023-10-08 12:15:04 +02:00
Felix Fontein
6a68469209
Add some read-only values to the user path. (#228) 2023-10-07 14:38:54 +02:00
Andrei Costescu
a6979c7f3d
Support routing id and bgp connection (#220)
* Support "/routing id"

https://help.mikrotik.com/docs/pages/viewpage.action?pageId=59965506

* Support "/routing bgp connection"

https://help.mikrotik.com/docs/display/ROS/BGP#BGP-ConnectionMenu

* Add changelog fragment

* Add period.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-10-07 14:38:37 +02:00
Andrei Costescu
226649ac13
Add upnp interfaces, graphing interface and resource (#227)
* Add ip upnp interfaces

* Add tool graphing interface and resource

* Update changelog
2023-10-07 14:25:52 +02:00
hansmi
9b4774c78d
Add support for the "port remote-access" path (#224)
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-10-07 14:25:11 +02:00
hansmi
29a01ea240
Add support for the "ip dhcp-server option" path (#223)
Make it possible to manage IPv4 DHCP server options.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-10-07 14:24:56 +02:00
Felix Fontein
efbc05ef73
Fix typo in changelog. (#225) 2023-09-28 21:13:47 +02:00
Felix Fontein
dc110500db
Fix snmp path's engine-id/engine-id-suffix for ROS 7.10+. (#218) 2023-09-19 18:02:26 +02:00
Felix Fontein
170240480c
Add ansible-core 2.16 to the matrix. (#222) 2023-09-19 17:51:13 +02:00
hansmi
d235437f8f
Add support for the "user" path (#211)
Make it possible to manage users via the `user` path.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-09-18 06:48:13 +02:00
hansmi
f6ed27c588
Fix for "'VersionedAPIData' object has no attribute 'fully_supported'" (#219)
Commit 4b09951 added code looking for a non-existent `fully_supported`
attribute.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-09-18 06:45:08 +02:00
Felix Fontein
81c4186497 Prepare 2.10.0 release. 2023-09-17 14:53:06 +02:00
hansmi
d601e10e22
Add support for "tool netwatch" (#216)
Upstream documentation:
https://help.mikrotik.com/docs/display/ROS/Netwatch

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-09-17 14:37:54 +02:00
hansmi
2bbaf26484
Finalize fields for "ppp profile" (#217)
A few defaults were missing for `ppp profile`. Mark the path as fully
understood to enable its use in Ansible tasks.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-09-17 14:37:29 +02:00
Felix Fontein
cf6c79e1b3
Implement basic support for read-only and write-only keys in api_info and api_modify (#213)
* Implement basic support for read-only and write-only keys in api_info and api_modify.

* Do not show write-only fields as 'disabled'.
2023-09-17 14:34:09 +02:00
hansmi
4d8ebaeb8d
Add support for "routing table" (#215)
Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-09-10 21:46:14 +02:00
dependabot[bot]
2350913075
Bump actions/checkout from 3 to 4 (#214)
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [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/v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 12:27:04 +02:00
Felix Fontein
dcc1cf441d
Allow to differ on API paths based on RouterOS version (2/2) (#212)
* Allow to add versioned field for paths.

* The field added in 1aa41ad375 is RouterOS 7.7+.

* The fields added in 2e1159b4c4 are RouterOS 7.5+.
2023-09-01 23:17:47 +02:00
Felix Fontein
4b0995135c
Allow to differ on API paths based on RouterOS version (1/2) (#209)
* Allow to provide definition for path based on API version.

* The paths added in 343c4883c0 are RouterOS 7+.
2023-09-01 22:27:18 +02:00
hansmi
1ed4690240
Support "date", "time" and "gmt-offset" in "system clock" (#210)
These properties are necessary to read and set the time as seen by
RouterOS.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-09-01 22:02:11 +02:00
Przemysław Sztoch
38ac303f93
Update ssh-guide.rst (#206)
* Update ssh-guide.rst

User is not allowed to login via SSH by password to Mikrotik if SSH key for the user is added!

* Update previous note as it is no longer the last one.

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-08-26 11:49:20 +02:00
hansmi
193218446a
Add support for "iot modbus" (#205)
The default values match those of RouterOS 7.11 on a Mikrotik
RB924i-2nD-BT5&BG77 ("Knot").

Upstream documentation:
https://help.mikrotik.com/docs/pages/viewpage.action?pageId=61046813

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-26 11:23:14 +02:00
hansmi
b7569b9dfd
Add support for "ipv6 firewall nat" (#204)
RouterOS supports NAT for IPv6 under the `ipv6 firewall nat` path.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-26 11:23:00 +02:00
hansmi
adff9bbf8c
Finalize fields for "interface wireless security-profiles" (#203)
A few fields were missing for `interface wireless security-profiles`
(e.g. `disabled`). `default` on the other hand is a built-in property
which can't be modified.

Mark the `interface wireless security-profiles` path as fully understood
to enable its use in Ansible tasks.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-21 21:32:43 +02:00
hansmi
11d83bffe6
Add "apn", remove "running" property for ppp-client interfaces (#202)
Commit 2164261 added support for `interface ppp-client`. It missed the
`apn` property and added the runtime-only `running` property.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-20 21:25:33 +02:00
hansmi
b0a4743de8
Add support for "user settings" (#201)
The `user settings` path contains settings related to passwords.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-20 14:20:16 +02:00
hansmi
343c4883c0
Add support for "routing filter {rule|select-rule}" (#200)
RouterOS 7 added route selections and filters
(https://help.mikrotik.com/docs/display/ROS/Route+Selection+and+Filters).

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-20 14:19:11 +02:00
hansmi
2164261e09
Add "interface ppp-client" to API data (#199)
The default values match those of RouterOS 7.11 on a Mikrotik
RB924i-2nD-BT5&BG77 ("Knot").

Upstream documentation: https://help.mikrotik.com/docs/display/ROS/PPP

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-20 14:17:49 +02:00
hansmi
1aa41ad375
Support "mode" in IPv4 neighbor discovery configuration (#198)
RouterOS 7.7 added a `mode` parameter to the IPv4 neighbor discovery
configuration.

Changelog: https://forum.mikrotik.com/viewtopic.php?t=192427

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-20 14:17:14 +02:00
hansmi
e4a21311a1
Add "interface wireless" to API data (#195)
The default values match those of RouterOS 7.11 on a Mikrotik
RB924i-2nD-BT5&BG77 ("Knot"). They're cross-checked with upstream
documentation[1].

[1] https://help.mikrotik.com/docs/display/ROS/Wireless+Interface

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-20 14:15:38 +02:00
hansmi
2e1159b4c4
Support "address-list" and "match-subdomain" in static DNS records (#197)
RouterOS 7.5 added `address-list` and `match-subdomain` as fields for
static DNS records.

Changelog: https://forum.mikrotik.com/viewtopic.php?t=188851

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-20 14:11:04 +02:00
hansmi
3b127b12fa
Sort "interface wireless security-profiles" with other wireless paths (#196)
Move the API data for `interface wireless security-profiles` to be in
order with the other entries for `interface wireless …`.

Signed-off-by: Michael Hanselmann <public@hansmi.ch>
2023-08-16 22:44:59 +02:00
Felix Fontein
ed2f326a6a Release 2.9.0. 2023-08-15 07:10:11 +02:00
derdeagle
53bb84ba2a
Fixes #193: Add caps-man channel and caps-man manager interface (#194)
* Fixes #193: Add caps-man channel and caps-man manager interface

Adding the caps-man channel path from scratch.
Activating the caps-man manager interface path.

* Add changelog fragment and documentation for both paths

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
2023-08-12 15:57:00 +02:00
Felix Fontein
d6f90e6937 Prepare 2.9.0 release. 2023-07-23 21:49:31 +02:00
derdeagle
6e62283120
Fixes #191: Add path 'ip traffic-flow target' (#192)
* Fixes #191: Add path 'ip traffic-flow target'

* Fixes #191: Add changelog fragment

* Fixes #192: Change changetype from major to minor as it is only adding a path and neither breaking existing things nor adding completely new functionality

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
2023-07-23 21:27:32 +02:00
derdeagle
e570c582d0
Fixes #189: Add missing /snmp parameter "engine-id-suffix" (#190)
* Fixes #189: Add missing /snmp parameter "engine-id-suffix"

* Fixes #189: Add changelog fragment after getting PR ID

* Update changelogs/fragments/180-fix-engine-id-suffix-in-snmp.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-07-16 21:15:48 +02:00
Felix Fontein
553a77aa91
Install and use Python 3.11 on RHEL UBI 9. (#188) 2023-07-12 19:24:44 +02:00
Felix Fontein
13e68fc906
Disable EE with ansible-core devel for now until UBI 9 has Python 3.10 support. (#187) 2023-07-12 08:12:37 +02:00
Felix Fontein
61c6b1dca8 Release 2.8.3. 2023-06-27 07:19:22 +02:00
Felix Fontein
ce7b2ef144 Prepare 2.8.3. 2023-06-22 21:24:40 +02:00
Felix Fontein
9d505ce903 Fix docs. 2023-06-22 20:56:51 +02:00
Felix Fontein
2333efcf0f Be lenient. 2023-06-22 20:42:09 +02:00
Felix Fontein
2e78a207e9
Use semantic markup (#185)
* Enable semantic markup.

* Use semantic markup.

* Break long lines.

* Add ignore entries.

* Ignore docs build error.
2023-06-22 13:18:08 +02:00
Felix Fontein
08c8c7ecc8
CI: Bump hard-coded Python versions to 3.11; drop Python 3.9 with devel. (#183) 2023-06-21 08:19:31 +02:00
Felix Fontein
1fb6915819 Release 2.8.2. 2023-06-19 16:42:18 +02:00
Felix Fontein
b7ef2fe1f8 Prepare 2.8.2 release. 2023-06-19 13:13:14 +02:00
derdeagle
af28e6419f
Fixes #179: Add missing /tool/e-mail parameter "tls" (#180)
* Fixes #179: Add missing /tool/e-mail parameter "tls"

In the
[documentation](https://help.mikrotik.com/docs/display/ROS/E-mail#Email-Properties) the parameter "tls" is mentioned but it cannot be used. The old "start-tls" parameter is not mentioned there (only on the [old documentation](https://wiki.mikrotik.com/wiki/Manual:Tools/email#Properties)).
Trying to use the paramter "tls" lead to the erro message `FAILED! => {"changed": false, "msg": "Unknown key \"tls\"."}`.

* Add changelog fragment

* Update changelogs/fragments/180-fix-tls-in-tool-email.yml

As suggested by felixfontein

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Johannes Münch <git@washiza.eu>
Co-authored-by: Felix Fontein <felix@fontein.de>
2023-06-19 13:12:20 +02:00
Felix Fontein
d098c209e7 Release 2.8.1. 2023-06-14 17:35:45 +02:00
Felix Fontein
9cfb31ab18 Prepare 2.8.1 release. 2023-06-09 06:08:40 +02:00
Felix Fontein
42ea132d60
Fix bug in preprocessing when wrapped line is appended to a non-existing entry. (#177) 2023-06-09 06:03:42 +02:00
Felix Fontein
2b8c66b983
Switch to Ansible Galaxy compatible requirements files for tests. (#173) 2023-05-21 13:48:07 +02:00
Felix Fontein
4ec0945e55
Rewrite EE test workflow to use ansible-builder 3.0.0 (#171)
* Rewrite EE test workflow to use ansible-builder 3.0.0.

* Extend list of potential errors.
2023-05-20 12:11:45 +02:00
Felix Fontein
dd1e48c388
Do extra docs validation; explicitly disallow semantic markup in docs (#165)
* Do extra docs validation. Explicitly disallow semantic markup in docs.

* Forgot to add new requirement.

* Improve test.

* TEMP - make CI fail.

* Remove unnecessary import.

* Make sure ANSIBLE_COLLECTIONS_PATH is set.

* Revert "TEMP - make CI fail."

This reverts commit 445c56e7e1bcd844be59f1df9df00a9c8334ff55.

* Make sure sanity tests from older Ansible versions don't complain.
2023-04-16 19:01:53 +02:00
Felix Fontein
e5eff0b90e Fix order. 2023-04-16 18:16:19 +02:00
Felix Fontein
a7f47c0419 More fixes. 2023-04-16 18:01:19 +02:00
Felix Fontein
0caec0f2c3
Fix bad comma. (#166) 2023-04-16 16:08:57 +02:00
Felix Fontein
189088611d
Update CI matrix: add stable-2.15 (#163)
* Add ignore files for bumped devel version.

* Update CI matrix.
2023-04-04 06:12:43 +00:00
Felix Fontein
c1bd819db5 Release 2.8.0. 2023-03-23 22:14:38 +01:00
Felix Fontein
07a3311792 Prepare 2.8.0 release. 2023-03-23 21:28:31 +01:00
Sam Grimee - LX2SG
c1a6ae8658
Workaround prompt issues between ROS 6.49 and 7.1.5 (#62) (#161)
* Prompt support for ROS 6.49+ (#62)

* More precise version match (#62)

* Add changelog fragment and lint (#62)

* Update changelogs/fragments/161-workaround-prompt-with-space.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Vendor version package to support older ansible versions (#62)

* Update plugins/module_utils/routeros.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/module_utils/routeros.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* move PSF-2.0.txt to LICENSES folder

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-23 21:25:23 +01:00
Felix Fontein
4329928474
ip dhcp-client: dhcp-options can be removed with value '' (#154)
* dhcp-options can be removed with value ''.

* Fix handling of disabled keys on creation.

* Fix typo.
2023-03-19 13:14:55 +01:00
phox142
071f742100
Adapt SNMP support (#159)
* snmp support

* Add changelog fragment

* Update changelogs/fragments/159-snmp_community.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/159-snmp_community.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-11 18:17:26 +01:00
phox142
720debb323
Add support to disable ipv6 in API paths `ipv6 settings` (#158)
* add support to disable ipv6

* Add changelogs fragment

* Update changelogs/fragments/158-ipv6_settings-disable.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-11 18:16:43 +01:00
phox142
4d86ba1a7d
Correction and Bugfix for ip dhcp-server network (#156)
* API_DATA > ('ip', 'dhcp-server', 'network') > netmask
replace "automatically_computed_from" by 'can_disable=True, remove_value=0'
automatically_computed_from does not seem to be used at any place in the code
without 'can_disable=True, remove_value=0' task is marked as changed at each execution.

* API_DATA > ('ip', 'dhcp-server', 'network') > next-server
replace "default=''" by 'can_disable=True'
The default in routeros is "no value" and it was not possible to remove a configured next-server

* API_DATA > ('ip', 'dhcp-server', 'network') > gateway
replace "automatically_computed_from" by "default=''"
automatically_computed_from does not seem to be used

* API_DATA > ('ip', 'dhcp-server', 'network') > dns-none
replace "default=''" by "default=False"

* Add changelogs fragment

* Update changelogs/fragments/156-ip_dhcp-server_network.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

---------

Co-authored-by: Felix Fontein <felix@fontein.de>
2023-03-10 07:01:26 +01:00
phox142
ab87a27018
Add support for "ip firewall layer7-protocol" (#153)
* Add support for "ip firewall layer7-protocol"

* Add changelog fragment

* Add changelog fragment
2023-02-27 22:37:00 +01:00
Felix Fontein
bbf5be5d71
Normalize bools in documentation. (#151) 2023-02-15 22:28:50 +01:00
Felix Fontein
d39b3522ab Remove unnecessary import. 2023-02-12 21:22:30 +01:00
Felix Fontein
1dfa79c5ef
Remove unnecessary test imports. (#150) 2023-02-12 21:17:22 +01:00
Felix Fontein
622680fe3f
Remove unneccessary imports (#149)
* Remove unneccessary imports.

* Add noqas.
2023-02-06 07:42:39 +01:00
Felix Fontein
e7dafebc7a Release 2.7.0. 2023-01-14 15:15:46 +01:00
Felix Fontein
7166a0b35c Prepare 2.7.0 release. 2023-01-14 14:12:35 +01:00
Tomas Herfert
f38b01d7bb
API update (#144)
* API update

Signed-off-by: Tomas Herfert <herfik>

* fix changelog fragment directory

Signed-off-by: Tomas Herfert <herfik>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
2023-01-01 22:18:24 +01:00
Felix Fontein
d2caf56215 Release 2.6.0. 2023-01-01 08:14:34 +01:00
Felix Fontein
709abfb13f Prepare 2.6.0 release. 2022-12-29 08:52:49 +01:00
Andrei Costescu
586edbc211
Add regexp field to ip dns static (#142)
* Add regexp field to "ip dns static"

* Change test_invalid_required_missing to use "ip dhcp-server"

"ip dns static" requires name or regexp so it cannot be used in this test.

* Add required_one_of attribute to APIData

Used by "ip dns static" which requires either "name" or "regexp.

* Add mutually_exclusive attribute to APIData

Used by "ip dns static" where only one of "name" or "regexp" can be used.

* Add changelog fragment
2022-12-29 08:51:40 +01:00
Andrei Costescu
62da7dd4e3
Add wireguard interface and peers (#143)
* Add wireguard interface and peers

* Add changelog fragment
2022-12-27 21:41:42 +01:00
Felix Fontein
8e3b19759d Improve docsite build. 2022-12-18 21:50:43 +01:00
Felix Fontein
282439b356 Switch to my fork of ansible-test-gh-action. 2022-12-18 09:51:43 +01:00
Felix Fontein
d37ec11ac5 The ansible-test patch has been backported to stable-2.12. 2022-12-17 19:39:03 +01:00
Felix Fontein
f935a41b8a Allow triggering docs workflow manually. 2022-12-07 19:54:25 +01:00
Felix Fontein
5fa47579af
Backports to stable-2.13 and stable-2.14 have been merged. (#140)
https://github.com/ansible/ansible/pull/79538
https://github.com/ansible/ansible/pull/79507
2022-12-07 13:21:10 +01:00
Felix Fontein
215576fa1b Release 2.5.0. 2022-12-04 13:14:41 +01:00
Felix Fontein
78f1236942 Prepare 2.5.0 release. 2022-12-04 13:09:32 +01:00
Felix Fontein
f58727e53b
Only use ubuntu-20.04 if necessary. (#139) 2022-12-02 08:49:13 +01:00
Felix Fontein
338a8f2cd6
Switch CI from ubuntu-latest to ubuntu-20.04 to avoid problems with ansible-test from ansible-core 2.12, 2.13, 2.14. (#138) 2022-12-01 23:15:37 +01:00
Tomas Herfert
4376906ed0
Paths (#137)
* support for "interface ethernet poe" and "interface vrrp"

Signed-off-by: Tomas Herfert <herfik>

* support "interface gre6" path

Signed-off-by: Tomas Herfert <herfik>

* ip dhcp-server - fix

Signed-off-by: Tomas Herfert <herfik>

* docs & changelog

Signed-off-by: Tomas Herfert <herfik>

* support for "interface ethernet poe" and "interface vrrp"

Signed-off-by: Tomas Herfert <herfik>

* support "interface gre6" path

Signed-off-by: Tomas Herfert <herfik>

* ip dhcp-server - fix

Signed-off-by: Tomas Herfert <herfik>

* docs & changelog

Signed-off-by: Tomas Herfert <herfik>

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-29 13:06:02 +01:00
Felix Fontein
4ed2fc82e5 Include collection name into docs workflows. 2022-11-27 17:44:37 +01:00
Felix Fontein
38e00caedb
Directly reference filters. (#136) 2022-11-26 22:06:43 +01:00
Felix Fontein
61b28ba22d Reference documentation in README. 2022-11-26 10:15:19 +01:00
Felix Fontein
0f5ac3f061 Add GH Pages publishing. 2022-11-26 09:38:34 +01:00
Felix Fontein
14ba81ac60 Release 2.4.0. 2022-11-18 13:17:00 +01:00
Felix Fontein
d1ff3b2730
Add more tests for api_info and api_modify (#135)
* Add tests for builtin entries.

* Add tests for combined default and can_disable.
2022-11-18 12:55:34 +01:00
Tomas Herfert
309e2b1910
terminal regex udpate to match the terminal prompt in safe mode (#134)
* terminal regex udpate to match the terminal prompt in safe mode

Signed-off-by: Tomas Herfert <herfik>

* changelog

Signed-off-by: Tomas Herfert <herfik>

* yamllint fix

Signed-off-by: Tomas Herfert <herfik>

* Update changelogs/fragments/134-command-safemode.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-17 21:03:42 +01:00
Tomas Herfert
5af14a8940
support for new API paths and few updates (#133)
* support for new API paths and few updates

Signed-off-by: Tomas Herfert <herfik>

* changelog fix

Signed-off-by: Tomas Herfert <herfik>

* tests update

Signed-off-by: Tomas Herfert <herfik>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
2022-11-17 20:14:07 +01:00
Tomas Herfert
23b3aa3beb
API update (#128)
* adding support for api fields that can be disabled and have default value at the same time

Signed-off-by: Tomas Herfert <herfik>

* api path support: interface gre

Signed-off-by: Tomas Herfert <herfik>

* docs

Signed-off-by: Tomas Herfert <herfik>

* unit test update & yamlling fix

Signed-off-by: Tomas Herfert <herfik>

* test fix

Signed-off-by: Tomas Herfert <herfik>

* sanity fix

Signed-off-by: Tomas Herfert <herfik>

* changelog

Signed-off-by: Tomas Herfert <herfik>

* Update per suggestion

Co-authored-by: Felix Fontein <felix@fontein.de>

* api path support: interface eoip

Signed-off-by: Tomas Herfert <herfik>

* docs

Signed-off-by: Tomas Herfert <herfik>

* apply suggestion from code review

Signed-off-by: Tomas Herfert <herfik>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-17 12:48:50 +01:00
Felix Fontein
1353055fe2 Allow changelog fragments with .yaml ending. 2022-11-17 12:42:01 +01:00
Tomas Herfert
b539ed6aa4
make api_modify to ignore builtin items (#130)
* make api_modify to ignore builtin items

Signed-off-by: Tomas Herfert <herfik>

* include_builtin parametr for api_info module

Signed-off-by: Tomas Herfert <herfik>

* api_info ignore_builtin changelog

Signed-off-by: Tomas Herfert <herfik>

* typo

Signed-off-by: Tomas Herfert <herfik>

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-16 22:31:49 +01:00
Tomas Herfert
4194ae9ba6
multiple api paths support and updates (#131)
* multiple api paths support and updates

Signed-off-by: Tomas Herfert <herfik>

* sanity fix

Signed-off-by: Tomas Herfert <herfik>

* another sanity fix

Signed-off-by: Tomas Herfert <herfik>

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-15 22:11:55 +01:00
Tomas Herfert
c48f4c74ce
support for multiple "ip ipsec *" API paths (#129)
Signed-off-by: Tomas Herfert <herfik>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
2022-11-13 21:14:45 +01:00
Tomas Herfert
29247faaa3
system logging API paths (#127)
* api path support: system logging action

Signed-off-by: Tomas Herfert <herfik>

* api path support: system logging

Signed-off-by: Tomas Herfert <herfik>

* docs & changelog

Signed-off-by: Tomas Herfert <herfik>

* typo fix

Signed-off-by: Tomas Herfert <herfik>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
2022-11-13 10:02:29 +01:00
Tomas Herfert
60427fff5e
Capsman API paths (#126)
* api path support: caps-man datapath

Signed-off-by: Tomas Herfert <herfik>

* api path support: caps-man security

Signed-off-by: Tomas Herfert <herfik>

* api path support: caps-man configuration

Signed-off-by: Tomas Herfert <herfik>

* api path support: caps-man access-list

Signed-off-by: Tomas Herfert <herfik>

* api path support: caps-man manager

Signed-off-by: Tomas Herfert <herfik>

* api path support: caps-man provisioning

Signed-off-by: Tomas Herfert <herfik>

* docs & changelog

Signed-off-by: Tomas Herfert <herfik>

* yamllint fix

Signed-off-by: Tomas Herfert <herfik>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
2022-11-12 16:09:34 +01:00
Tomas Herfert
ad9d7c3829
Support for additional API paths (#125)
* adding api path interface pppoe-client

Signed-off-by: Tomas Herfert <herfik>

* support for api path interface vlan

Signed-off-by: Tomas Herfert <herfik>

* support for api path interface bridge vlan

Signed-off-by: Tomas Herfert <herfik>

* PR ID update

Signed-off-by: Tomas Herfert <herfik>

* typo fix

Signed-off-by: Tomas Herfert <herfik>

* support for API path interface bridge and update of interface bridge port ingress-filtering to True

Signed-off-by: Tomas Herfert <herfik>

* Apply suggestion per code review

Signed-off-by: Tomas Herfert <herfik>

* Update changelogs/fragments/125-api.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-12 16:08:25 +01:00
PhiBo
9567bbf292
Add new api option force_no_cert (#124)
* Add new option force_no_cert

Connect to a router without a certificate by using ADH ciphers.
This can be useful when setting up a device.

* Changelog

* Update plugins/doc_fragments/api.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/124-api.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-12 09:47:52 +01:00
Felix Fontein
78d8cfb1ad Prepare 2.4.0 release. 2022-11-10 21:12:40 +01:00
Felix Fontein
9fc22be186
api_modify, api_info: support more fields in existing paths (#121)
* Support more paths.

* Forgot comma.

* Adjust tests.

* power-cycle-ping-address and power-cycle-ping-timeout can be unset

Co-authored-by: Tomas Herfert <68421396+therfert@users.noreply.github.com>

Co-authored-by: Tomas Herfert <68421396+therfert@users.noreply.github.com>
2022-11-10 21:10:24 +01:00
PhiBo
558eb501d2
Add support for ip route and ip route vrf (#123)
* Add support for ip route and ip route vrf

* Changelog
2022-11-10 21:09:58 +01:00
Tomas Herfert
1e36dfa2d0
adding "system ntp *" paths related to ROS7 (#122)
* adding "system ntp *" paths related to ROS7

Signed-off-by: Tomas Herfert <herfik>

* changelog

Signed-off-by: Tomas Herfert <herfik>

* docs

Signed-off-by: Tomas Herfert <herfik>

* typo

Signed-off-by: Tomas Herfert <herfik>

* sanity fix

Signed-off-by: Tomas Herfert <herfik>

* setting the correct defaults

Signed-off-by: Tomas Herfert <herfik>

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

* typo

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-10 21:09:03 +01:00
Tomas Herfert
c2e58c3ae4
Interface list (#120)
* interface list & member

Signed-off-by: Tomas Herfert <herfik>

* adding changelog fragment

Signed-off-by: Tomas Herfert <herfik>

* changelog fix

Signed-off-by: Tomas Herfert <herfik>

* sanity fix

Signed-off-by: Tomas Herfert <herfik>

* Apply suggestions from code review

Co-authored-by: Felix Fontein <felix@fontein.de>

Signed-off-by: Tomas Herfert <herfik>
Co-authored-by: Tomas Herfert <herfik>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-09 21:10:25 +01:00
Felix Fontein
3b3d2171b4 Release 2.3.1. 2022-11-06 22:02:28 +01:00
Felix Fontein
fc0d483848 Prepare 2.3.1 release. 2022-11-06 20:59:44 +01:00
Felix Fontein
835cec5e24
Use attributes to document module capabilities; warn about command module's check_mode support (#118)
* Improve formatting.

* Add 'api' action group attribute.

* Document attributes.

* Known issue: command module declares to support check mode.

* Compatibility with older ansible-core releases.

* Fix typo.

* Improve docs.

* Add shortcuts for common combinations.

* Update changelogs/fragments/command-check_mode.yml

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>

Co-authored-by: Brian Scholer <1260690+briantist@users.noreply.github.com>
2022-11-06 20:58:06 +01:00
Felix Fontein
29b604464a Use dependabot to update GHAs. 2022-10-17 22:57:35 +02:00
Felix Fontein
bbcd9fecef
Bump GHA checkout version (#116)
* Bump checkout version.

* Also update actions/setup-python actions.
2022-10-17 22:51:58 +02:00
Felix Fontein
6526588f13 stable-2.14 is now default. 2022-09-22 06:38:39 +02:00
Felix Fontein
5affbf6b05
Add stable-2.14 to CI. (#112) 2022-09-21 10:40:45 +02:00
Felix Fontein
7500dceb8e Release 2.3.0. 2022-09-11 17:42:49 +02:00
Felix Fontein
fb0340c6e6 Prepare 2.3.0 release. 2022-09-11 17:26:35 +02:00
Felix Fontein
3c0ad57eb5
Extend API support. (#110) 2022-09-11 17:25:25 +02:00
TobsA
776b599ffe
Added timeout setting for api. (#109)
* Added timeout setting for api.

* Added changelog fragment

* Added "version_added" to api doc

* Added "," for better diff

* Fixed case and punctuation in changelog

Co-authored-by: Felix Fontein <felix@fontein.de>

* Fixed url in changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-07 21:10:11 +02:00
Felix Fontein
47bbf95fa3 Fix workflow's permissions. 2022-08-21 11:35:29 +02:00
Felix Fontein
d77cd95f91
Make reuse conformant (#108)
* Add .license files.

* Add reuse test.

* Update README.

* Add changelog fragment.

* Normalize licenses extra sanity test.

* Declare REUSE conformance.

* Update README.
2022-08-21 08:31:42 +02:00
Felix Fontein
615b9e6952 Release 2.2.1. 2022-08-20 20:10:10 +02:00
Felix Fontein
a642f0b9eb Prepare 2.2.1 release. 2022-08-13 10:56:50 +02:00
Felix Fontein
f797b4a231
Support absent values. Support absent value 'all' for 'server' in /ip dhcp-server lease. (#107) 2022-08-13 10:55:37 +02:00
Felix Fontein
a2ace3fb79
Add missing options for 'ip dhcp-server network'. (#106) 2022-08-13 10:54:48 +02:00
Felix Fontein
96c6feff8e Revert "Fix CI."
This reverts commit ec98df2f49.
2022-08-11 22:43:19 +02:00
Felix Fontein
ec98df2f49 Fix CI. 2022-08-10 20:44:32 +02:00
Felix Fontein
98bb520ce7
Use ansible-community/ansible-test-gh-action for CI (#103)
* Use ansible-community/ansible-test-gh-action for CI

Based upon https://github.com/ansible-collections/collection_template/pull/29.

* Avoid trailing ';'.

* Fix relative paths for collection installs.

* Try multi-line command.

* Prevent trailing newline.
2022-08-04 22:34:00 +02:00
Felix Fontein
af6524a1fd
Fix docs. (#105) 2022-08-04 14:32:01 +02:00
Felix Fontein
a66bb78d7f Release 2.2.0. 2022-07-31 22:30:07 +02:00
Felix Fontein
fa13c5f9cb Prepare 2.2.0 release. 2022-07-31 22:08:09 +02:00
Felix Fontein
2911710f1b
Add api_info and api_modify modules (#91)
* Add api_info and api_modify modules.

* Add documentation, and cross-references for the modules.

* Bump version added for new modules.

* Ignore dynamic entries. Allow _info module to return them.

* Document behavior for dynamic entries.

* Update license headers.

* Add disclaimer.

* Improve formulation.

* Auto-generate path list in DOCUMENTATION.

* Add test to make sure lists have been generated automatically.
2022-07-31 22:06:19 +02:00
Felix Fontein
1abaa8e7ca
Improve sanity test, improve README. (#102) 2022-07-20 23:05:15 +02:00
Felix Fontein
7973f58661
Move licenses to LICENSES/, use SPDX-License-Identifier, mention all licenses in galaxy.yml, add missing license file (#101)
* Add SPDX license identifiers, mention all licenses in galaxy.yml.

* Add default copyright headers.

* Adjust remaining/missing entries.

* Fix/add more copyright statements.

* Add sanity test.

* Add changelog.

* Add missing license file.

* Remove colon after 'Copyright'.

* Avoid colon after 'Copyright' in lint script.
2022-07-18 23:16:54 +02:00
Felix Fontein
49fb46c4a3
Add docs PR workflow that a) builds docs and b) show the docs diff that a PR ceates. (#99) 2022-06-29 21:12:24 +02:00
Felix Fontein
b02cb44c1b
Improve CI. (#97) 2022-06-11 20:06:02 +00:00
Felix Fontein
3a34bb9ba4 Release 2.1.0. 2022-05-25 06:27:08 +02:00
Felix Fontein
6e104c962b
Extend documentation. (#96) 2022-05-24 22:51:27 +02:00
Felix Fontein
023f11f7e1
Add encoding option to API modules (#95)
* Set encoding to UTF-8.

* Add encoding parameter to API modules.

* librouteros is now patched.
2022-05-24 22:19:26 +02:00
Felix Fontein
7452195071 Prepare 2.1.0 release. 2022-05-24 18:39:59 +02:00
Felix Fontein
ff66ba9289
Add api_find_and_modify module. (#93) 2022-05-24 18:23:44 +02:00
Nikolay Dachev
d57de117f5
update community.routeros.api query functionality (#63)
* update query to accept multiple librouteros ADN parameters

* update query for new yml strucutre

* add extended_query as separate function:(code in progress)

* extended_query main code is ready for review

* add changelog #63

* small fix for code indentation

* fix pep

* clear all pep issues

* extended_query ready for review (new yml structure)

* small doc fix for std query

* Update changelogs/fragments/63-add-extended_query.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update changelogs/fragments/63-add-extended_query.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update argument spec.

* Other suggestions.

* Fix syntax errors ('is' and 'or' are keywords).

* Make everything work again.

* Add docs, simplify code.

* Add some first tests.

* Do not add fake message when there is no search result.

* Improve tests.

* Fix tests.

* update extened query docs and ros api module examples

* fix pep plugins/modules/api.py:154:1: W293: blank line contains whitespace

* fix extended query example intend

* Update plugins/modules/api.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* Update plugins/modules/api.py

Co-authored-by: Felix Fontein <felix@fontein.de>

* fix example docs

Co-authored-by: dako <dako@syslin.sof.dachev.lan>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-23 14:44:02 +03:00
Felix Fontein
109e534976
ansible-core's devel version supports Python 3.11. (#94) 2022-05-22 17:14:53 +02:00
Felix Fontein
5f912dad16
Improve unit test performance. (Do not install library we do not use in the tests anyway.) (#92) 2022-05-15 22:42:26 +02:00
Felix Fontein
ea782c1cf2
Add module defaults group community.routeros.api. (#90) 2022-05-13 13:18:28 +02:00
Felix Fontein
3d80ccec5f
Add api_facts module (#88)
* Add API docs fragment.

* Improve documentation.

* Move API code to api module_utils.

* Improve docs.

* Add api_facts module.

Does not yet support 'config'. I'm not sure whether that's actually
possible with the API.

* Convert subnet to integer if possible.

* Cleanup.

* Linting and fix tests.

* Remove things that make no sense.

* Simplify code.

* Add basic tests.

* Lint.
2022-05-12 16:17:43 +02:00
Felix Fontein
a90c696589
Correctly handle \_ escape sequence. (#89) 2022-05-09 22:09:08 +02:00
Felix Fontein
02ecc0ca9d
Add filter documentation (#87)
* Add filter documentation.

* Update no-unwanted-files sanity check.
2022-04-30 16:40:59 +02:00
Felix Fontein
d56410b468
Accept new error. (#85) 2022-04-27 09:26:03 +02:00
Felix Fontein
0815b11bbf
Increase verbosity for EE tests (#84)
* Increase verbosity for EE tests.

* 2.9 compatibility.
2022-04-16 07:09:02 +02:00
Felix Fontein
30afb61f86
Make EE ready. (#83) 2022-04-15 17:22:39 +00:00
Felix Fontein
e22433b179
Schedule nightly CI at 5:15. (#81) 2022-04-15 15:07:03 +02:00
Felix Fontein
ebe6e93773
Bump codecov action. (#79) 2022-04-14 22:38:38 +02:00
Felix Fontein
7b3900fd6e
Update GHAs. (#77) 2022-04-11 09:03:47 +02:00
Felix Fontein
cf2882772f
Switch from antsibull to antsibull-docs. (#75) 2022-04-10 10:52:48 +02:00
Felix Fontein
3e39e8473f
Replace antsibull-lint collection-docs with antsibull-docs lint-collection-docs. (#73) 2022-03-30 08:06:30 +02:00
Felix Fontein
a8ba15e556
Add stable-2.13 to CI. (#72) 2022-03-29 06:16:43 +02:00
Felix Fontein
5105c423c8
Add collection links file. (#71) 2022-03-22 07:04:34 +01:00
Nikolay Dachev
a46c7df15c
Fix query (#68)
* fix issues #67

* fix query id check

* add changelog fragment

* fix changelog fragment new line

* fix changelog fragment new line2

* Update changelogs/fragments/68-fix-query-id-check.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-02-10 07:53:08 +01:00
txt-file
e9fdf19253
fix typo (#64) 2022-01-22 08:26:53 +01:00
Felix Fontein
1deeb9f372 Restrict branches for which to run tests. 2021-11-25 21:21:55 +01:00
Felix Fontein
656c115697
Also collect coverage during sanity tests. (#59) 2021-11-25 20:59:19 +01:00
Felix Fontein
e74687a8e0 Add patchback config. 2021-11-16 22:03:31 +01:00
Felix Fontein
4603507713
Restrict librouteros for Ansible 2.9 unit tests. (#57) 2021-11-16 22:00:07 +01:00
Felix Fontein
26b341f332 Release 2.0.0 2021-10-31 15:30:38 +01:00
Felix Fontein
9cb843b872 Prepare 2.0.0 release. 2021-10-31 15:11:49 +01:00
Felix Fontein
4ccd70cc8f
Fix sanity errors. (#55) 2021-10-19 13:04:30 +01:00
Felix Fontein
65034de769
Replace deprecated v1 codecov updater with v2. (#54) 2021-10-14 15:23:00 +02:00
Felix Fontein
e158fcf0ae Release 2.0.0-a2. 2021-10-14 08:33:45 +02:00
Felix Fontein
f6e929ae3a Prepare 2.0.0-a2 release. 2021-10-13 07:52:55 +02:00
Felix Fontein
d73eb1c144
Add module_utils and filters for quoting and unquoting (#53)
* Move splitting code to own file.

* Move list to dictionary code to quoting as well.

* Add quoting functionality.

* Add quoting filters.

* Add integration tests to CI.

* Fix bugs, increase coverage.

* Make parsing more strict.

* Extract function parse_argument_value from split_routeros_command to make proper parsing of WHERE possible.

* Adjust expected error message in integration tests.

* Simplify code and improve coverage.

* Add changelog fragment for WHERE strictness in api module.

* Add documenation.

* Fix typo.

* Add documentation references.

* Add example to api module which uses quote_argument_value.

* Fix bug, and add tests which prevent this in the future.

* Add more escape sequence tests.

* Make sure all control characters are quoted.
2021-10-12 00:44:40 +03:00
Felix Fontein
f9d246cd7a
Make command always return changed=true. (#50) 2021-10-09 13:36:14 +02:00
Akim Lindberg
5042905471
fix(api): fixed a bug when splitting the argument string (#45)
* fix(api): fixed a bug when splitting the argument string

* fix(api): added the shlex module for splitting

* fix(api): added the shlex module for splitting

* fix(api): moved shlex.split to self method split_params

* Fix indentation.

* Implement custom splitting algorithm.

* Raise AssertionError in case of internal error.

* Update plugins/modules/api.py

this is correct thanks !

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Nikolay Dachev <nikolay@dachev.info>
2021-09-29 15:02:28 +02:00
Felix Fontein
f432b1fa07
Update CI matrix to include ansible-core's stable-2.12 branch (#52)
* Update CI matrix to include ansible-core's stable-2.12 branch.

* Adjust README.
2021-09-28 15:35:05 +02:00
Felix Fontein
f99202812a Prepare ansible-core devel branch version bump that is planned for later today. 2021-09-24 18:45:56 +02:00
Felix Fontein
48c7920072
Improve split handling. (#47) 2021-09-09 23:19:57 +03:00
Felix Fontein
a88f4c804b
Fix sanity failures (#43)
* Fix sanity failures.

* Add changelog fragment.
2021-08-12 08:53:21 +02:00
Felix Fontein
bd113788ef Release 2.0.0-a1. 2021-07-31 11:16:14 +02:00
Felix Fontein
42babbe50f 2.0.0 -> 2.0.0-a1. 2021-07-31 11:13:25 +02:00
Felix Fontein
b45fd9415f Next version on main branch will be 2.0.0. 2021-07-11 15:54:16 +02:00
Felix Fontein
69682054e1
Allow api module to fail (#39)
* Allow api module to fail.

* Improve error handling.

* Fix api unit tests.

* Add very basic tests of return values.

* Update api.py

fix ignoring the Fail task if we get TrapError

* Do not mangle fail result, and adjust tests.

* Improve changelog fragment.

* Reclassify changelog fragment as minor_changes, improve text.

* Mark changelog as 'breaking change'.

Co-authored-by: Nikolay Dachev <nikolay@dachev.info>
2021-07-11 15:53:22 +02:00
Felix Fontein
df88a7ec99
Use devel docs links. (#41) 2021-07-07 13:29:49 +02:00
Felix Fontein
3e4427b53a
Fix extra-tests name. (#40) 2021-07-04 12:07:47 +02:00
Felix Fontein
4a6e2df45c Next expected release is 1.3.0. 2021-06-29 18:40:02 +02:00
Felix Fontein
efc563aaac Release 1.2.0. 2021-06-29 18:27:16 +02:00
Felix Fontein
12181c8dc0 Prepare 1.2.0 release. 2021-06-28 22:22:56 +02:00
Felix Fontein
75b4b966a6
Add options to control certificate validation for api module (#37)
* Add options to control certificate validation for api module.

* Linting.

* Extend documentation.

* Fix validate_cert_hostname=true.

* Add documentation on setting up certificates on a RouterOS device.
2021-06-28 20:33:37 +02:00
Felix Fontein
937aa0dbfa
Replace ansible.module_utils._text by ansible.module_utils.common.text.converters (#38)
* Replace ansible.module_utils._text by ansible.module_utils.common.text.converters.

* One more.
2021-06-27 09:53:45 +02:00
Felix Fontein
39dcf4ac5b
Add basic scenario guides (#36)
* Add extra docs.

* Mention more quirks.

* Work around RST quirks.
2021-06-23 21:18:00 +02:00
Jadyn
b45baaa158
Disable use of deprecated Ciphers (#34)
* Disable use of depricated Ciphers

Old ciphers shouldn't be used. Devices that use newer ciphers couldn't be reached as the cipher was locked to sslv3.

* chore: add changelog fragment
2021-06-15 19:14:34 +02:00
Felix Fontein
1913a0d4bf
Improve CI. (#35) 2021-06-14 11:23:35 +00:00
Felix Fontein
0b25643712
Clarify Windows (non-)support (#29)
* Clarify Windows (non-)support.

* Rewrite.
2021-05-11 08:19:00 +02:00
Felix Fontein
6bed4d1c90
Update Python versions for integration tests: add Python 3.10 (#30)
* Update Python versions for integration tests (that currently do not exist).

* 3.10 in YAML is 3.1...
2021-05-10 19:28:05 +02:00
Felix Fontein
055a07822e
Add ansible-test config file. (#28) 2021-05-01 22:20:26 +02:00
Felix Fontein
e797f2e07d
ansible/ansible's stable-2.11 branch has been created. (#26) 2021-04-06 05:10:50 +00:00
Petr Klíma
1c18d34536
Verbose config extra fact (#23)
* allow nonverbose idempotent config

* nonverbose config output

* typpo

* typpo

* release fragment

* config extra fact

* add fact ansible_net_config_nonverbose

* unit tests

* changelog fragments

* remove version fragment

* remove extra debug printf()

* update chlog fragment

* corrections for upstream pull request

* corrections for upstream pull request

* typo in changelog fragment

Co-authored-by: Felix Fontein <felix@fontein.de>

* typo in filename

Co-authored-by: Petr Klima <petr.klima@madeta.cz>
Co-authored-by: Felix Fontein <felix@fontein.de>
2021-03-29 19:05:10 +02:00
Felix Fontein
7bab58eae9
Stop using ansible-galaxy collection install to install a collection due to https://github.com/ansible/galaxy/issues/2429. (#24) 2021-03-27 09:57:59 +01:00
Felix Fontein
36ff772aaa Next regular release is 1.2.0. 2021-01-04 13:21:10 +01:00
Felix Fontein
5c11a27345 Release 1.1.0. 2021-01-04 13:20:42 +01:00
Felix Fontein
992d5b3025 Add release summary. 2021-01-03 21:43:38 +01:00
Felix Fontein
99ede01d63
Fix plugin 'name'. (#19) 2020-12-25 10:45:55 +03:00
Egor Zaitsev
389924be6e
feat: support dashes in username (#18)
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-12-24 14:46:05 +03:00
Egor Zaitsev
b322351c11
docs: add note about hostnames and nested commands (#16)
* docs: add note about hostnames and nested commands

* docs: clarify command nesting

* Update README.md

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-12-18 13:12:08 +01:00
Felix Fontein
fbc47fb503 Next expected release is 1.1.0. 2020-12-11 21:04:39 +01:00
Felix Fontein
e1534da6aa Release 1.0.1. 2020-12-11 20:44:27 +01:00
Felix Fontein
5526cc1a1e Prepare 1.0.1 release. 2020-12-11 20:42:01 +01:00
Nikolay Dachev
6c618cab26
remove .id restriction for list_to_dic (#15)
* remove .id restriction for list_to_dic

* add change log

* Update changelogs/fragments/13-remove-id-restriction-for-api.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: dako <dako@syslin.sof.dachev.lan>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-12-10 23:43:03 +02:00
Felix Fontein
649809b2be
Fix bool default value. (#12) 2020-11-22 20:46:05 +03:00
Felix Fontein
32bcf8b02c Bump to next minor release. 2020-11-17 07:25:50 +01:00
137 changed files with 19814 additions and 1244 deletions

6
.git-blame-ignore-revs Normal file
View file

@ -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

15
.github/dependabot.yml vendored Normal file
View file

@ -0,0 +1,15 @@
---
# 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: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
ci:
patterns:
- "*"

9
.github/patchback.yml vendored Normal file
View file

@ -0,0 +1,9 @@
---
# 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
backport_branch_prefix: patchback/backports/
backport_label_prefix: backport-
target_branch_prefix: stable-
...

View file

@ -1,170 +0,0 @@
name: CI
on:
# Run CI against all pushes (direct commits, also merged PRs), Pull Requests
push:
pull_request:
# Run CI once per day (at 06:00 UTC)
schedule:
- cron: '0 6 * * *'
jobs:
###
# Sanity tests (REQUIRED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_sanity.html
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.9
- stable-2.10
- devel
runs-on: ubuntu-latest
steps:
# ansible-test requires the collection to be in a directory in the form
# .../ansible_collections/community/routeros/
- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/community/routeros
- name: Set up Python
uses: actions/setup-python@v2
with:
# it is just required to run that once as "ansible-test sanity" in the docker image
# will run on all python versions it supports.
python-version: 3.8
# Install the head of the given branch (devel, stable-2.10)
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Install collection dependencies
run: ansible-galaxy collection install ansible.netcommon -p .
# run ansible-test sanity inside of Docker.
# The docker container has all the pinned dependencies that are required
# and all python versions ansible supports.
- name: Run sanity tests
run: ansible-test sanity --docker -v --color
working-directory: ./ansible_collections/community/routeros
###
# Unit tests (OPTIONAL)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_units.html
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.9
- stable-2.10
- devel
steps:
- name: Check out code
uses: actions/checkout@v2
with:
path: ansible_collections/community/routeros
- name: Set up Python ${{ matrix.ansible }}
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install ansible-base (${{ matrix.ansible }})
run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
- name: Install collection dependencies
run: ansible-galaxy collection install ansible.netcommon -p .
# Run the unit tests
- name: Run unit tests for all Python versions
run: ansible-test units -v --color --docker --coverage
working-directory: ./ansible_collections/community/routeros
# ansible-test support producing code coverage date
- name: Generate coverage report
run: ansible-test coverage xml -v --requirements --group-by command --group-by version
working-directory: ./ansible_collections/community/routeros
# See the reports at https://codecov.io/gh/ansible_collections/ansible-collections/community.routeros
- uses: codecov/codecov-action@v1
with:
fail_ci_if_error: false
###
# Integration tests (RECOMMENDED)
#
# https://docs.ansible.com/ansible/latest/dev_guide/testing_integration.html
# If the application you are testing is available as a docker container and you want to test
# multiple versions see the following for an example:
# https://github.com/ansible-collections/community.zabbix/tree/master/.github/workflows
# integration:
# runs-on: ubuntu-latest
# name: I (Ⓐ${{ matrix.ansible }}+py${{ matrix.python }}})
# strategy:
# fail-fast: false
# matrix:
# ansible:
# - stable-2.9
# - stable-2.10
# - devel
# python:
# - 2.6
# - 2.7
# - 3.5
# - 3.6
# - 3.7
# - 3.8
# - 3.9
# exclude:
# - ansible: stable-2.9
# python: 3.9
#
# steps:
# - name: Check out code
# uses: actions/checkout@v2
# with:
# path: ansible_collections/community/routeros
#
# - name: Set up Python ${{ matrix.ansible }}
# uses: actions/setup-python@v2
# with:
# python-version: 3.8
#
# - name: Install ansible-base (${{ matrix.ansible }})
# run: pip install https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz --disable-pip-version-check
#
# - name: Install collection dependencies
# run: ansible-galaxy collection install ansible.netcommon -p .
#
# # Run the integration tests
# - name: Run integration test
# run: ansible-test integration -v --color --retry-on-error --continue-on-error --diff --python ${{ matrix.python }} --docker --coverage
# working-directory: ./ansible_collections/community/routeros
#
# # ansible-test support producing code coverage date
# - name: Generate coverage report
# run: ansible-test coverage xml -v --requirements --group-by command --group-by version
# working-directory: ./ansible_collections/community/routeros
#
# # See the reports at https://codecov.io/gh/ansible_collections/ansible-collections/community.routeros
# - uses: codecov/codecov-action@v1
# with:
# fail_ci_if_error: false

97
.github/workflows/docs-pr.yml vendored Normal file
View file

@ -0,0 +1,97 @@
---
# 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: Collection Docs
concurrency:
group: docs-pr-${{ github.head_ref }}
cancel-in-progress: true
'on':
pull_request_target:
types: [opened, synchronize, reopened, closed]
env:
GHP_BASE_URL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}
jobs:
build-docs:
permissions:
contents: read
name: Build Ansible Docs
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-pr.yml@main
with:
collection-name: community.routeros
init-lenient: false
init-fail-on-error: true
squash-hierarchy: true
init-project: Community.Routeros Collection
init-copyright: Community.Routeros Contributors
init-title: Community.Routeros Collection Documentation
init-html-short-title: Community.Routeros Collection Docs
init-extra-html-theme-options: |
documentation_home_url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/branch/main/
render-file-line: '> * `$<status>` [$<path_tail>](https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/pr/${{ github.event.number }}/$<path_tail>)'
provide-link-targets: |
ansible_collections.ansible.netcommon.network_cli_connection__parameter-ssh_type
publish-docs-gh-pages:
# for now we won't run this on forks
if: github.repository == 'ansible-collections/community.routeros'
permissions:
contents: write
pages: write
id-token: write
needs: [build-docs]
name: Publish Ansible Docs
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main
with:
artifact-name: ${{ needs.build-docs.outputs.artifact-name }}
action: ${{ (github.event.action == 'closed' || needs.build-docs.outputs.changed != 'true') && 'teardown' || 'publish' }}
publish-gh-pages-branch: true
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
comment:
permissions:
pull-requests: write
runs-on: ubuntu-latest
needs: [build-docs, publish-docs-gh-pages]
name: PR comments
steps:
- name: PR comment
uses: ansible-community/github-docs-build/actions/ansible-docs-build-comment@main
with:
body-includes: '## Docs Build'
reactions: heart
action: ${{ needs.build-docs.outputs.changed != 'true' && 'remove' || '' }}
on-closed-body: |
## Docs Build 📝
This PR is closed and any previously published docsite has been unpublished.
on-merged-body: |
## Docs Build 📝
Thank you for contribution!✨
This PR has been merged and the docs are now incorporated into `main`:
${{ env.GHP_BASE_URL }}/branch/main
body: |
## Docs Build 📝
Thank you for contribution!✨
The docs for **this PR** have been published here:
${{ env.GHP_BASE_URL }}/pr/${{ github.event.number }}
You can compare to the docs for the `main` branch here:
${{ env.GHP_BASE_URL }}/branch/main
The docsite for **this PR** is also available for download as an artifact from this run:
${{ needs.build-docs.outputs.artifact-url }}
File changes:
${{ needs.build-docs.outputs.diff-files-rendered }}
${{ needs.build-docs.outputs.diff-rendered }}

55
.github/workflows/docs-push.yml vendored Normal file
View file

@ -0,0 +1,55 @@
---
# 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: Collection Docs
concurrency:
group: docs-push-${{ github.sha }}
cancel-in-progress: true
'on':
push:
branches:
- main
- stable-*
tags:
- '*'
# Run CI once per day (at 05:15 UTC)
schedule:
- cron: '15 5 * * *'
# Allow manual trigger (for newer antsibull-docs, sphinx-ansible-theme, ... versions)
workflow_dispatch:
jobs:
build-docs:
permissions:
contents: read
name: Build Ansible Docs
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-push.yml@main
with:
collection-name: community.routeros
init-lenient: true
init-fail-on-error: true
squash-hierarchy: true
init-project: Community.Routeros Collection
init-copyright: Community.Routeros Contributors
init-title: Community.Routeros Collection Documentation
init-html-short-title: Community.Routeros Collection Docs
init-extra-html-theme-options: |
documentation_home_url=https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/branch/main/
publish-docs-gh-pages:
# for now we won't run this on forks
if: github.repository == 'ansible-collections/community.routeros'
permissions:
contents: write
pages: write
id-token: write
needs: [build-docs]
name: Publish Ansible Docs
uses: ansible-community/github-docs-build/.github/workflows/_shared-docs-build-publish-gh-pages.yml@main
with:
artifact-name: ${{ needs.build-docs.outputs.artifact-name }}
publish-gh-pages-branch: true
secrets:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

35
.github/workflows/nox.yml vendored Normal file
View file

@ -0,0 +1,35 @@
---
# 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: nox
'on':
push:
branches:
- main
- stable-*
pull_request:
# Run CI once per day (at 05:15 UTC)
schedule:
- cron: '15 5 * * *'
workflow_dispatch:
jobs:
nox:
runs-on: ubuntu-latest
name: "Run extra sanity tests"
steps:
- name: Check out collection
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Run nox
uses: ansible-community/antsibull-nox@main
ansible-test:
uses: ansible-community/antsibull-nox/.github/workflows/reusable-nox-matrix.yml@main
with:
upload-codecov: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

5
.gitignore vendored
View file

@ -1,5 +1,10 @@
# 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
/tests/output/
/changelogs/.plugin-cache.yaml
/tests/integration/inventory
# Byte-compiled / optimized / DLL files
__pycache__/

53
.yamllint Normal file
View file

@ -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 <felix@fontein.de>
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

54
.yamllint-docs Normal file
View file

@ -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 <felix@fontein.de>
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

54
.yamllint-examples Normal file
View file

@ -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 <felix@fontein.de>
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

53
.yamllint-extra-docs Normal file
View file

@ -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 <felix@fontein.de>
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

977
CHANGELOG.md Normal file
View file

@ -0,0 +1,977 @@
# Community RouterOS Release Notes
**Topics**
- <a href="#v3-9-0">v3\.9\.0</a>
- <a href="#release-summary">Release Summary</a>
- <a href="#minor-changes">Minor Changes</a>
- <a href="#bugfixes">Bugfixes</a>
- <a href="#v3-8-1">v3\.8\.1</a>
- <a href="#release-summary-1">Release Summary</a>
- <a href="#bugfixes-1">Bugfixes</a>
- <a href="#v3-8-0">v3\.8\.0</a>
- <a href="#release-summary-2">Release Summary</a>
- <a href="#minor-changes-1">Minor Changes</a>
- <a href="#v3-7-0">v3\.7\.0</a>
- <a href="#release-summary-3">Release Summary</a>
- <a href="#minor-changes-2">Minor Changes</a>
- <a href="#v3-6-0">v3\.6\.0</a>
- <a href="#release-summary-4">Release Summary</a>
- <a href="#minor-changes-3">Minor Changes</a>
- <a href="#v3-5-0">v3\.5\.0</a>
- <a href="#release-summary-5">Release Summary</a>
- <a href="#minor-changes-4">Minor Changes</a>
- <a href="#v3-4-0">v3\.4\.0</a>
- <a href="#release-summary-6">Release Summary</a>
- <a href="#minor-changes-5">Minor Changes</a>
- <a href="#bugfixes-2">Bugfixes</a>
- <a href="#v3-3-0">v3\.3\.0</a>
- <a href="#release-summary-7">Release Summary</a>
- <a href="#minor-changes-6">Minor Changes</a>
- <a href="#v3-2-0">v3\.2\.0</a>
- <a href="#release-summary-8">Release Summary</a>
- <a href="#minor-changes-7">Minor Changes</a>
- <a href="#v3-1-0">v3\.1\.0</a>
- <a href="#release-summary-9">Release Summary</a>
- <a href="#minor-changes-8">Minor Changes</a>
- <a href="#bugfixes-3">Bugfixes</a>
- <a href="#v3-0-0">v3\.0\.0</a>
- <a href="#release-summary-10">Release Summary</a>
- <a href="#breaking-changes--porting-guide">Breaking Changes / Porting Guide</a>
- <a href="#removed-features-previously-deprecated">Removed Features \(previously deprecated\)</a>
- <a href="#v2-20-0">v2\.20\.0</a>
- <a href="#release-summary-11">Release Summary</a>
- <a href="#minor-changes-9">Minor Changes</a>
- <a href="#v2-19-0">v2\.19\.0</a>
- <a href="#release-summary-12">Release Summary</a>
- <a href="#minor-changes-10">Minor Changes</a>
- <a href="#v2-18-0">v2\.18\.0</a>
- <a href="#release-summary-13">Release Summary</a>
- <a href="#minor-changes-11">Minor Changes</a>
- <a href="#deprecated-features">Deprecated Features</a>
- <a href="#bugfixes-4">Bugfixes</a>
- <a href="#v2-17-0">v2\.17\.0</a>
- <a href="#release-summary-14">Release Summary</a>
- <a href="#minor-changes-12">Minor Changes</a>
- <a href="#v2-16-0">v2\.16\.0</a>
- <a href="#release-summary-15">Release Summary</a>
- <a href="#minor-changes-13">Minor Changes</a>
- <a href="#v2-15-0">v2\.15\.0</a>
- <a href="#release-summary-16">Release Summary</a>
- <a href="#minor-changes-14">Minor Changes</a>
- <a href="#v2-14-0">v2\.14\.0</a>
- <a href="#release-summary-17">Release Summary</a>
- <a href="#minor-changes-15">Minor Changes</a>
- <a href="#v2-13-0">v2\.13\.0</a>
- <a href="#release-summary-18">Release Summary</a>
- <a href="#minor-changes-16">Minor Changes</a>
- <a href="#bugfixes-5">Bugfixes</a>
- <a href="#v2-12-0">v2\.12\.0</a>
- <a href="#release-summary-19">Release Summary</a>
- <a href="#minor-changes-17">Minor Changes</a>
- <a href="#v2-11-0">v2\.11\.0</a>
- <a href="#release-summary-20">Release Summary</a>
- <a href="#minor-changes-18">Minor Changes</a>
- <a href="#v2-10-0">v2\.10\.0</a>
- <a href="#release-summary-21">Release Summary</a>
- <a href="#minor-changes-19">Minor Changes</a>
- <a href="#bugfixes-6">Bugfixes</a>
- <a href="#v2-9-0">v2\.9\.0</a>
- <a href="#release-summary-22">Release Summary</a>
- <a href="#minor-changes-20">Minor Changes</a>
- <a href="#bugfixes-7">Bugfixes</a>
- <a href="#v2-8-3">v2\.8\.3</a>
- <a href="#release-summary-23">Release Summary</a>
- <a href="#known-issues">Known Issues</a>
- <a href="#v2-8-2">v2\.8\.2</a>
- <a href="#release-summary-24">Release Summary</a>
- <a href="#bugfixes-8">Bugfixes</a>
- <a href="#v2-8-1">v2\.8\.1</a>
- <a href="#release-summary-25">Release Summary</a>
- <a href="#bugfixes-9">Bugfixes</a>
- <a href="#v2-8-0">v2\.8\.0</a>
- <a href="#release-summary-26">Release Summary</a>
- <a href="#minor-changes-21">Minor Changes</a>
- <a href="#bugfixes-10">Bugfixes</a>
- <a href="#v2-7-0">v2\.7\.0</a>
- <a href="#release-summary-27">Release Summary</a>
- <a href="#minor-changes-22">Minor Changes</a>
- <a href="#bugfixes-11">Bugfixes</a>
- <a href="#v2-6-0">v2\.6\.0</a>
- <a href="#release-summary-28">Release Summary</a>
- <a href="#minor-changes-23">Minor Changes</a>
- <a href="#bugfixes-12">Bugfixes</a>
- <a href="#v2-5-0">v2\.5\.0</a>
- <a href="#release-summary-29">Release Summary</a>
- <a href="#minor-changes-24">Minor Changes</a>
- <a href="#bugfixes-13">Bugfixes</a>
- <a href="#v2-4-0">v2\.4\.0</a>
- <a href="#release-summary-30">Release Summary</a>
- <a href="#minor-changes-25">Minor Changes</a>
- <a href="#bugfixes-14">Bugfixes</a>
- <a href="#known-issues-1">Known Issues</a>
- <a href="#v2-3-1">v2\.3\.1</a>
- <a href="#release-summary-31">Release Summary</a>
- <a href="#known-issues-2">Known Issues</a>
- <a href="#v2-3-0">v2\.3\.0</a>
- <a href="#release-summary-32">Release Summary</a>
- <a href="#minor-changes-26">Minor Changes</a>
- <a href="#bugfixes-15">Bugfixes</a>
- <a href="#v2-2-1">v2\.2\.1</a>
- <a href="#release-summary-33">Release Summary</a>
- <a href="#bugfixes-16">Bugfixes</a>
- <a href="#v2-2-0">v2\.2\.0</a>
- <a href="#release-summary-34">Release Summary</a>
- <a href="#minor-changes-27">Minor Changes</a>
- <a href="#bugfixes-17">Bugfixes</a>
- <a href="#new-modules">New Modules</a>
- <a href="#v2-1-0">v2\.1\.0</a>
- <a href="#release-summary-35">Release Summary</a>
- <a href="#minor-changes-28">Minor Changes</a>
- <a href="#bugfixes-18">Bugfixes</a>
- <a href="#new-modules-1">New Modules</a>
- <a href="#v2-0-0">v2\.0\.0</a>
- <a href="#release-summary-36">Release Summary</a>
- <a href="#minor-changes-29">Minor Changes</a>
- <a href="#breaking-changes--porting-guide-1">Breaking Changes / Porting Guide</a>
- <a href="#bugfixes-19">Bugfixes</a>
- <a href="#new-plugins">New Plugins</a>
- <a href="#filter">Filter</a>
- <a href="#v1-2-0">v1\.2\.0</a>
- <a href="#release-summary-37">Release Summary</a>
- <a href="#minor-changes-30">Minor Changes</a>
- <a href="#bugfixes-20">Bugfixes</a>
- <a href="#v1-1-0">v1\.1\.0</a>
- <a href="#release-summary-38">Release Summary</a>
- <a href="#minor-changes-31">Minor Changes</a>
- <a href="#v1-0-1">v1\.0\.1</a>
- <a href="#release-summary-39">Release Summary</a>
- <a href="#bugfixes-21">Bugfixes</a>
- <a href="#v1-0-0">v1\.0\.0</a>
- <a href="#release-summary-40">Release Summary</a>
- <a href="#bugfixes-22">Bugfixes</a>
- <a href="#v0-1-1">v0\.1\.1</a>
- <a href="#release-summary-41">Release Summary</a>
- <a href="#bugfixes-23">Bugfixes</a>
- <a href="#v0-1-0">v0\.1\.0</a>
- <a href="#release-summary-42">Release Summary</a>
- <a href="#minor-changes-32">Minor Changes</a>
<a id="v3-9-0"></a>
## v3\.9\.0
<a id="release-summary"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes"></a>
### Minor Changes
* api\_info\, api modify \- add <code>remote\-log\-format</code>\, <code>remote\-protocol</code>\, and <code>event\-delimiter</code> to <code>system logging action</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/381](https\://github\.com/ansible\-collections/community\.routeros/pull/381)\)\.
* api\_info\, api\_modify \- add <code>disable\-link\-local\-address</code> and <code>stale\-neighbor\-timeout</code> fields to <code>ipv6 settings</code> \([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 <code>ipv6 settings</code> 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 <code>passthrough</code> default in <code>ip firewall mangle</code> to <code>true</code> 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 <code>api\_modify</code> so far only accepted a single entry\. The <code>interface ovpn\-server server</code> 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)\)\.
<a id="bugfixes"></a>
### Bugfixes
* routeros terminal plugin \- fix <code>terminal\_stdout\_re</code> 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)\)\.
<a id="v3-8-1"></a>
## v3\.8\.1
<a id="release-summary-1"></a>
### Release Summary
Bugfix release\.
<a id="bugfixes-1"></a>
### 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)\)\.
<a id="v3-8-0"></a>
## v3\.8\.0
<a id="release-summary-2"></a>
### Release Summary
Feature release\.
<a id="minor-changes-1"></a>
### Minor Changes
* api\_info\, api\_modify \- add <code>interface ethernet switch port\-isolation</code> 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 <code>routing bfd configuration</code>\. 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 <code>ip ipsec mode\-config</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/376](https\://github\.com/ansible\-collections/community\.routeros/pull/376)\)\.
<a id="v3-7-0"></a>
## v3\.7\.0
<a id="release-summary-3"></a>
### Release Summary
Feature release\.
<a id="minor-changes-2"></a>
### Minor Changes
* api\_find\_and\_modify \- allow to control whether <code>dynamic</code> and/or <code>builtin</code> entries are ignored with the new <code>ignore\_dynamic</code> and <code>ignore\_builtin</code> 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 <code>port\-cost\-mode</code> to <code>interface bridge</code> 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)\)\.
<a id="v3-6-0"></a>
## v3\.6\.0
<a id="release-summary-4"></a>
### Release Summary
Feature release\.
<a id="minor-changes-3"></a>
### Minor Changes
* api\_info\, api\_modify \- add <code>mdns\-repeat\-ifaces</code> to <code>ip dns</code> 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 <code>routing bgp connection</code> 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 <code>is\-responder</code> property in <code>interface wireguard peers</code> to <code>responder</code> for RouterOS 7\.17 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/364](https\://github\.com/ansible\-collections/community\.routeros/pull/364)\)\.
<a id="v3-5-0"></a>
## v3\.5\.0
<a id="release-summary-5"></a>
### Release Summary
Feature release\.
<a id="minor-changes-4"></a>
### Minor Changes
* api\_info\, api\_modify \- change default for <code>/ip/cloud/ddns\-enabled</code> for RouterOS 7\.17 and newer from <code>yes</code> to <code>auto</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/350](https\://github\.com/ansible\-collections/community\.routeros/pull/350)\)\.
<a id="v3-4-0"></a>
## v3\.4\.0
<a id="release-summary-6"></a>
### Release Summary
Feature and bugfix release\.
<a id="minor-changes-5"></a>
### Minor Changes
* api\_info\, api\_modify \- add support for the <code>ip dns forwarders</code> 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)\)\.
<a id="bugfixes-2"></a>
### Bugfixes
* api\_info\, api\_modify \- remove the primary key <code>action</code> from the <code>interface wifi provisioning</code> 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)\)\.
<a id="v3-3-0"></a>
## v3\.3\.0
<a id="release-summary-7"></a>
### Release Summary
Feature release\.
<a id="minor-changes-6"></a>
### Minor Changes
* api\_info\, api\_modify \- add missing attribute <code>require\-message\-auth</code> for the <code>radius</code> 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 <code>interface 6to4</code> 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 <code>interface wireless access\-list</code> and <code>interface wireless connect\-list</code> 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 <code>use\-interface\-duid</code> option for <code>ipv6 dhcp\-client</code> 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 <code>script</code>\, <code>custom\-duid</code> and <code>validate\-server\-duid</code> 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)\)\.
<a id="v3-2-0"></a>
## v3\.2\.0
<a id="release-summary-8"></a>
### Release Summary
Feature release\.
<a id="minor-changes-7"></a>
### Minor Changes
* api\_info\, api\_modify \- add support for the <code>routing filter community\-list</code> 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)\)\.
<a id="v3-1-0"></a>
## v3\.1\.0
<a id="release-summary-9"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes-8"></a>
### Minor Changes
* api\_info\, api\_modify \- add missing fields <code>comment</code>\, <code>next\-pool</code> to <code>ip pool</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/327](https\://github\.com/ansible\-collections/community\.routeros/pull/327)\)\.
<a id="bugfixes-3"></a>
### Bugfixes
* api\_info\, api\_modify \- fields <code>log</code> and <code>log\-prefix</code> in paths <code>ip firewall filter</code>\, <code>ip firewall mangle</code>\, <code>ip firewall nat</code>\, <code>ip firewall raw</code> now have the correct default values \([https\://github\.com/ansible\-collections/community\.routeros/pull/324](https\://github\.com/ansible\-collections/community\.routeros/pull/324)\)\.
<a id="v3-0-0"></a>
## v3\.0\.0
<a id="release-summary-10"></a>
### Release Summary
Major release that drops support for End of Life Python versions and fixes check mode for community\.routeros\.command\.
<a id="breaking-changes--porting-guide"></a>
### 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)\)\.
<a id="removed-features-previously-deprecated"></a>
### 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)\)\.
<a id="v2-20-0"></a>
## v2\.20\.0
<a id="release-summary-11"></a>
### Release Summary
Feature release\.
<a id="minor-changes-9"></a>
### 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)\)\.
* api\_info\, api\_modify \- add support <code>interface l2tp\-client</code> configuration \([https\://github\.com/ansible\-collections/community\.routeros/pull/322](https\://github\.com/ansible\-collections/community\.routeros/pull/322)\)\.
* api\_info\, api\_modify \- add support for the <code>cpu\-frequency</code>\, <code>memory\-frequency</code>\, <code>preboot\-etherboot</code> and <code>preboot\-etherboot\-server</code> properties in <code>system routerboard settings</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/320](https\://github\.com/ansible\-collections/community\.routeros/pull/320)\)\.
* api\_info\, api\_modify \- add support for the <code>matching\-type</code> property in <code>ip dhcp\-server matcher</code> introduced by RouterOS 7\.16 \([https\://github\.com/ansible\-collections/community\.routeros/pull/321](https\://github\.com/ansible\-collections/community\.routeros/pull/321)\)\.
<a id="v2-19-0"></a>
## v2\.19\.0
<a id="release-summary-12"></a>
### Release Summary
Feature release\.
<a id="minor-changes-10"></a>
### Minor Changes
* api\_info\, api\_modify \- add support for the <code>ip dns adlist</code> 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)\)\.
* api\_info\, api\_modify \- add support for the <code>mld\-version</code> and <code>multicast\-querier</code> properties in <code>interface bridge</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/315](https\://github\.com/ansible\-collections/community\.routeros/pull/315)\)\.
* api\_info\, api\_modify \- add support for the <code>routing filter num\-list</code> path implemented by RouterOS 7 and newer \([https\://github\.com/ansible\-collections/community\.routeros/pull/313](https\://github\.com/ansible\-collections/community\.routeros/pull/313)\)\.
* api\_info\, api\_modify \- add support for the <code>routing igmp\-proxy</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/309](https\://github\.com/ansible\-collections/community\.routeros/pull/309)\)\.
* api\_modify\, api\_info \- add read\-only <code>default</code> field to <code>snmp community</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/311](https\://github\.com/ansible\-collections/community\.routeros/pull/311)\)\.
<a id="v2-18-0"></a>
## v2\.18\.0
<a id="release-summary-13"></a>
### Release Summary
Feature release\.
<a id="minor-changes-11"></a>
### Minor Changes
* api\_info \- allow to restrict the output by limiting fields to specific values with the new <code>restrict</code> option \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\.
* api\_info\, api\_modify \- add support for the <code>ip dhcp\-server matcher</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/300](https\://github\.com/ansible\-collections/community\.routeros/pull/300)\)\.
* api\_info\, api\_modify \- add support for the <code>ipv6 nd prefix</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/303](https\://github\.com/ansible\-collections/community\.routeros/pull/303)\)\.
* api\_info\, api\_modify \- add support for the <code>name</code> and <code>is\-responder</code> properties under the <code>interface wireguard peers</code> path introduced in RouterOS 7\.15 \([https\://github\.com/ansible\-collections/community\.routeros/pull/304](https\://github\.com/ansible\-collections/community\.routeros/pull/304)\)\.
* api\_info\, api\_modify \- add support for the <code>routing ospf static\-neighbor</code> path in RouterOS 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/302](https\://github\.com/ansible\-collections/community\.routeros/pull/302)\)\.
* api\_info\, api\_modify \- set default for <code>force</code> in <code>ip dhcp\-server option</code> to an explicit <code>false</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/300](https\://github\.com/ansible\-collections/community\.routeros/pull/300)\)\.
* api\_modify \- allow to restrict what is updated by limiting fields to specific values with the new <code>restrict</code> option \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\.
<a id="deprecated-features"></a>
### Deprecated Features
* 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\.
<a id="bugfixes-4"></a>
### Bugfixes
* api\_modify\, api\_info \- change the default of <code>ingress\-filtering</code> in paths <code>interface bridge</code> and <code>interface bridge port</code> back to <code>false</code> for RouterOS before version 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/305](https\://github\.com/ansible\-collections/community\.routeros/pull/305)\)\.
<a id="v2-17-0"></a>
## v2\.17\.0
<a id="release-summary-14"></a>
### Release Summary
Feature release\.
<a id="minor-changes-12"></a>
### Minor Changes
* api\_info\, api\_modify \- add <code>system health settings</code> 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 <code>/system resource irq rps</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/295](https\://github\.com/ansible\-collections/community\.routeros/pull/295)\)\.
* api\_info\, api\_modify \- add parameter <code>host\-key\-type</code> for <code>ip ssh</code> 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)\)\.
<a id="v2-16-0"></a>
## v2\.16\.0
<a id="release-summary-15"></a>
### Release Summary
Feature release\.
<a id="minor-changes-13"></a>
### Minor Changes
* api\_info\, api\_modify \- add missing path <code>/ppp secret</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/286](https\://github\.com/ansible\-collections/community\.routeros/pull/286)\)\.
* api\_info\, api\_modify \- minor changes <code>/interface ethernet</code> path fields \([https\://github\.com/ansible\-collections/community\.routeros/pull/288](https\://github\.com/ansible\-collections/community\.routeros/pull/288)\)\.
<a id="v2-15-0"></a>
## v2\.15\.0
<a id="release-summary-16"></a>
### Release Summary
Feature release\.
<a id="minor-changes-14"></a>
### Minor Changes
* api\_info\, api\_modify \- Add RouterOS 7\.x support to <code>/mpls ldp</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/271](https\://github\.com/ansible\-collections/community\.routeros/pull/271)\)\.
* api\_info\, api\_modify \- add <code>/ip route rule</code> 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 <code>/routing filter</code> path for RouterOS 6\.x \([https\://github\.com/ansible\-collections/community\.routeros/pull/279](https\://github\.com/ansible\-collections/community\.routeros/pull/279)\)\.
* api\_info\, api\_modify \- add default value for <code>from\-pool</code> field in <code>/ipv6 address</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/270](https\://github\.com/ansible\-collections/community\.routeros/pull/270)\)\.
* api\_info\, api\_modify \- add missing path <code>/interface pppoe\-server server</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/273](https\://github\.com/ansible\-collections/community\.routeros/pull/273)\)\.
* api\_info\, api\_modify \- add missing path <code>/ip dhcp\-relay</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/276](https\://github\.com/ansible\-collections/community\.routeros/pull/276)\)\.
* api\_info\, api\_modify \- add missing path <code>/queue simple</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/269](https\://github\.com/ansible\-collections/community\.routeros/pull/269)\)\.
* api\_info\, api\_modify \- add missing path <code>/queue type</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/274](https\://github\.com/ansible\-collections/community\.routeros/pull/274)\)\.
* api\_info\, api\_modify \- add missing paths <code>/routing bgp aggregate</code>\, <code>/routing bgp network</code> and <code>/routing bgp peer</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/277](https\://github\.com/ansible\-collections/community\.routeros/pull/277)\)\.
* api\_info\, api\_modify \- add support for paths <code>/mpls interface</code>\, <code>/mpls ldp accept\-filter</code>\, <code>/mpls ldp advertise\-filter</code> and <code>mpls ldp interface</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/272](https\://github\.com/ansible\-collections/community\.routeros/pull/272)\)\.
<a id="v2-14-0"></a>
## v2\.14\.0
<a id="release-summary-17"></a>
### Release Summary
Feature release\.
<a id="minor-changes-15"></a>
### Minor Changes
* api\_info\, api\_modify \- add read\-only fields <code>installed\-version</code>\, <code>latest\-version</code> and <code>status</code> in <code>system package update</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/263](https\://github\.com/ansible\-collections/community\.routeros/pull/263)\)\.
* api\_info\, api\_modify \- added support for <code>interface wifi</code> and its sub\-paths \([https\://github\.com/ansible\-collections/community\.routeros/pull/266](https\://github\.com/ansible\-collections/community\.routeros/pull/266)\)\.
* api\_info\, api\_modify \- remove default value for read\-only <code>running</code> field in <code>interface wireless</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/264](https\://github\.com/ansible\-collections/community\.routeros/pull/264)\)\.
<a id="v2-13-0"></a>
## v2\.13\.0
<a id="release-summary-18"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes-16"></a>
### Minor Changes
* api\_info\, api\_modify \- make path <code>user group</code> modifiable and add <code>comment</code> 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 <code>ip vrf</code> path in RouterOS 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/259](https\://github\.com/ansible\-collections/community\.routeros/pull/259)\)
<a id="bugfixes-5"></a>
### 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)\)\.
<a id="v2-12-0"></a>
## v2\.12\.0
<a id="release-summary-19"></a>
### Release Summary
Feature release\.
<a id="minor-changes-17"></a>
### Minor Changes
* api\_info\, api\_modify \- add <code>interface ovpn\-client</code> 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)\)\.
* api\_info\, api\_modify \- add <code>radius</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/241](https\://github\.com/ansible\-collections/community\.routeros/issues/241)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/245](https\://github\.com/ansible\-collections/community\.routeros/pull/245)\)\.
* api\_info\, api\_modify \- add <code>routing rule</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/162](https\://github\.com/ansible\-collections/community\.routeros/issues/162)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/246](https\://github\.com/ansible\-collections/community\.routeros/pull/246)\)\.
* api\_info\, api\_modify \- add missing path <code>routing bgp template</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/243](https\://github\.com/ansible\-collections/community\.routeros/pull/243)\)\.
* api\_info\, api\_modify \- add support for the <code>tx\-power</code> attribute in <code>interface wireless</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/239](https\://github\.com/ansible\-collections/community\.routeros/pull/239)\)\.
* api\_info\, api\_modify \- removed <code>host</code> primary key in <code>tool netwatch</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/248](https\://github\.com/ansible\-collections/community\.routeros/pull/248)\)\.
* api\_modify\, api\_info \- added support for <code>interface wifiwave2</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/226](https\://github\.com/ansible\-collections/community\.routeros/pull/226)\)\.
<a id="v2-11-0"></a>
## v2\.11\.0
<a id="release-summary-20"></a>
### Release Summary
Feature and bugfix release\.
<a id="minor-changes-18"></a>
### Minor Changes
* api\_info\, api\_modify \- add missing DoH parameters <code>doh\-max\-concurrent\-queries</code>\, <code>doh\-max\-server\-connections</code>\, and <code>doh\-timeout</code> to the <code>ip dns</code> 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)\)
* api\_info\, api\_modify \- add missing parameters <code>address\-list</code>\, <code>address\-list\-timeout</code>\, <code>randomise\-ports</code>\, and <code>realm</code> to subpaths of the <code>ip firewall</code> path \([https\://github\.com/ansible\-collections/community\.routeros/issues/236](https\://github\.com/ansible\-collections/community\.routeros/issues/236)\, [https\://github\.com/ansible\-collections/community\.routeros/pull/237](https\://github\.com/ansible\-collections/community\.routeros/pull/237)\)\.
* api\_info\, api\_modify \- mark the <code>interface wireless</code> parameter <code>running</code> as read\-only \([https\://github\.com/ansible\-collections/community\.routeros/pull/233](https\://github\.com/ansible\-collections/community\.routeros/pull/233)\)\.
* api\_info\, api\_modify \- set the default value to <code>false</code> for the <code>disabled</code> parameter in some more paths where it can be seen in the documentation \([https\://github\.com/ansible\-collections/community\.routeros/pull/237](https\://github\.com/ansible\-collections/community\.routeros/pull/237)\)\.
* api\_modify \- add missing <code>comment</code> attribute to <code>/routing id</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/234](https\://github\.com/ansible\-collections/community\.routeros/pull/234)\)\.
* api\_modify \- add missing attributes to the <code>routing bgp connection</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/234](https\://github\.com/ansible\-collections/community\.routeros/pull/234)\)\.
* api\_modify \- add versioning to the <code>/tool e\-mail</code> path \(RouterOS 7\.12 release\) \([https\://github\.com/ansible\-collections/community\.routeros/pull/234](https\://github\.com/ansible\-collections/community\.routeros/pull/234)\)\.
* api\_modify \- make <code>/ip traffic\-flow target</code> a multiple value attribute \([https\://github\.com/ansible\-collections/community\.routeros/pull/234](https\://github\.com/ansible\-collections/community\.routeros/pull/234)\)\.
<a id="v2-10-0"></a>
## v2\.10\.0
<a id="release-summary-21"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes-19"></a>
### Minor Changes
* api\_info \- add new <code>include\_read\_only</code> 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)\)\.
* api\_info\, api\_modify \- add support for <code>address\-list</code> and <code>match\-subdomain</code> introduced by RouterOS 7\.7 in the <code>ip dns static</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/197](https\://github\.com/ansible\-collections/community\.routeros/pull/197)\)\.
* api\_info\, api\_modify \- add support for <code>user</code>\, <code>time</code> and <code>gmt\-offset</code> under the <code>system clock</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/210](https\://github\.com/ansible\-collections/community\.routeros/pull/210)\)\.
* api\_info\, api\_modify \- add support for the <code>interface ppp\-client</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/199](https\://github\.com/ansible\-collections/community\.routeros/pull/199)\)\.
* api\_info\, api\_modify \- add support for the <code>interface wireless</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/195](https\://github\.com/ansible\-collections/community\.routeros/pull/195)\)\.
* api\_info\, api\_modify \- add support for the <code>iot modbus</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/205](https\://github\.com/ansible\-collections/community\.routeros/pull/205)\)\.
* api\_info\, api\_modify \- add support for the <code>ip dhcp\-server option</code> and <code>ip dhcp\-server option sets</code> paths \([https\://github\.com/ansible\-collections/community\.routeros/pull/223](https\://github\.com/ansible\-collections/community\.routeros/pull/223)\)\.
* api\_info\, api\_modify \- add support for the <code>ip upnp interfaces</code>\, <code>tool graphing interface</code>\, <code>tool graphing resource</code> paths \([https\://github\.com/ansible\-collections/community\.routeros/pull/227](https\://github\.com/ansible\-collections/community\.routeros/pull/227)\)\.
* api\_info\, api\_modify \- add support for the <code>ipv6 firewall nat</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/204](https\://github\.com/ansible\-collections/community\.routeros/pull/204)\)\.
* api\_info\, api\_modify \- add support for the <code>mode</code> property in <code>ip neighbor discovery\-settings</code> introduced in RouterOS 7\.7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/198](https\://github\.com/ansible\-collections/community\.routeros/pull/198)\)\.
* api\_info\, api\_modify \- add support for the <code>port remote\-access</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/224](https\://github\.com/ansible\-collections/community\.routeros/pull/224)\)\.
* api\_info\, api\_modify \- add support for the <code>routing filter rule</code> and <code>routing filter select\-rule</code> paths \([https\://github\.com/ansible\-collections/community\.routeros/pull/200](https\://github\.com/ansible\-collections/community\.routeros/pull/200)\)\.
* api\_info\, api\_modify \- add support for the <code>routing table</code> path in RouterOS 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/215](https\://github\.com/ansible\-collections/community\.routeros/pull/215)\)\.
* api\_info\, api\_modify \- add support for the <code>tool netwatch</code> path in RouterOS 7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/216](https\://github\.com/ansible\-collections/community\.routeros/pull/216)\)\.
* api\_info\, api\_modify \- add support for the <code>user settings</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/201](https\://github\.com/ansible\-collections/community\.routeros/pull/201)\)\.
* api\_info\, api\_modify \- add support for the <code>user</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/211](https\://github\.com/ansible\-collections/community\.routeros/pull/211)\)\.
* api\_info\, api\_modify \- finalize fields for the <code>interface wireless security\-profiles</code> path and enable it \([https\://github\.com/ansible\-collections/community\.routeros/pull/203](https\://github\.com/ansible\-collections/community\.routeros/pull/203)\)\.
* api\_info\, api\_modify \- finalize fields for the <code>ppp profile</code> path and enable it \([https\://github\.com/ansible\-collections/community\.routeros/pull/217](https\://github\.com/ansible\-collections/community\.routeros/pull/217)\)\.
* api\_modify \- add new <code>handle\_read\_only</code> and <code>handle\_write\_only</code> 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 <code>routing id</code>\, <code>routing bgp connection</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/220](https\://github\.com/ansible\-collections/community\.routeros/pull/220)\)\.
<a id="bugfixes-6"></a>
### Bugfixes
* api\_info\, api\_modify \- in the <code>snmp</code> path\, ensure that <code>engine\-id\-suffix</code> is only available on RouterOS 7\.10\+\, and that <code>engine\-id</code> 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)\)\.
<a id="v2-9-0"></a>
## v2\.9\.0
<a id="release-summary-22"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes-20"></a>
### Minor Changes
* api\_info\, api\_modify \- add path <code>caps\-man channel</code> and enable path <code>caps\-man manager interface</code> \([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 <code>ip traffic\-flow target</code> \([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)\)\.
<a id="bugfixes-7"></a>
### Bugfixes
* api\_modify\, api\_info \- add missing parameter <code>engine\-id\-suffix</code> for the <code>snmp</code> 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)\)\.
<a id="v2-8-3"></a>
## v2\.8\.3
<a id="release-summary-23"></a>
### Release Summary
Maintenance release with updated documentation\.
From this version on\, community\.routeros is using the new [Ansible semantic markup](https\://docs\.ansible\.com/ansible/devel/dev\_guide/developing\_modules\_documenting\.html\#semantic\-markup\-within\-module\-documentation)
in its documentation\. If you look at documentation with the ansible\-doc CLI tool
from ansible\-core before 2\.15\, please note that it does not render the markup
correctly\. You should be still able to read it in most cases\, but you need
ansible\-core 2\.15 or later to see it as it is intended\. Alternatively you can
look at [the devel docsite](https\://docs\.ansible\.com/ansible/devel/collections/community/routeros/)
for the rendered HTML version of the documentation of the latest release\.
<a id="known-issues"></a>
### Known Issues
* Ansible markup will show up in raw form on ansible\-doc text output for ansible\-core before 2\.15\. If you have trouble deciphering the documentation markup\, please upgrade to ansible\-core 2\.15 \(or newer\)\, or read the HTML documentation on [https\://docs\.ansible\.com/ansible/devel/collections/community/routeros/](https\://docs\.ansible\.com/ansible/devel/collections/community/routeros/)\.
<a id="v2-8-2"></a>
## v2\.8\.2
<a id="release-summary-24"></a>
### Release Summary
Bugfix release\.
<a id="bugfixes-8"></a>
### Bugfixes
* api\_modify\, api\_info \- add missing parameter <code>tls</code> for the <code>tool e\-mail</code> 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)\)\.
<a id="v2-8-1"></a>
## v2\.8\.1
<a id="release-summary-25"></a>
### Release Summary
Bugfix release\.
<a id="bugfixes-9"></a>
### 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)\)\.
<a id="v2-8-0"></a>
## v2\.8\.0
<a id="release-summary-26"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes-21"></a>
### Minor Changes
* api\_modify \- adapt data for API paths <code>ip dhcp\-server network</code> \([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 <code>snmp community</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/159](https\://github\.com/ansible\-collections/community\.routeros/pull/159)\)\.
* api\_modify \- add support for <code>trap\-interfaces</code> in API path <code>snmp</code> \([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 <code>ipv6 settings</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/158](https\://github\.com/ansible\-collections/community\.routeros/pull/158)\)\.
* api\_modify \- support API paths <code>ip firewall layer7\-protocol</code> \([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)\)\.
<a id="bugfixes-10"></a>
### Bugfixes
* api\_info\, api\_modify \- fix default and remove behavior for <code>dhcp\-options</code> in path <code>ip dhcp\-client</code> \([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)\)\.
<a id="v2-7-0"></a>
## v2\.7\.0
<a id="release-summary-27"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes-22"></a>
### Minor Changes
* api\_modify\, api\_info \- support API paths <code>ip arp</code>\, <code>ip firewall raw</code>\, <code>ipv6 firewall raw</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\.
<a id="bugfixes-11"></a>
### Bugfixes
* api\_modify\, api\_info \- defaults corrected for fields in <code>interface wireguard peers</code> API path \([https\://github\.com/ansible\-collections/community\.routeros/pull/144](https\://github\.com/ansible\-collections/community\.routeros/pull/144)\)\.
<a id="v2-6-0"></a>
## v2\.6\.0
<a id="release-summary-28"></a>
### Release Summary
Regular bugfix and feature release\.
<a id="minor-changes-23"></a>
### Minor Changes
* api\_modify\, api\_info \- add field <code>regexp</code> to <code>ip dns static</code> \([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 <code>interface wireguard</code>\, <code>interface wireguard peers</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/143](https\://github\.com/ansible\-collections/community\.routeros/pull/143)\)\.
<a id="bugfixes-12"></a>
### Bugfixes
* api\_modify \- do not use <code>name</code> as a unique key in <code>ip dns static</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\.
* api\_modify\, api\_info \- do not crash if router contains <code>regexp</code> DNS entries in <code>ip dns static</code> \([https\://github\.com/ansible\-collections/community\.routeros/issues/141](https\://github\.com/ansible\-collections/community\.routeros/issues/141)\)\.
<a id="v2-5-0"></a>
## v2\.5\.0
<a id="release-summary-29"></a>
### Release Summary
Feature and bugfix release\.
<a id="minor-changes-24"></a>
### Minor Changes
* api\_info\, api\_modify \- support API paths <code>interface ethernet poe</code>\, <code>interface gre6</code>\, <code>interface vrrp</code> and also support all previously missing fields of entries in <code>ip dhcp\-server</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/137](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\.
<a id="bugfixes-13"></a>
### Bugfixes
* api\_modify \- <code>address\-pool</code> field of entries in API path <code>ip dhcp\-server</code> is not required anymore \([https\://github\.com/ansible\-collections/community\.routeros/pull/137](https\://github\.com/ansible\-collections/community\.routeros/pull/137)\)\.
<a id="v2-4-0"></a>
## v2\.4\.0
<a id="release-summary-30"></a>
### Release Summary
Feature release improving the <code>api\*</code> modules\.
<a id="minor-changes-25"></a>
### Minor Changes
* api\* modules \- Add new option <code>force\_no\_cert</code> to connect with ADH ciphers \([https\://github\.com/ansible\-collections/community\.routeros/pull/124](https\://github\.com/ansible\-collections/community\.routeros/pull/124)\)\.
* api\_info \- new parameter <code>include\_builtin</code> which allows to include \"builtin\" entries that are automatically generated by ROS and cannot be modified by the user \([https\://github\.com/ansible\-collections/community\.routeros/pull/130](https\://github\.com/ansible\-collections/community\.routeros/pull/130)\)\.
* api\_modify\, api\_info \- support API paths \- <code>interface bonding</code>\, <code>interface bridge mlag</code>\, <code>ipv6 firewall mangle</code>\, <code>ipv6 nd</code>\, <code>system scheduler</code>\, <code>system script</code>\, <code>system ups</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/133](https\://github\.com/ansible\-collections/community\.routeros/pull/133)\)\.
* api\_modify\, api\_info \- support API paths <code>caps\-man access\-list</code>\, <code>caps\-man configuration</code>\, <code>caps\-man datapath</code>\, <code>caps\-man manager</code>\, <code>caps\-man provisioning</code>\, <code>caps\-man security</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/126](https\://github\.com/ansible\-collections/community\.routeros/pull/126)\)\.
* api\_modify\, api\_info \- support API paths <code>interface list</code> and <code>interface list member</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/120](https\://github\.com/ansible\-collections/community\.routeros/pull/120)\)\.
* api\_modify\, api\_info \- support API paths <code>interface pppoe\-client</code>\, <code>interface vlan</code>\, <code>interface bridge</code>\, <code>interface bridge vlan</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/125](https\://github\.com/ansible\-collections/community\.routeros/pull/125)\)\.
* api\_modify\, api\_info \- support API paths <code>ip ipsec identity</code>\, <code>ip ipsec peer</code>\, <code>ip ipsec policy</code>\, <code>ip ipsec profile</code>\, <code>ip ipsec proposal</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/129](https\://github\.com/ansible\-collections/community\.routeros/pull/129)\)\.
* api\_modify\, api\_info \- support API paths <code>ip route</code> and <code>ip route vrf</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/123](https\://github\.com/ansible\-collections/community\.routeros/pull/123)\)\.
* api\_modify\, api\_info \- support API paths <code>ipv6 address</code>\, <code>ipv6 dhcp\-server</code>\, <code>ipv6 dhcp\-server option</code>\, <code>ipv6 route</code>\, <code>queue tree</code>\, <code>routing ospf area</code>\, <code>routing ospf area range</code>\, <code>routing ospf instance</code>\, <code>routing ospf interface\-template</code>\, <code>routing pimsm instance</code>\, <code>routing pimsm interface\-template</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\.
* api\_modify\, api\_info \- support API paths <code>system logging</code>\, <code>system logging action</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/127](https\://github\.com/ansible\-collections/community\.routeros/pull/127)\)\.
* api\_modify\, api\_info \- support field <code>hw\-offload</code> for path <code>ip firewall filter</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/121](https\://github\.com/ansible\-collections/community\.routeros/pull/121)\)\.
* api\_modify\, api\_info \- support fields <code>address\-list</code>\, <code>address\-list\-timeout</code>\, <code>connection\-bytes</code>\, <code>connection\-limit</code>\, <code>connection\-mark</code>\, <code>connection\-rate</code>\, <code>connection\-type</code>\, <code>content</code>\, <code>disabled</code>\, <code>dscp</code>\, <code>dst\-address\-list</code>\, <code>dst\-address\-type</code>\, <code>dst\-limit</code>\, <code>fragment</code>\, <code>hotspot</code>\, <code>icmp\-options</code>\, <code>in\-bridge\-port</code>\, <code>in\-bridge\-port\-list</code>\, <code>ingress\-priority</code>\, <code>ipsec\-policy</code>\, <code>ipv4\-options</code>\, <code>jump\-target</code>\, <code>layer7\-protocol</code>\, <code>limit</code>\, <code>log</code>\, <code>log\-prefix</code>\, <code>nth</code>\, <code>out\-bridge\-port</code>\, <code>out\-bridge\-port\-list</code>\, <code>packet\-mark</code>\, <code>packet\-size</code>\, <code>per\-connection\-classifier</code>\, <code>port</code>\, <code>priority</code>\, <code>psd</code>\, <code>random</code>\, <code>realm</code>\, <code>routing\-mark</code>\, <code>same\-not\-by\-dst</code>\, <code>src\-address</code>\, <code>src\-address\-list</code>\, <code>src\-address\-type</code>\, <code>src\-mac\-address</code>\, <code>src\-port</code>\, <code>tcp\-mss</code>\, <code>time</code>\, <code>tls\-host</code>\, <code>ttl</code> in <code>ip firewall nat</code> path \([https\://github\.com/ansible\-collections/community\.routeros/pull/133](https\://github\.com/ansible\-collections/community\.routeros/pull/133)\)\.
* api\_modify\, api\_info \- support fields <code>combo\-mode</code>\, <code>comment</code>\, <code>fec\-mode</code>\, <code>mdix\-enable</code>\, <code>poe\-out</code>\, <code>poe\-priority</code>\, <code>poe\-voltage</code>\, <code>power\-cycle\-interval</code>\, <code>power\-cycle\-ping\-address</code>\, <code>power\-cycle\-ping\-enabled</code>\, <code>power\-cycle\-ping\-timeout</code> for path <code>interface ethernet</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/121](https\://github\.com/ansible\-collections/community\.routeros/pull/121)\)\.
* api\_modify\, api\_info \- support fields <code>jump\-target</code>\, <code>reject\-with</code> in <code>ip firewall filter</code> API path\, field <code>comment</code> in <code>ip firwall address\-list</code> API path\, field <code>jump\-target</code> in <code>ip firewall mangle</code> API path\, field <code>comment</code> in <code>ipv6 firewall address\-list</code> API path\, fields <code>jump\-target</code>\, <code>reject\-with</code> in <code>ipv6 firewall filter</code> API path \([https\://github\.com/ansible\-collections/community\.routeros/pull/133](https\://github\.com/ansible\-collections/community\.routeros/pull/133)\)\.
* api\_modify\, api\_info \- support for API fields that can be disabled and have default value at the same time\, support API paths <code>interface gre</code>\, <code>interface eoip</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/128](https\://github\.com/ansible\-collections/community\.routeros/pull/128)\)\.
* api\_modify\, api\_info \- support for fields <code>blackhole</code>\, <code>pref\-src</code>\, <code>routing\-table</code>\, <code>suppress\-hw\-offload</code>\, <code>type</code>\, <code>vrf\-interface</code> in <code>ip route</code> 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 <code>system ntp client servers</code> and <code>system ntp server</code> available in ROS7\, as well as new fields <code>servers</code>\, <code>mode</code>\, and <code>vrf</code> for <code>system ntp client</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/122](https\://github\.com/ansible\-collections/community\.routeros/pull/122)\)\.
<a id="bugfixes-14"></a>
### Bugfixes
* api\_modify \- <code>ip route</code> entry can be defined without the need of <code>gateway</code> 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)\)\.
* api\_modify \- <code>queue interface</code> path works now \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\.
* api\_modify\, api\_info \- removed wrong field <code>dynamic</code> from API path <code>ipv6 firewall address\-list</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/133](https\://github\.com/ansible\-collections/community\.routeros/pull/133)\)\.
* api\_modify\, api\_info \- the default of the field <code>ingress\-filtering</code> in <code>interface bridge port</code> is now <code>true</code>\, which is the default in ROS \([https\://github\.com/ansible\-collections/community\.routeros/pull/125](https\://github\.com/ansible\-collections/community\.routeros/pull/125)\)\.
* command\, facts \- commands do not timeout in safe mode anymore \([https\://github\.com/ansible\-collections/community\.routeros/pull/134](https\://github\.com/ansible\-collections/community\.routeros/pull/134)\)\.
<a id="known-issues-1"></a>
### Known Issues
* api\_modify \- when limits for entries in <code>queue tree</code> are defined as human readable \- for example <code>25M</code> \-\, the configuration will be correctly set in ROS\, but the module will indicate the item is changed on every run even when there was no change done\. This is caused by the ROS API which returns the number in bytes \- for example <code>25000000</code> \(which is inconsistent with the CLI behavior\)\. In order to mitigate that\, the limits have to be defined in bytes \(those will still appear as human readable in the ROS CLI\) \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\.
* api\_modify\, api\_info \- <code>routing ospf area</code>\, <code>routing ospf area range</code>\, <code>routing ospf instance</code>\, <code>routing ospf interface\-template</code> paths are not fully implemented for ROS6 due to the significant changes between ROS6 and ROS7 \([https\://github\.com/ansible\-collections/community\.routeros/pull/131](https\://github\.com/ansible\-collections/community\.routeros/pull/131)\)\.
<a id="v2-3-1"></a>
## v2\.3\.1
<a id="release-summary-31"></a>
### Release Summary
Maintenance release with improved documentation\.
<a id="known-issues-2"></a>
### Known Issues
* The <code>community\.routeros\.command</code> module claims to support check mode\. Since it cannot judge whether the commands executed modify state or not\, this behavior is incorrect\. Since this potentially breaks existing playbooks\, we will not change this behavior until community\.routeros 3\.0\.0\.
<a id="v2-3-0"></a>
## v2\.3\.0
<a id="release-summary-32"></a>
### Release Summary
Feature and bugfix release\.
<a id="minor-changes-26"></a>
### 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 <code>timeout</code> 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 <code>ip firewall mangle</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/110](https\://github\.com/ansible\-collections/community\.routeros/pull/110)\)\.
<a id="bugfixes-15"></a>
### Bugfixes
* api\_modify\, api\_info \- make API path <code>ip dhcp\-server</code> support <code>script</code>\, and <code>ip firewall nat</code> support <code>in\-interface</code> and <code>in\-interface\-list</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/110](https\://github\.com/ansible\-collections/community\.routeros/pull/110)\)\.
<a id="v2-2-1"></a>
## v2\.2\.1
<a id="release-summary-33"></a>
### Release Summary
Bugfix release\.
<a id="bugfixes-16"></a>
### Bugfixes
* api\_modify\, api\_info \- make API path <code>ip dhcp\-server lease</code> support <code>server\=all</code> \([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)\)\.
* api\_modify\, api\_info \- make API path <code>ip dhcp\-server network</code> support missing options <code>boot\-file\-name</code>\, <code>dhcp\-option\-set</code>\, <code>dns\-none</code>\, <code>domain</code>\, and <code>next\-server</code> \([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/106](https\://github\.com/ansible\-collections/community\.routeros/pull/106)\)\.
<a id="v2-2-0"></a>
## v2\.2\.0
<a id="release-summary-34"></a>
### Release Summary
New feature release\.
<a id="minor-changes-27"></a>
### Minor Changes
* All software licenses are now in the <code>LICENSES/</code> directory of the collection root\. Moreover\, <code>SPDX\-License\-Identifier\:</code> 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)\)\.
<a id="bugfixes-17"></a>
### Bugfixes
* Include <code>LICENSES/BSD\-2\-Clause\.txt</code> file for the <code>routeros</code> module utils \([https\://github\.com/ansible\-collections/community\.routeros/pull/101](https\://github\.com/ansible\-collections/community\.routeros/pull/101)\)\.
<a id="new-modules"></a>
### New Modules
* community\.routeros\.api\_info \- Retrieve information from API
* community\.routeros\.api\_modify \- Modify data at paths with API
<a id="v2-1-0"></a>
## v2\.1\.0
<a id="release-summary-35"></a>
### Release Summary
Feature and bugfix release with new modules\.
<a id="minor-changes-28"></a>
### Minor Changes
* Added a <code>community\.routeros\.api</code> module defaults group\. Use with <code>group/community\.routeros\.api</code> 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)\)\.
* Prepare collection for inclusion in an Execution Environment by declaring its dependencies \([https\://github\.com/ansible\-collections/community\.routeros/pull/83](https\://github\.com/ansible\-collections/community\.routeros/pull/83)\)\.
* api \- add new option <code>extended query</code> more complex queries against RouterOS API \([https\://github\.com/ansible\-collections/community\.routeros/pull/63](https\://github\.com/ansible\-collections/community\.routeros/pull/63)\)\.
* api \- update <code>query</code> 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)\)\.
<a id="bugfixes-18"></a>
### Bugfixes
* query \- fix query function check for <code>\.id</code> vs\. <code>id</code> arguments to not conflict with routeros arguments like <code>identity</code> \([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)\)\.
* quoting and unquoting filter plugins\, api module \- handle the escape sequence <code>\\\_</code> correctly as escaping a space and not an underscore \([https\://github\.com/ansible\-collections/community\.routeros/pull/89](https\://github\.com/ansible\-collections/community\.routeros/pull/89)\)\.
<a id="new-modules-1"></a>
### New Modules
* community\.routeros\.api\_facts \- Collect facts from remote devices running MikroTik RouterOS using the API
* community\.routeros\.api\_find\_and\_modify \- Find and modify information using the API
<a id="v2-0-0"></a>
## v2\.0\.0
<a id="release-summary-36"></a>
### Release Summary
A new major release with breaking changes in the behavior of <code>community\.routeros\.api</code> and <code>community\.routeros\.command</code>\.
<a id="minor-changes-29"></a>
### Minor Changes
* api \- make validation of <code>WHERE</code> for <code>query</code> more strict \([https\://github\.com/ansible\-collections/community\.routeros/pull/53](https\://github\.com/ansible\-collections/community\.routeros/pull/53)\)\.
* command \- the <code>commands</code> and <code>wait\_for</code> 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 <code>gather\_subset</code> 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)\)\.
<a id="breaking-changes--porting-guide-1"></a>
### 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 <code>failure\: already have such address</code>\)\, you need to adjust your roles/playbooks\. We suggest to use <code>failed\_when</code> to accept failure in specific circumstances\, for example <code>failed\_when\: \"\'failure\: already have \' in result\.msg\[0\]\"</code> \([https\://github\.com/ansible\-collections/community\.routeros/pull/39](https\://github\.com/ansible\-collections/community\.routeros/pull/39)\)\.
* 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 <code>changed\_when</code> 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)\)\.
<a id="bugfixes-19"></a>
### Bugfixes
* api \- improve splitting of <code>WHERE</code> queries \([https\://github\.com/ansible\-collections/community\.routeros/pull/47](https\://github\.com/ansible\-collections/community\.routeros/pull/47)\)\.
* api \- when converting result lists to dictionaries\, no longer removes second <code>\=</code> and text following that if present \([https\://github\.com/ansible\-collections/community\.routeros/pull/47](https\://github\.com/ansible\-collections/community\.routeros/pull/47)\)\.
* routeros cliconf plugin \- adjust function signature that was modified in Ansible after creation of this plugin \([https\://github\.com/ansible\-collections/community\.routeros/pull/43](https\://github\.com/ansible\-collections/community\.routeros/pull/43)\)\.
<a id="new-plugins"></a>
### New Plugins
<a id="filter"></a>
#### Filter
* community\.routeros\.join \- Join a list of arguments to a command
* community\.routeros\.list\_to\_dict \- Convert a list of arguments to a list of dictionary
* community\.routeros\.quote\_argument \- Quote an argument
* community\.routeros\.quote\_argument\_value \- Quote an argument value
* community\.routeros\.split \- Split a command into arguments
<a id="v1-2-0"></a>
## v1\.2\.0
<a id="release-summary-37"></a>
### Release Summary
Bugfix and feature release\.
<a id="minor-changes-30"></a>
### 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)\)\.
* api \- add options <code>validate\_certs</code> \(default value <code>true</code>\)\, <code>validate\_cert\_hostname</code> \(default value <code>false</code>\)\, and <code>ca\_path</code> to control certificate validation \([https\://github\.com/ansible\-collections/community\.routeros/pull/37](https\://github\.com/ansible\-collections/community\.routeros/pull/37)\)\.
* api \- rename option <code>ssl</code> to <code>tls</code>\, 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 <code>ansible\_net\_config\_nonverbose</code> 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)\)\.
<a id="bugfixes-20"></a>
### 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)\)\.
<a id="v1-1-0"></a>
## v1\.1\.0
<a id="release-summary-38"></a>
### Release Summary
This release allow dashes in usernames for SSH\-based modules\.
<a id="minor-changes-31"></a>
### Minor Changes
* command \- added support for a dash \(<code>\-</code>\) in username \([https\://github\.com/ansible\-collections/community\.routeros/pull/18](https\://github\.com/ansible\-collections/community\.routeros/pull/18)\)\.
* facts \- added support for a dash \(<code>\-</code>\) in username \([https\://github\.com/ansible\-collections/community\.routeros/pull/18](https\://github\.com/ansible\-collections/community\.routeros/pull/18)\)\.
<a id="v1-0-1"></a>
## v1\.0\.1
<a id="release-summary-39"></a>
### Release Summary
Maintenance release with a bugfix for <code>api</code>\.
<a id="bugfixes-21"></a>
### Bugfixes
* api \- remove <code>id to \.id</code> as default requirement which conflicts with RouterOS <code>id</code> configuration parameter \([https\://github\.com/ansible\-collections/community\.routeros/pull/15](https\://github\.com/ansible\-collections/community\.routeros/pull/15)\)\.
<a id="v1-0-0"></a>
## v1\.0\.0
<a id="release-summary-40"></a>
### Release Summary
This is the first production \(non\-prerelease\) release of <code>community\.routeros</code>\.
<a id="bugfixes-22"></a>
### 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)\)\.
<a id="v0-1-1"></a>
## v0\.1\.1
<a id="release-summary-41"></a>
### Release Summary
Small improvements and bugfixes over the initial release\.
<a id="bugfixes-23"></a>
### Bugfixes
* api \- fix crash when the <code>ssl</code> parameter is used \([https\://github\.com/ansible\-collections/community\.routeros/pull/3](https\://github\.com/ansible\-collections/community\.routeros/pull/3)\)\.
<a id="v0-1-0"></a>
## v0\.1\.0
<a id="release-summary-42"></a>
### Release Summary
The <code>community\.routeros</code> continues the work on the Ansible RouterOS modules from their state in <code>community\.network</code> 1\.2\.0\. The changes listed here are thus relative to the modules <code>community\.network\.routeros\_\*</code>\.
<a id="minor-changes-32"></a>
### 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)\)\.
* facts \- set configuration export on to verbose\, for full configuration export \([https\://github\.com/ansible\-collections/community\.network/pull/104](https\://github\.com/ansible\-collections/community\.network/pull/104)\)\.

3
CHANGELOG.md.license Normal file
View file

@ -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

View file

@ -4,6 +4,785 @@ 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
======
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
======
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
======
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
======
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
======
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
======
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
======
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
======
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
======
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
======
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
=======
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).
- api_info, api_modify - add support ``interface l2tp-client`` configuration (https://github.com/ansible-collections/community.routeros/pull/322).
- api_info, api_modify - add support for the ``cpu-frequency``, ``memory-frequency``, ``preboot-etherboot`` and ``preboot-etherboot-server`` properties in ``system routerboard settings`` (https://github.com/ansible-collections/community.routeros/pull/320).
- api_info, api_modify - add support for the ``matching-type`` property in ``ip dhcp-server matcher`` introduced by RouterOS 7.16 (https://github.com/ansible-collections/community.routeros/pull/321).
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).
- api_info, api_modify - add support for the ``mld-version`` and ``multicast-querier`` properties in ``interface bridge`` (https://github.com/ansible-collections/community.routeros/pull/315).
- api_info, api_modify - add support for the ``routing filter num-list`` path implemented by RouterOS 7 and newer (https://github.com/ansible-collections/community.routeros/pull/313).
- api_info, api_modify - add support for the ``routing igmp-proxy`` path (https://github.com/ansible-collections/community.routeros/pull/309).
- api_modify, api_info - add read-only ``default`` field to ``snmp community`` (https://github.com/ansible-collections/community.routeros/pull/311).
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).
- api_info, api_modify - add support for the ``ip dhcp-server matcher`` path (https://github.com/ansible-collections/community.routeros/pull/300).
- api_info, api_modify - add support for the ``ipv6 nd prefix`` path (https://github.com/ansible-collections/community.routeros/pull/303).
- api_info, api_modify - add support for the ``name`` and ``is-responder`` properties under the ``interface wireguard peers`` path introduced in RouterOS 7.15 (https://github.com/ansible-collections/community.routeros/pull/304).
- api_info, api_modify - add support for the ``routing ospf static-neighbor`` path in RouterOS 7 (https://github.com/ansible-collections/community.routeros/pull/302).
- api_info, api_modify - set default for ``force`` in ``ip dhcp-server option`` to an explicit ``false`` (https://github.com/ansible-collections/community.routeros/pull/300).
- api_modify - allow to restrict what is updated by limiting fields to specific values with the new ``restrict`` option (https://github.com/ansible-collections/community.routeros/pull/305).
Deprecated Features
-------------------
- 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).
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).
- api_info, api_modify - add missing path ``/system resource irq rps`` (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/pull/297).
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).
- api_info, api_modify - minor changes ``/interface ethernet`` path fields (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).
- api_info, api_modify - add ``/ip route rule`` path for RouterOS 6.x (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).
- api_info, api_modify - add default value for ``from-pool`` field in ``/ipv6 address`` (https://github.com/ansible-collections/community.routeros/pull/270).
- api_info, api_modify - add missing path ``/interface pppoe-server server`` (https://github.com/ansible-collections/community.routeros/pull/273).
- api_info, api_modify - add missing path ``/ip dhcp-relay`` (https://github.com/ansible-collections/community.routeros/pull/276).
- api_info, api_modify - add missing path ``/queue simple`` (https://github.com/ansible-collections/community.routeros/pull/269).
- api_info, api_modify - add missing path ``/queue type`` (https://github.com/ansible-collections/community.routeros/pull/274).
- api_info, api_modify - add missing paths ``/routing bgp aggregate``, ``/routing bgp network`` and ``/routing bgp peer`` (https://github.com/ansible-collections/community.routeros/pull/277).
- api_info, api_modify - add support for paths ``/mpls interface``, ``/mpls ldp accept-filter``, ``/mpls ldp advertise-filter`` and ``mpls ldp interface`` (https://github.com/ansible-collections/community.routeros/pull/272).
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).
- api_info, api_modify - added support for ``interface wifi`` and its sub-paths (https://github.com/ansible-collections/community.routeros/pull/266).
- api_info, api_modify - remove default value for read-only ``running`` field in ``interface wireless`` (https://github.com/ansible-collections/community.routeros/pull/264).
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/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)
Bugfixes
--------
- facts - fix date not getting removed for idempotent config export (https://github.com/ansible-collections/community.routeros/pull/262).
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/pull/244).
- api_info, api_modify - add ``radius`` path (https://github.com/ansible-collections/community.routeros/issues/241, https://github.com/ansible-collections/community.routeros/pull/245).
- api_info, api_modify - add ``routing rule`` path (https://github.com/ansible-collections/community.routeros/issues/162, https://github.com/ansible-collections/community.routeros/pull/246).
- api_info, api_modify - add missing path ``routing bgp template`` (https://github.com/ansible-collections/community.routeros/pull/243).
- api_info, api_modify - add support for the ``tx-power`` attribute in ``interface wireless`` (https://github.com/ansible-collections/community.routeros/pull/239).
- api_info, api_modify - removed ``host`` primary key in ``tool netwatch`` path (https://github.com/ansible-collections/community.routeros/pull/248).
- api_modify, api_info - added support for ``interface wifiwave2`` (https://github.com/ansible-collections/community.routeros/pull/226).
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/pull/235)
- api_info, api_modify - add missing parameters ``address-list``, ``address-list-timeout``, ``randomise-ports``, and ``realm`` to subpaths of the ``ip firewall`` path (https://github.com/ansible-collections/community.routeros/issues/236, https://github.com/ansible-collections/community.routeros/pull/237).
- api_info, api_modify - mark the ``interface wireless`` parameter ``running`` as read-only (https://github.com/ansible-collections/community.routeros/pull/233).
- api_info, api_modify - set the default value to ``false`` for the ``disabled`` parameter in some more paths where it can be seen in the documentation (https://github.com/ansible-collections/community.routeros/pull/237).
- api_modify - add missing ``comment`` attribute to ``/routing id`` (https://github.com/ansible-collections/community.routeros/pull/234).
- api_modify - add missing attributes to the ``routing bgp connection`` path (https://github.com/ansible-collections/community.routeros/pull/234).
- api_modify - add versioning to the ``/tool e-mail`` path (RouterOS 7.12 release) (https://github.com/ansible-collections/community.routeros/pull/234).
- api_modify - make ``/ip traffic-flow target`` a multiple value attribute (https://github.com/ansible-collections/community.routeros/pull/234).
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).
- api_info, api_modify - add support for ``address-list`` and ``match-subdomain`` introduced by RouterOS 7.7 in the ``ip dns static`` path (https://github.com/ansible-collections/community.routeros/pull/197).
- api_info, api_modify - add support for ``user``, ``time`` and ``gmt-offset`` under the ``system clock`` path (https://github.com/ansible-collections/community.routeros/pull/210).
- api_info, api_modify - add support for the ``interface ppp-client`` path (https://github.com/ansible-collections/community.routeros/pull/199).
- api_info, api_modify - add support for the ``interface wireless`` path (https://github.com/ansible-collections/community.routeros/pull/195).
- api_info, api_modify - add support for the ``iot modbus`` path (https://github.com/ansible-collections/community.routeros/pull/205).
- api_info, api_modify - add support for the ``ip dhcp-server option`` and ``ip dhcp-server option sets`` paths (https://github.com/ansible-collections/community.routeros/pull/223).
- api_info, api_modify - add support for the ``ip upnp interfaces``, ``tool graphing interface``, ``tool graphing resource`` paths (https://github.com/ansible-collections/community.routeros/pull/227).
- api_info, api_modify - add support for the ``ipv6 firewall nat`` path (https://github.com/ansible-collections/community.routeros/pull/204).
- api_info, api_modify - add support for the ``mode`` property in ``ip neighbor discovery-settings`` introduced in RouterOS 7.7 (https://github.com/ansible-collections/community.routeros/pull/198).
- api_info, api_modify - add support for the ``port remote-access`` path (https://github.com/ansible-collections/community.routeros/pull/224).
- api_info, api_modify - add support for the ``routing filter rule`` and ``routing filter select-rule`` paths (https://github.com/ansible-collections/community.routeros/pull/200).
- api_info, api_modify - add support for the ``routing table`` path in RouterOS 7 (https://github.com/ansible-collections/community.routeros/pull/215).
- api_info, api_modify - add support for the ``tool netwatch`` path in RouterOS 7 (https://github.com/ansible-collections/community.routeros/pull/216).
- api_info, api_modify - add support for the ``user settings`` path (https://github.com/ansible-collections/community.routeros/pull/201).
- api_info, api_modify - add support for the ``user`` path (https://github.com/ansible-collections/community.routeros/pull/211).
- api_info, api_modify - finalize fields for the ``interface wireless security-profiles`` path and enable it (https://github.com/ansible-collections/community.routeros/pull/203).
- api_info, api_modify - finalize fields for the ``ppp profile`` path and enable it (https://github.com/ansible-collections/community.routeros/pull/217).
- 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).
- api_modify, api_info - support API paths ``routing id``, ``routing bgp connection`` (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/pull/218).
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/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/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/pull/190).
v2.8.3
======
Release Summary
---------------
Maintenance release with updated documentation.
From this version on, community.routeros is using the new `Ansible semantic markup
<https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html#semantic-markup-within-module-documentation>`__
in its documentation. If you look at documentation with the ansible-doc CLI tool
from ansible-core before 2.15, please note that it does not render the markup
correctly. You should be still able to read it in most cases, but you need
ansible-core 2.15 or later to see it as it is intended. Alternatively you can
look at `the devel docsite <https://docs.ansible.com/ansible/devel/collections/community/routeros/>`__
for the rendered HTML version of the documentation of the latest release.
Known Issues
------------
- Ansible markup will show up in raw form on ansible-doc text output for ansible-core before 2.15. If you have trouble deciphering the documentation markup, please upgrade to ansible-core 2.15 (or newer), or read the HTML documentation on https://docs.ansible.com/ansible/devel/collections/community/routeros/.
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/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/pull/177).
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).
- api_modify - add support for API path ``snmp community`` (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).
- api_modify - add support to disable IPv6 in API paths ``ipv6 settings`` (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).
- 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/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/pull/154).
- api_modify - fix handling of disabled keys on creation (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).
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).
Bugfixes
--------
- api_modify, api_info - defaults corrected for fields in ``interface wireguard peers`` API path (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).
- api_modify, api_info - support API paths ``interface wireguard``, ``interface wireguard peers`` (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).
- api_modify, api_info - do not crash if router contains ``regexp`` DNS entries in ``ip dns static`` (https://github.com/ansible-collections/community.routeros/issues/141).
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).
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).
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).
- api_info - new parameter ``include_builtin`` which allows to include "builtin" entries that are automatically generated by ROS and cannot be modified by the user (https://github.com/ansible-collections/community.routeros/pull/130).
- api_modify, api_info - support API paths - ``interface bonding``, ``interface bridge mlag``, ``ipv6 firewall mangle``, ``ipv6 nd``, ``system scheduler``, ``system script``, ``system ups`` (https://github.com/ansible-collections/community.routeros/pull/133).
- api_modify, api_info - support API paths ``caps-man access-list``, ``caps-man configuration``, ``caps-man datapath``, ``caps-man manager``, ``caps-man provisioning``, ``caps-man security`` (https://github.com/ansible-collections/community.routeros/pull/126).
- api_modify, api_info - support API paths ``interface list`` and ``interface list member`` (https://github.com/ansible-collections/community.routeros/pull/120).
- api_modify, api_info - support API paths ``interface pppoe-client``, ``interface vlan``, ``interface bridge``, ``interface bridge vlan`` (https://github.com/ansible-collections/community.routeros/pull/125).
- api_modify, api_info - support API paths ``ip ipsec identity``, ``ip ipsec peer``, ``ip ipsec policy``, ``ip ipsec profile``, ``ip ipsec proposal`` (https://github.com/ansible-collections/community.routeros/pull/129).
- api_modify, api_info - support API paths ``ip route`` and ``ip route vrf`` (https://github.com/ansible-collections/community.routeros/pull/123).
- api_modify, api_info - support API paths ``ipv6 address``, ``ipv6 dhcp-server``, ``ipv6 dhcp-server option``, ``ipv6 route``, ``queue tree``, ``routing ospf area``, ``routing ospf area range``, ``routing ospf instance``, ``routing ospf interface-template``, ``routing pimsm instance``, ``routing pimsm interface-template`` (https://github.com/ansible-collections/community.routeros/pull/131).
- api_modify, api_info - support API paths ``system logging``, ``system logging action`` (https://github.com/ansible-collections/community.routeros/pull/127).
- api_modify, api_info - support field ``hw-offload`` for path ``ip firewall filter`` (https://github.com/ansible-collections/community.routeros/pull/121).
- api_modify, api_info - support fields ``address-list``, ``address-list-timeout``, ``connection-bytes``, ``connection-limit``, ``connection-mark``, ``connection-rate``, ``connection-type``, ``content``, ``disabled``, ``dscp``, ``dst-address-list``, ``dst-address-type``, ``dst-limit``, ``fragment``, ``hotspot``, ``icmp-options``, ``in-bridge-port``, ``in-bridge-port-list``, ``ingress-priority``, ``ipsec-policy``, ``ipv4-options``, ``jump-target``, ``layer7-protocol``, ``limit``, ``log``, ``log-prefix``, ``nth``, ``out-bridge-port``, ``out-bridge-port-list``, ``packet-mark``, ``packet-size``, ``per-connection-classifier``, ``port``, ``priority``, ``psd``, ``random``, ``realm``, ``routing-mark``, ``same-not-by-dst``, ``src-address``, ``src-address-list``, ``src-address-type``, ``src-mac-address``, ``src-port``, ``tcp-mss``, ``time``, ``tls-host``, ``ttl`` in ``ip firewall nat`` path (https://github.com/ansible-collections/community.routeros/pull/133).
- api_modify, api_info - support fields ``combo-mode``, ``comment``, ``fec-mode``, ``mdix-enable``, ``poe-out``, ``poe-priority``, ``poe-voltage``, ``power-cycle-interval``, ``power-cycle-ping-address``, ``power-cycle-ping-enabled``, ``power-cycle-ping-timeout`` for path ``interface ethernet`` (https://github.com/ansible-collections/community.routeros/pull/121).
- api_modify, api_info - support fields ``jump-target``, ``reject-with`` in ``ip firewall filter`` API path, field ``comment`` in ``ip firwall address-list`` API path, field ``jump-target`` in ``ip firewall mangle`` API path, field ``comment`` in ``ipv6 firewall address-list`` API path, fields ``jump-target``, ``reject-with`` in ``ipv6 firewall filter`` API path (https://github.com/ansible-collections/community.routeros/pull/133).
- api_modify, api_info - support for API fields that can be disabled and have default value at the same time, support API paths ``interface gre``, ``interface eoip`` (https://github.com/ansible-collections/community.routeros/pull/128).
- 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).
- 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).
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).
- api_modify - ``queue interface`` path works now (https://github.com/ansible-collections/community.routeros/pull/131).
- api_modify, api_info - removed wrong field ``dynamic`` from API path ``ipv6 firewall address-list`` (https://github.com/ansible-collections/community.routeros/pull/133).
- api_modify, api_info - the default of the field ``ingress-filtering`` in ``interface bridge port`` is now ``true``, which is the default in ROS (https://github.com/ansible-collections/community.routeros/pull/125).
- command, facts - commands do not timeout in safe mode anymore (https://github.com/ansible-collections/community.routeros/pull/134).
Known Issues
------------
- api_modify - when limits for entries in ``queue tree`` are defined as human readable - for example ``25M`` -, the configuration will be correctly set in ROS, but the module will indicate the item is changed on every run even when there was no change done. This is caused by the ROS API which returns the number in bytes - for example ``25000000`` (which is inconsistent with the CLI behavior). In order to mitigate that, the limits have to be defined in bytes (those will still appear as human readable in the ROS CLI) (https://github.com/ansible-collections/community.routeros/pull/131).
- api_modify, api_info - ``routing ospf area``, ``routing ospf area range``, ``routing ospf instance``, ``routing ospf interface-template`` paths are not fully implemented for ROS6 due to the significant changes between ROS6 and ROS7 (https://github.com/ansible-collections/community.routeros/pull/131).
v2.3.1
======
Release Summary
---------------
Maintenance release with improved documentation.
Known Issues
------------
- The ``community.routeros.command`` module claims to support check mode. Since it cannot judge whether the commands executed modify state or not, this behavior is incorrect. Since this potentially breaks existing playbooks, we will not change this behavior until community.routeros 3.0.0.
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).
- api* modules - added ``timeout`` parameter (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).
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).
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/pull/107).
- api_modify, api_info - make API path ``ip dhcp-server network`` support missing options ``boot-file-name``, ``dhcp-option-set``, ``dns-none``, ``domain``, and ``next-server`` (https://github.com/ansible-collections/community.routeros/issues/104, https://github.com/ansible-collections/community.routeros/pull/106).
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).
Bugfixes
--------
- Include ``LICENSES/BSD-2-Clause.txt`` file for the ``routeros`` module utils (https://github.com/ansible-collections/community.routeros/pull/101).
New Modules
-----------
- community.routeros.api_info - Retrieve information from API
- community.routeros.api_modify - Modify data at paths with API
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).
- Prepare collection for inclusion in an Execution Environment by declaring its dependencies (https://github.com/ansible-collections/community.routeros/pull/83).
- api - add new option ``extended query`` more complex queries against RouterOS API (https://github.com/ansible-collections/community.routeros/pull/63).
- api - update ``query`` to accept symbolic parameters (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).
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/issues/67).
- quoting and unquoting filter plugins, api module - handle the escape sequence ``\_`` correctly as escaping a space and not an underscore (https://github.com/ansible-collections/community.routeros/pull/89).
New Modules
-----------
- community.routeros.api_facts - Collect facts from remote devices running MikroTik RouterOS using the API
- community.routeros.api_find_and_modify - Find and modify information using the API
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).
- command - the ``commands`` and ``wait_for`` options now convert the list elements to strings (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).
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).
- 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).
- 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).
Bugfixes
--------
- api - improve splitting of ``WHERE`` queries (https://github.com/ansible-collections/community.routeros/pull/47).
- api - when converting result lists to dictionaries, no longer removes second ``=`` and text following that if present (https://github.com/ansible-collections/community.routeros/pull/47).
- routeros cliconf plugin - adjust function signature that was modified in Ansible after creation of this plugin (https://github.com/ansible-collections/community.routeros/pull/43).
New Plugins
-----------
Filter
~~~~~~
- community.routeros.join - Join a list of arguments to a command
- community.routeros.list_to_dict - Convert a list of arguments to a list of dictionary
- community.routeros.quote_argument - Quote an argument
- community.routeros.quote_argument_value - Quote an argument value
- community.routeros.split - Split a command into arguments
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).
- api - add options ``validate_certs`` (default value ``true``), ``validate_cert_hostname`` (default value ``false``), and ``ca_path`` to control certificate validation (https://github.com/ansible-collections/community.routeros/pull/37).
- api - rename option ``ssl`` to ``tls``, and keep the old name as an alias (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).
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).
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).
- facts - added support for a dash (``-``) in username (https://github.com/ansible-collections/community.routeros/pull/18).
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).
v1.0.0
======
@ -13,7 +792,6 @@ Release Summary
This is the first production (non-prerelease) release of ``community.routeros``.
Bugfixes
--------
@ -40,7 +818,6 @@ 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
-------------

3
CHANGELOG.rst.license Normal file
View file

@ -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

View file

@ -0,0 +1,8 @@
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View file

@ -0,0 +1 @@
../COPYING

136
README.md
View file

@ -1,29 +1,74 @@
<!--
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
-->
# 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) [![Codecov](https://img.shields.io/codecov/c/github/ansible-collections/community.routeros)](https://codecov.io/gh/ansible-collections/community.routeros)
[![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/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)
Provides modules for [Ansible](https://www.ansible.com/community) to manage [MikroTik RouterOS](http://www.mikrotik-routeros.net/routeros.aspx) instances.
Provides modules for [Ansible](https://www.ansible.com/community) to manage [MikroTik RouterOS](https://mikrotik.com/software) instances.
You can find [documentation for the modules and plugins in this collection here](https://ansible.fontein.de/collections/community/routeros/).
You can find [documentation for the modules and plugins in this collection here](https://docs.ansible.com/ansible/devel/collections/community/routeros/).
## Code of Conduct
We follow [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html) in all our interactions within this project.
If you encounter abusive behavior violating the [Ansible Code of Conduct](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html), please refer to the [policy violations](https://docs.ansible.com/ansible/latest/community/code_of_conduct.html#policy-violations) section of the Code of Conduct for information on how to raise a complaint.
## Communication
* Join the Ansible forum:
* [Get Help](https://forum.ansible.com/c/help/6): get help or help others.Please add appropriate tags if you start new discussions, for example the `routeros` tag.
* [Posts tagged with 'routeros'](https://forum.ansible.com/tag/routeros): subscribe to participate in RouterOS related conversations.
* [Social Spaces](https://forum.ansible.com/c/chat/4): gather and interact with fellow enthusiasts.
* [News & Announcements](https://forum.ansible.com/c/news/5): track project-wide announcements including social events.
* The Ansible [Bullhorn newsletter](https://docs.ansible.com/ansible/devel/community/communication.html#the-bullhorn): used to announce releases and important changes.
For more information about communication, see the [Ansible communication guide](https://docs.ansible.com/ansible/devel/community/communication.html).
## Tested with Ansible
Tested with both the current Ansible 2.9 and 2.10 releases and the current development version of Ansible. 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, 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
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
The collection supports the `network_cli` connection.
### Edge cases
Please note that `community.routeros.api` module does **not** support Windows jump hosts!
## Collection Documentation
Browsing the [**latest** collection documentation](https://docs.ansible.com/ansible/latest/collections/community/routeros) will show docs for the _latest version released in the Ansible package_, not the latest version of the collection released on Galaxy.
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_.
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**.
## Included content
- `community.routeros.api`
- `community.routeros.api_facts`
- `community.routeros.api_find_and_modify`
- `community.routeros.api_info`
- `community.routeros.api_modify`
- `community.routeros.command`
- `community.routeros.facts`
You can find [documentation for the modules and plugins in this collection here](https://ansible.fontein.de/collections/community/routeros/).
You can find [documentation for the modules and plugins in this collection here](https://docs.ansible.com/ansible/devel/collections/community/routeros/).
## Using this collection
@ -31,6 +76,17 @@ See [Ansible Using collections](https://docs.ansible.com/ansible/latest/user_gui
There are two approaches for using this collection. The `command` and `facts` modules use the `network_cli` connection and connect with SSH. The `api` module connects with the HTTP/HTTPS API.
### Prerequisites
The terminal-based modules in this collection (`community.routeros.command` and `community.routeros.facts`) do not support arbitrary symbols in router's identity. If you are having trouble connecting to your device, please make sure that your MikroTik's identity contains only alphanumeric characters and dashes. Also, the `community.routeros.command` module does not support nesting commands and expects every command to start with a forward slash (`/`). Running the following command will produce an error.
```yaml
- community.routeros.command:
commands:
- /ip
- print
```
### Connecting with `network_cli`
Example inventory `hosts` file:
@ -54,19 +110,19 @@ Example playbook:
hosts: routers
gather_facts: false
tasks:
- name: Run a command
community.routeros.command:
commands:
- /system resource print
register: system_resource_print
- name: Print its output
ansible.builtin.debug:
var: system_resource_print.stdout_lines
# Run a command and print its output
- community.routeros.command:
commands:
- /system resource print
register: system_resource_print
- debug:
var: system_resource_print.stdout_lines
# Retrieve facts
- community.routeros.facts:
- debug:
msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}"
- name: Retrieve facts
community.routeros.facts:
- ansible.builtin.debug:
msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}"
```
### Connecting with HTTP/HTTPS API
@ -77,20 +133,42 @@ Example playbook:
---
- name: RouterOS test with API
hosts: localhost
gather_facts: no
gather_facts: false
vars:
hostname: 192.168.1.1
username: admin
password: test1234
module_defaults:
group/community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
tls: true
force_no_cert: false
validate_certs: true
validate_cert_hostname: true
ca_path: /path/to/ca-certificate.pem
tasks:
- name: Get "ip address print"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "ip address"
ssl: true
path: ip address
register: print_path
- name: Print the result
ansible.builtin.debug:
var: print_path.msg
- name: Change IP address to 192.168.1.1 for interface bridge
community.routeros.api_find_and_modify:
path: ip address
find:
interface: bridge
values:
address: "192.168.1.1/24"
- name: Retrieve facts
community.routeros.api_facts:
- ansible.builtin.debug:
msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}"
```
## Contributing to this collection
@ -106,7 +184,7 @@ See [Ansible's dev guide](https://docs.ansible.com/ansible/devel/dev_guide/devel
## Release notes
See the [changelog](https://github.com/ansible-collections/community.routeros/blob/main/CHANGELOG.rst).
See the [collection's changelog](https://github.com/ansible-collections/community.routeros/blob/main/CHANGELOG.md).
## Roadmap
@ -124,6 +202,10 @@ We plan to regularly release minor and patch versions, whenever new features are
## Licensing
GNU General Public License v3.0 or later.
This collection is primarily licensed and distributed as a whole under the GNU General Public License v3.0 or later.
See [COPYING](https://www.gnu.org/licenses/gpl-3.0.txt) to see the full text.
See [LICENSES/GPL-3.0-or-later.txt](https://github.com/ansible-collections/community.routeros/blob/main/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).
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/).

11
REUSE.toml Normal file
View file

@ -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"

97
antsibull-nox.toml Normal file
View file

@ -0,0 +1,97 @@
# 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]
run_isort = false
run_black = false
run_flake8 = false
run_pylint = false
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]
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]
[sessions.extra_checks]
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/",
]
run_avoid_characters = true
[[sessions.extra_checks.action_groups_config]]
name = "api"
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
[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"]
"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.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]]
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"}

View file

@ -1,39 +1,973 @@
---
ancestor: null
releases:
0.1.0:
changes:
minor_changes:
- facts - now also collecting data about BGP and OSPF (https://github.com/ansible-collections/community.network/pull/101).
- facts - set configuration export on to verbose, for full configuration export
(https://github.com/ansible-collections/community.network/pull/104).
- facts - now also collecting data about BGP and OSPF (https://github.com/ansible-collections/community.network/pull/101).
- facts - set configuration export on to verbose, for full configuration export
(https://github.com/ansible-collections/community.network/pull/104).
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_*``.
'
fragments:
- 0.1.0.yml
- 101_update_facts.yml
- 104_facts_export_verbose.yml
- 0.1.0.yml
- 101_update_facts.yml
- 104_facts_export_verbose.yml
release_date: '2020-10-26'
0.1.1:
changes:
bugfixes:
- api - fix crash when the ``ssl`` parameter is used (https://github.com/ansible-collections/community.routeros/pull/3).
- api - fix crash when the ``ssl`` parameter is used (https://github.com/ansible-collections/community.routeros/pull/3).
release_summary: Small improvements and bugfixes over the initial release.
fragments:
- 0.1.1.yml
- 3-api-ssl.yml
- 0.1.1.yml
- 3-api-ssl.yml
release_date: '2020-10-31'
1.0.0:
changes:
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).
- 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).
release_summary: 'This is the first production (non-prerelease) release of ``community.routeros``.
'
fragments:
- 1.0.0.yml
- community.network-138-routeros-allow-slash.yml
- 1.0.0.yml
- community.network-138-routeros-allow-slash.yml
release_date: '2020-11-17'
1.0.1:
changes:
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).
release_summary: Maintenance release with a bugfix for ``api``.
fragments:
- 1.0.1.yml
- 13-remove-id-restriction-for-api.yaml
release_date: '2020-12-11'
1.1.0:
changes:
minor_changes:
- command - added support for a dash (``-``) in username (https://github.com/ansible-collections/community.routeros/pull/18).
- facts - added support for a dash (``-``) in username (https://github.com/ansible-collections/community.routeros/pull/18).
release_summary: This release allow dashes in usernames for SSH-based modules.
fragments:
- 1.1.0.yml
- 18-support-dashes-in-username.yml
release_date: '2021-01-04'
1.2.0:
changes:
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).
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).
- api - add options ``validate_certs`` (default value ``true``), ``validate_cert_hostname``
(default value ``false``), and ``ca_path`` to control certificate validation
(https://github.com/ansible-collections/community.routeros/pull/37).
- api - rename option ``ssl`` to ``tls``, and keep the old name as an alias
(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).
release_summary: Bugfix and feature release.
fragments:
- 1.2.0.yml
- 23-idempotent_config.yml
- 34-api-ciphers.yml
- 37-api-validate-cert-options.yml
- ansible-core-_text.yml
release_date: '2021-06-29'
2.0.0-a1:
changes:
breaking_changes:
- '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).'
release_summary: First prerelease for a new major release with a breaking change
in the behavior of ``community.routeros.api``.
fragments:
- 2.0.0-a1.yml
- 39-api-fail.yml
release_date: '2021-07-31'
2.0.0-a2:
changes:
breaking_changes:
- 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).
- 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).
bugfixes:
- api - improve splitting of ``WHERE`` queries (https://github.com/ansible-collections/community.routeros/pull/47).
- api - when converting result lists to dictionaries, no longer removes second
``=`` and text following that if present (https://github.com/ansible-collections/community.routeros/pull/47).
- routeros cliconf plugin - adjust function signature that was modified in
Ansible after creation of this plugin (https://github.com/ansible-collections/community.routeros/pull/43).
minor_changes:
- api - make validation of ``WHERE`` for ``query`` more strict (https://github.com/ansible-collections/community.routeros/pull/53).
release_summary: Second prerelease for a new major release with breaking changes
in the behavior of ``community.routeros.api`` and ``community.routeros.command``.
fragments:
- 2.0.0-a2.yml
- 43-sanity.yml
- 45-api-split.yml
- 47-api-split.yml
- 50-command-changed.yml
- 53-api-where.yml
- 53-quoting-filters.yml
plugins:
filter:
- description: Join a list of arguments to a command
name: join
namespace: null
- description: Convert a list of arguments to a list of dictionary
name: list_to_dict
namespace: null
- description: Quote an argument
name: quote_argument
namespace: null
- description: Quote an argument value
name: quote_argument_value
namespace: null
- description: Split a command into arguments
name: split
namespace: null
release_date: '2021-10-14'
2.0.0:
changes:
minor_changes:
- command - the ``commands`` and ``wait_for`` options now convert the list
elements to strings (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).
release_summary: A new major release with breaking changes in the behavior of
``community.routeros.api`` and ``community.routeros.command``.
fragments:
- 2.0.0.yml
- 55-linting.yml
release_date: '2021-10-31'
2.1.0:
changes:
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/issues/67).
- quoting and unquoting filter plugins, api module - handle the escape sequence
``\_`` correctly as escaping a space and not an underscore (https://github.com/ansible-collections/community.routeros/pull/89).
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).
- Prepare collection for inclusion in an Execution Environment by declaring
its dependencies (https://github.com/ansible-collections/community.routeros/pull/83).
- api - add new option ``extended query`` more complex queries against RouterOS
API (https://github.com/ansible-collections/community.routeros/pull/63).
- api - update ``query`` to accept symbolic parameters (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).
release_summary: Feature and bugfix release with new modules.
fragments:
- 2.1.0.yml
- 63-add-extended_query.yml
- 68-fix-query-id-check.yml
- 83-ee.yml
- 89-quoting.yml
- 90-api-action-group.yml
- 95-api-encoding.yml
modules:
- description: Collect facts from remote devices running MikroTik RouterOS using
the API
name: api_facts
namespace: ''
- description: Find and modify information using the API
name: api_find_and_modify
namespace: ''
release_date: '2022-05-25'
2.2.0:
changes:
bugfixes:
- Include ``LICENSES/BSD-2-Clause.txt`` file for the ``routeros`` module utils
(https://github.com/ansible-collections/community.routeros/pull/101).
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).
release_summary: New feature release.
fragments:
- 101-licenses.yml
- 2.2.0.yml
modules:
- description: Retrieve information from API
name: api_info
namespace: ''
- description: Modify data at paths with API
name: api_modify
namespace: ''
release_date: '2022-07-31'
2.2.1:
changes:
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/pull/107).
- api_modify, api_info - make API path ``ip dhcp-server network`` support
missing options ``boot-file-name``, ``dhcp-option-set``, ``dns-none``, ``domain``,
and ``next-server`` (https://github.com/ansible-collections/community.routeros/issues/104,
https://github.com/ansible-collections/community.routeros/pull/106).
release_summary: Bugfix release.
fragments:
- 106-api-path-ip-dhcp-network.yml
- 107-api-path-ip-dhcp-lease.yml
- 2.2.1.yml
release_date: '2022-08-20'
2.3.0:
changes:
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).
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).
- api* modules - added ``timeout`` parameter (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).
release_summary: Feature and bugfix release.
fragments:
- 109-add-timeout-parameter-to-api.yml
- 110-api.yml
- 2.3.0.yml
- licenses.yml
release_date: '2022-09-11'
2.3.1:
changes:
known_issues:
- The ``community.routeros.command`` module claims to support check mode.
Since it cannot judge whether the commands executed modify state or not,
this behavior is incorrect. Since this potentially breaks existing playbooks,
we will not change this behavior until community.routeros 3.0.0.
release_summary: Maintenance release with improved documentation.
fragments:
- 2.3.1.yml
- command-check_mode.yml
release_date: '2022-11-06'
2.4.0:
changes:
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).
- api_modify - ``queue interface`` path works now (https://github.com/ansible-collections/community.routeros/pull/131).
- api_modify, api_info - removed wrong field ``dynamic`` from API path ``ipv6
firewall address-list`` (https://github.com/ansible-collections/community.routeros/pull/133).
- api_modify, api_info - the default of the field ``ingress-filtering`` in
``interface bridge port`` is now ``true``, which is the default in ROS (https://github.com/ansible-collections/community.routeros/pull/125).
- command, facts - commands do not timeout in safe mode anymore (https://github.com/ansible-collections/community.routeros/pull/134).
known_issues:
- api_modify - when limits for entries in ``queue tree`` are defined as human
readable - for example ``25M`` -, the configuration will be correctly set
in ROS, but the module will indicate the item is changed on every run even
when there was no change done. This is caused by the ROS API which returns
the number in bytes - for example ``25000000`` (which is inconsistent with
the CLI behavior). In order to mitigate that, the limits have to be defined
in bytes (those will still appear as human readable in the ROS CLI) (https://github.com/ansible-collections/community.routeros/pull/131).
- api_modify, api_info - ``routing ospf area``, ``routing ospf area range``,
``routing ospf instance``, ``routing ospf interface-template`` paths are
not fully implemented for ROS6 due to the significant changes between ROS6
and ROS7 (https://github.com/ansible-collections/community.routeros/pull/131).
minor_changes:
- api* modules - Add new option ``force_no_cert`` to connect with ADH ciphers
(https://github.com/ansible-collections/community.routeros/pull/124).
- api_info - new parameter ``include_builtin`` which allows to include "builtin"
entries that are automatically generated by ROS and cannot be modified by
the user (https://github.com/ansible-collections/community.routeros/pull/130).
- api_modify, api_info - support API paths - ``interface bonding``, ``interface
bridge mlag``, ``ipv6 firewall mangle``, ``ipv6 nd``, ``system scheduler``,
``system script``, ``system ups`` (https://github.com/ansible-collections/community.routeros/pull/133).
- api_modify, api_info - support API paths ``caps-man access-list``, ``caps-man
configuration``, ``caps-man datapath``, ``caps-man manager``, ``caps-man
provisioning``, ``caps-man security`` (https://github.com/ansible-collections/community.routeros/pull/126).
- api_modify, api_info - support API paths ``interface list`` and ``interface
list member`` (https://github.com/ansible-collections/community.routeros/pull/120).
- api_modify, api_info - support API paths ``interface pppoe-client``, ``interface
vlan``, ``interface bridge``, ``interface bridge vlan`` (https://github.com/ansible-collections/community.routeros/pull/125).
- api_modify, api_info - support API paths ``ip ipsec identity``, ``ip ipsec
peer``, ``ip ipsec policy``, ``ip ipsec profile``, ``ip ipsec proposal``
(https://github.com/ansible-collections/community.routeros/pull/129).
- api_modify, api_info - support API paths ``ip route`` and ``ip route vrf``
(https://github.com/ansible-collections/community.routeros/pull/123).
- api_modify, api_info - support API paths ``ipv6 address``, ``ipv6 dhcp-server``,
``ipv6 dhcp-server option``, ``ipv6 route``, ``queue tree``, ``routing ospf
area``, ``routing ospf area range``, ``routing ospf instance``, ``routing
ospf interface-template``, ``routing pimsm instance``, ``routing pimsm interface-template``
(https://github.com/ansible-collections/community.routeros/pull/131).
- api_modify, api_info - support API paths ``system logging``, ``system logging
action`` (https://github.com/ansible-collections/community.routeros/pull/127).
- api_modify, api_info - support field ``hw-offload`` for path ``ip firewall
filter`` (https://github.com/ansible-collections/community.routeros/pull/121).
- api_modify, api_info - support fields ``address-list``, ``address-list-timeout``,
``connection-bytes``, ``connection-limit``, ``connection-mark``, ``connection-rate``,
``connection-type``, ``content``, ``disabled``, ``dscp``, ``dst-address-list``,
``dst-address-type``, ``dst-limit``, ``fragment``, ``hotspot``, ``icmp-options``,
``in-bridge-port``, ``in-bridge-port-list``, ``ingress-priority``, ``ipsec-policy``,
``ipv4-options``, ``jump-target``, ``layer7-protocol``, ``limit``, ``log``,
``log-prefix``, ``nth``, ``out-bridge-port``, ``out-bridge-port-list``,
``packet-mark``, ``packet-size``, ``per-connection-classifier``, ``port``,
``priority``, ``psd``, ``random``, ``realm``, ``routing-mark``, ``same-not-by-dst``,
``src-address``, ``src-address-list``, ``src-address-type``, ``src-mac-address``,
``src-port``, ``tcp-mss``, ``time``, ``tls-host``, ``ttl`` in ``ip firewall
nat`` path (https://github.com/ansible-collections/community.routeros/pull/133).
- api_modify, api_info - support fields ``combo-mode``, ``comment``, ``fec-mode``,
``mdix-enable``, ``poe-out``, ``poe-priority``, ``poe-voltage``, ``power-cycle-interval``,
``power-cycle-ping-address``, ``power-cycle-ping-enabled``, ``power-cycle-ping-timeout``
for path ``interface ethernet`` (https://github.com/ansible-collections/community.routeros/pull/121).
- api_modify, api_info - support fields ``jump-target``, ``reject-with`` in
``ip firewall filter`` API path, field ``comment`` in ``ip firwall address-list``
API path, field ``jump-target`` in ``ip firewall mangle`` API path, field
``comment`` in ``ipv6 firewall address-list`` API path, fields ``jump-target``,
``reject-with`` in ``ipv6 firewall filter`` API path (https://github.com/ansible-collections/community.routeros/pull/133).
- api_modify, api_info - support for API fields that can be disabled and have
default value at the same time, support API paths ``interface gre``, ``interface
eoip`` (https://github.com/ansible-collections/community.routeros/pull/128).
- 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).
- 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).
release_summary: Feature release improving the ``api*`` modules.
fragments:
- 120-api.yml
- 121-api.yml
- 122-api.yml
- 123-api.yml
- 124-api.yml
- 125-api.yml
- 126-api-capsman.yml
- 127-logging.yml
- 128-api.yml
- 129-api-ipsec.yml
- 130-api-modify-builtin.yml
- 131-api.yml
- 133-api.yml
- 134-command-safemode.yml
- 2.4.0.yml
release_date: '2022-11-18'
2.5.0:
changes:
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).
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).
release_summary: Feature and bugfix release.
fragments:
- 137-api.yml
- 2.5.0.yml
release_date: '2022-12-04'
2.6.0:
changes:
bugfixes:
- api_modify - do not use ``name`` as a unique key in ``ip dns static`` (https://github.com/ansible-collections/community.routeros/issues/141).
- api_modify, api_info - do not crash if router contains ``regexp`` DNS entries
in ``ip dns static`` (https://github.com/ansible-collections/community.routeros/issues/141).
minor_changes:
- api_modify, api_info - add field ``regexp`` to ``ip dns static`` (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).
release_summary: Regular bugfix and feature release.
fragments:
- 142-dns-regexp.yml
- 143-add-wireguard.yml
- 2.6.0.yml
release_date: '2023-01-01'
2.7.0:
changes:
bugfixes:
- api_modify, api_info - defaults corrected for fields in ``interface wireguard
peers`` API path (https://github.com/ansible-collections/community.routeros/pull/144).
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).
release_summary: Bugfix and feature release.
fragments:
- 144-paths.yml
- 2.7.0.yml
release_date: '2023-01-14'
2.8.0:
changes:
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/pull/154).
- api_modify - fix handling of disabled keys on creation (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).
minor_changes:
- api_modify - adapt data for API paths ``ip dhcp-server network`` (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).
- api_modify - add support for ``trap-interfaces`` in API path ``snmp`` (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).
- api_modify - support API paths ``ip firewall layer7-protocol`` (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/pull/161).
release_summary: Bugfix and feature release.
fragments:
- 153-ip_firewall_layer7-protocol.yml
- 154-ip-dhcp-client-dhcp-options.yml
- 156-ip_dhcp-server_network.yml
- 158-ipv6_settings-disable.yml
- 159-snmp_community.yml
- 161-workaround-prompt-with-space.yml
- 2.8.0.yml
- remove-unneeded-imports.yml
release_date: '2023-03-23'
2.8.1:
changes:
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/pull/177).
release_summary: Bugfix release.
fragments:
- 177-facts-parsing.yml
- 2.8.1.yml
release_date: '2023-06-14'
2.8.2:
changes:
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/pull/180).
release_summary: Bugfix release.
fragments:
- 180-fix-tls-in-tool-email.yml
- 2.8.2.yml
release_date: '2023-06-19'
2.8.3:
changes:
known_issues:
- Ansible markup will show up in raw form on ansible-doc text output for ansible-core
before 2.15. If you have trouble deciphering the documentation markup, please
upgrade to ansible-core 2.15 (or newer), or read the HTML documentation
on https://docs.ansible.com/ansible/devel/collections/community/routeros/.
release_summary: 'Maintenance release with updated documentation.
From this version on, community.routeros is using the new `Ansible semantic
markup
<https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html#semantic-markup-within-module-documentation>`__
in its documentation. If you look at documentation with the ansible-doc CLI
tool
from ansible-core before 2.15, please note that it does not render the markup
correctly. You should be still able to read it in most cases, but you need
ansible-core 2.15 or later to see it as it is intended. Alternatively you
can
look at `the devel docsite <https://docs.ansible.com/ansible/devel/collections/community/routeros/>`__
for the rendered HTML version of the documentation of the latest release.
'
fragments:
- 2.8.3.yml
- semantic-markup.yml
release_date: '2023-06-27'
2.9.0:
changes:
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/pull/190).
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/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/pull/192).
release_summary: Bugfix and feature release.
fragments:
- 180-fix-engine-id-suffix-in-snmp.yml
- 192-add-ip_traffic-flow_target-path.yml
- 194-add-caps-man_channel-and-caps-man_manager_interface.yml
- 2.9.0.yml
release_date: '2023-08-15'
2.10.0:
changes:
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/pull/218).
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).
- api_info, api_modify - add support for ``address-list`` and ``match-subdomain``
introduced by RouterOS 7.7 in the ``ip dns static`` path (https://github.com/ansible-collections/community.routeros/pull/197).
- api_info, api_modify - add support for ``user``, ``time`` and ``gmt-offset``
under the ``system clock`` path (https://github.com/ansible-collections/community.routeros/pull/210).
- api_info, api_modify - add support for the ``interface ppp-client`` path
(https://github.com/ansible-collections/community.routeros/pull/199).
- api_info, api_modify - add support for the ``interface wireless`` path (https://github.com/ansible-collections/community.routeros/pull/195).
- api_info, api_modify - add support for the ``iot modbus`` path (https://github.com/ansible-collections/community.routeros/pull/205).
- api_info, api_modify - add support for the ``ip dhcp-server option`` and
``ip dhcp-server option sets`` paths (https://github.com/ansible-collections/community.routeros/pull/223).
- api_info, api_modify - add support for the ``ip upnp interfaces``, ``tool
graphing interface``, ``tool graphing resource`` paths (https://github.com/ansible-collections/community.routeros/pull/227).
- api_info, api_modify - add support for the ``ipv6 firewall nat`` path (https://github.com/ansible-collections/community.routeros/pull/204).
- api_info, api_modify - add support for the ``mode`` property in ``ip neighbor
discovery-settings`` introduced in RouterOS 7.7 (https://github.com/ansible-collections/community.routeros/pull/198).
- api_info, api_modify - add support for the ``port remote-access`` path (https://github.com/ansible-collections/community.routeros/pull/224).
- api_info, api_modify - add support for the ``routing filter rule`` and ``routing
filter select-rule`` paths (https://github.com/ansible-collections/community.routeros/pull/200).
- api_info, api_modify - add support for the ``routing table`` path in RouterOS
7 (https://github.com/ansible-collections/community.routeros/pull/215).
- api_info, api_modify - add support for the ``tool netwatch`` path in RouterOS
7 (https://github.com/ansible-collections/community.routeros/pull/216).
- api_info, api_modify - add support for the ``user settings`` path (https://github.com/ansible-collections/community.routeros/pull/201).
- api_info, api_modify - add support for the ``user`` path (https://github.com/ansible-collections/community.routeros/pull/211).
- api_info, api_modify - finalize fields for the ``interface wireless security-profiles``
path and enable it (https://github.com/ansible-collections/community.routeros/pull/203).
- api_info, api_modify - finalize fields for the ``ppp profile`` path and
enable it (https://github.com/ansible-collections/community.routeros/pull/217).
- 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).
- api_modify, api_info - support API paths ``routing id``, ``routing bgp connection``
(https://github.com/ansible-collections/community.routeros/pull/220).
release_summary: Bugfix and feature release.
fragments:
- 195-add-interface-wireless-data.yml
- 197-dns-static-addrlist-matchsubdomain.yml
- 198-ip-nd-mode.yml
- 199-add-interface-pppclient.yml
- 2.10.0.yml
- 200-add-routing-filter.yml
- 201-add-user-settings.yml
- 203-wireless-security-profiles.yml
- 204-add-ipv6-firewall-nat.yml
- 205-add-iot-modbus.yml
- 210-date-time-gmt-offset.yml
- 211-user.yml
- 213-read-write-only.yml
- 215-add-routing-table.yml
- 216-add-tool-netwatch.yml
- 217-ppp-profiles.yml
- 218-snmp-engine-id.yml
- 220-routing-id-bgp-connection.yml
- 223-add-ip-dhcp-server-option.yml
- 224-add-port-remote-access.yml
- 227-add-upnp-graphing.yml
release_date: '2023-10-08'
2.11.0:
changes:
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/pull/235)
- api_info, api_modify - add missing parameters ``address-list``, ``address-list-timeout``,
``randomise-ports``, and ``realm`` to subpaths of the ``ip firewall`` path
(https://github.com/ansible-collections/community.routeros/issues/236, https://github.com/ansible-collections/community.routeros/pull/237).
- api_info, api_modify - mark the ``interface wireless`` parameter ``running``
as read-only (https://github.com/ansible-collections/community.routeros/pull/233).
- api_info, api_modify - set the default value to ``false`` for the ``disabled``
parameter in some more paths where it can be seen in the documentation (https://github.com/ansible-collections/community.routeros/pull/237).
- api_modify - add missing ``comment`` attribute to ``/routing id`` (https://github.com/ansible-collections/community.routeros/pull/234).
- api_modify - add missing attributes to the ``routing bgp connection`` path
(https://github.com/ansible-collections/community.routeros/pull/234).
- api_modify - add versioning to the ``/tool e-mail`` path (RouterOS 7.12
release) (https://github.com/ansible-collections/community.routeros/pull/234).
- api_modify - make ``/ip traffic-flow target`` a multiple value attribute
(https://github.com/ansible-collections/community.routeros/pull/234).
release_summary: Feature and bugfix release.
fragments:
- 2.11.0.yml
- 233-wireless-running-read-only.yml
- 234-bugfixes-and-update-adaptations.yml
- 235-add-missing-dns-attributes.yml
- 237-add-missing-ip-firewall-attributes.yml
release_date: '2023-12-03'
2.12.0:
changes:
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/pull/244).
- api_info, api_modify - add ``radius`` path (https://github.com/ansible-collections/community.routeros/issues/241,
https://github.com/ansible-collections/community.routeros/pull/245).
- api_info, api_modify - add ``routing rule`` path (https://github.com/ansible-collections/community.routeros/issues/162,
https://github.com/ansible-collections/community.routeros/pull/246).
- api_info, api_modify - add missing path ``routing bgp template`` (https://github.com/ansible-collections/community.routeros/pull/243).
- api_info, api_modify - add support for the ``tx-power`` attribute in ``interface
wireless`` (https://github.com/ansible-collections/community.routeros/pull/239).
- api_info, api_modify - removed ``host`` primary key in ``tool netwatch``
path (https://github.com/ansible-collections/community.routeros/pull/248).
- api_modify, api_info - added support for ``interface wifiwave2`` (https://github.com/ansible-collections/community.routeros/pull/226).
release_summary: Feature release.
fragments:
- 2.12.0.yml
- 226-support-for-WifiWave2.yml
- 239-wireless-tx-power.yml
- 243-add-routing-bgp-template-path.yml
- 244-add-interface-ovpn-client-path.yml
- 245-add-radius-path.yml
- 246-add-routing-rule-path.yml
- 247-removed-primary-key-host-in-tool-netwatch.yml
release_date: '2024-01-21'
2.13.0:
changes:
bugfixes:
- facts - fix date not getting removed for idempotent config export (https://github.com/ansible-collections/community.routeros/pull/262).
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/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)
release_summary: Bugfix and feature release.
fragments:
- 2.13.0.yml
- 257-make-user_group-modifiable.yml
- 259-add-routeros7-support-for-ip-vrf.yml
- 262-fix-date-removal.yml
release_date: '2024-02-25'
2.14.0:
changes:
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).
- api_info, api_modify - added support for ``interface wifi`` and its sub-paths
(https://github.com/ansible-collections/community.routeros/pull/266).
- api_info, api_modify - remove default value for read-only ``running`` field
in ``interface wireless`` (https://github.com/ansible-collections/community.routeros/pull/264).
release_summary: Feature release.
fragments:
- 2.14.0.yml
- 263-sys-pkg-update.yml
- 264-wireless-running-default.yml
- 266-interface-wifi.yml
release_date: '2024-03-25'
2.15.0:
changes:
minor_changes:
- api_info, api_modify - Add RouterOS 7.x support to ``/mpls ldp`` path (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).
- api_info, api_modify - add ``/routing filter`` path for RouterOS 6.x (https://github.com/ansible-collections/community.routeros/pull/279).
- api_info, api_modify - add default value for ``from-pool`` field in ``/ipv6
address`` (https://github.com/ansible-collections/community.routeros/pull/270).
- api_info, api_modify - add missing path ``/interface pppoe-server server``
(https://github.com/ansible-collections/community.routeros/pull/273).
- api_info, api_modify - add missing path ``/ip dhcp-relay`` (https://github.com/ansible-collections/community.routeros/pull/276).
- api_info, api_modify - add missing path ``/queue simple`` (https://github.com/ansible-collections/community.routeros/pull/269).
- api_info, api_modify - add missing path ``/queue type`` (https://github.com/ansible-collections/community.routeros/pull/274).
- api_info, api_modify - add missing paths ``/routing bgp aggregate``, ``/routing
bgp network`` and ``/routing bgp peer`` (https://github.com/ansible-collections/community.routeros/pull/277).
- api_info, api_modify - add support for paths ``/mpls interface``, ``/mpls
ldp accept-filter``, ``/mpls ldp advertise-filter`` and ``mpls ldp interface``
(https://github.com/ansible-collections/community.routeros/pull/272).
release_summary: Feature release.
fragments:
- 2.15.0.yml
- 269-add-queue_simple-path.yml
- 270_fix_ipv6_from_pool_default_value.yml
- 271-mpls_ldp_routeros_7_support.yml
- 272-additional_mpls_path_support.yml
- 273-add_interface_pppoe-server_support.yml
- 274-add_queue_type_path.yml
- 276-add_ip_dhcp-relay_path.yml
- 277-add_routing_bgp_paths.yml
- 278-add_ip_route_rule_path.yml
- 279-add_routing_filter_path.yml
release_date: '2024-04-20'
2.16.0:
changes:
minor_changes:
- api_info, api_modify - add missing path ``/ppp secret`` (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).
release_summary: Feature release.
fragments:
- 2.16.0.yml
- 286-add_ppp_secret_path.yml
- 288-interface_ethernet_values.yml
release_date: '2024-06-16'
2.17.0:
changes:
minor_changes:
- api_info, api_modify - add ``system health settings`` path (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).
- 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/pull/297).
release_summary: Feature release.
fragments:
- 2.17.0.yml
- 294-add-system-health-settings-path.yml
- 295-add_system_resource_irq_rps_path.yml
- 297-add-ip-ssh-host-key-type.yml
release_date: '2024-07-09'
2.18.0:
changes:
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).
deprecated_features:
- 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.
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).
- api_info, api_modify - add support for the ``ip dhcp-server matcher`` path
(https://github.com/ansible-collections/community.routeros/pull/300).
- api_info, api_modify - add support for the ``ipv6 nd prefix`` path (https://github.com/ansible-collections/community.routeros/pull/303).
- api_info, api_modify - add support for the ``name`` and ``is-responder``
properties under the ``interface wireguard peers`` path introduced in RouterOS
7.15 (https://github.com/ansible-collections/community.routeros/pull/304).
- api_info, api_modify - add support for the ``routing ospf static-neighbor``
path in RouterOS 7 (https://github.com/ansible-collections/community.routeros/pull/302).
- api_info, api_modify - set default for ``force`` in ``ip dhcp-server option``
to an explicit ``false`` (https://github.com/ansible-collections/community.routeros/pull/300).
- api_modify - allow to restrict what is updated by limiting fields to specific
values with the new ``restrict`` option (https://github.com/ansible-collections/community.routeros/pull/305).
release_summary: Feature release.
fragments:
- 2.18.0.yml
- 300-add-ip-dhcp-server-matcher.yml
- 300-set-ip-dhcp-option-force-default.yml
- 302-ospf-static-neighbor.yml
- 303-add-ipv6-nd-prefix.yml
- 304-wireguard-name-responder.yml
- 305-api-restrict.yml
- 306-ingress-filtering-ros6.yml
- deprecate-eol-ansible-core.yml
release_date: '2024-08-12'
2.19.0:
changes:
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).
- api_info, api_modify - add support for the ``mld-version`` and ``multicast-querier``
properties in ``interface bridge`` (https://github.com/ansible-collections/community.routeros/pull/315).
- api_info, api_modify - add support for the ``routing filter num-list`` path
implemented by RouterOS 7 and newer (https://github.com/ansible-collections/community.routeros/pull/313).
- api_info, api_modify - add support for the ``routing igmp-proxy`` path (https://github.com/ansible-collections/community.routeros/pull/309).
- api_modify, api_info - add read-only ``default`` field to ``snmp community``
(https://github.com/ansible-collections/community.routeros/pull/311).
release_summary: Feature release.
fragments:
- 2.19.0.yml
- 309-add-igmp-proxy.yml
- 310-add-ip-dns-adlist.yml
- 311-add-defaults-fields-snmp-community.yml
- 313-add-routing-filter-num-list.yml
- 315-bridge-mld-version-multicast-querier.yml
release_date: '2024-09-10'
2.20.0:
changes:
minor_changes:
- api_info, api_modify - add new parameters from the RouterOS 7.16 release
(https://github.com/ansible-collections/community.routeros/pull/323).
- api_info, api_modify - add support ``interface l2tp-client`` configuration
(https://github.com/ansible-collections/community.routeros/pull/322).
- api_info, api_modify - add support for the ``cpu-frequency``, ``memory-frequency``,
``preboot-etherboot`` and ``preboot-etherboot-server`` properties in ``system
routerboard settings`` (https://github.com/ansible-collections/community.routeros/pull/320).
- api_info, api_modify - add support for the ``matching-type`` property in
``ip dhcp-server matcher`` introduced by RouterOS 7.16 (https://github.com/ansible-collections/community.routeros/pull/321).
release_summary: Feature release.
fragments:
- 2.20.0.yml
- 320-add-routerboard-properties.yml
- 321-dhcp-server-matcher-matching-type.yml
- 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'
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'
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'
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'
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'
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'
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'
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'
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'
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'
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'

View file

@ -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

View file

@ -1,29 +1,43 @@
---
# 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
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:
- rst
- md
prelude_section_name: release_summary
prelude_section_title: Release Summary
sections:
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
- - major_changes
- Major Changes
- - minor_changes
- Minor Changes
- - breaking_changes
- Breaking Changes / Porting Guide
- - deprecated_features
- Deprecated Features
- - removed_features
- Removed Features (previously deprecated)
- - security_fixes
- Security Fixes
- - bugfixes
- Bugfixes
- - known_issues
- Known Issues
title: Community RouterOS
trivial_section_name: trivial
use_fqcn: true
add_plugin_period: true
changelog_nice_yaml: true
changelog_sort: version
vcs: auto

View file

@ -0,0 +1,12 @@
---
bugfixes:
- |
api_facts - also report interfaces that are inferred only by reference by IP addresses.
RouterOS's APIs have IPv4 and IPv6 addresses point at interfaces by their name, which can
change over time and in-between API calls, such that interfaces may have been enumerated
under another name, or not at all (for example when removed). Such interfaces are now reported
under their new or temporary name and with a synthetic ``type`` property set to differentiate
the more likely and positively confirmed removal case (with ``type: "ansible:unknown"``) from
the unlikely and probably transient naming mismatch (with ``type: "ansible:mismatch"``).
Previously, the api_facts module would have crashed with a ``KeyError`` exception
(https://github.com/ansible-collections/community.routeros/pull/391).

View file

@ -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).

View file

@ -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).

View file

@ -1,2 +1,7 @@
---
# 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
fixes:
- "ansible_collections/community/routeros/::"

7
docs/docsite/config.yml Normal file
View file

@ -0,0 +1,7 @@
---
# 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
changelog:
write_changelog: true

View file

@ -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
sections:
- title: Guides
toctree:
- api-guide
- ssh-guide
- quoting

33
docs/docsite/links.yml Normal file
View file

@ -0,0 +1,33 @@
---
# 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
edit_on_github:
repository: ansible-collections/community.routeros
branch: main
path_prefix: ''
extra_links:
- description: Ask for help (RouterOS)
url: https://forum.ansible.com/tags/c/help/6/none/routeros
- description: Submit a bug report
url: https://github.com/ansible-collections/community.routeros/issues/new?assignees=&labels=&template=bug_report.md
- description: Request a feature
url: https://github.com/ansible-collections/community.routeros/issues/new?assignees=&labels=&template=feature_request.md
communication:
matrix_rooms:
- topic: General usage and support questions
room: '#users:ansible.im'
irc_channels:
- topic: General usage and support questions
network: Libera
channel: '#ansible'
forums:
- topic: "Ansible Forum: General usage and support questions"
# The following URL directly points to the "Get Help" section
url: https://forum.ansible.com/c/help/6/none
- topic: "Ansible Forum: Discussions about RouterOS"
# The following URL directly points to the "routeros" tag
url: https://forum.ansible.com/tag/routeros

View file

@ -0,0 +1,198 @@
..
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
.. _ansible_collections.community.routeros.docsite.api-guide:
How to connect to RouterOS devices with the RouterOS API
========================================================
You can use the :ansplugin:`community.routeros.api module <community.routeros.api#module>` to connect to a RouterOS device with the RouterOS API. More specific module to modify certain entries are the :ansplugin:`community.routeros.api_modify <community.routeros.api_modify#module>` and :ansplugin:`community.routeros.api_find_and_modify <community.routeros.api_find_and_modify#module>` modules. The :ansplugin:`community.routeros.api_info module <community.routeros.api_info#module>` allows to retrieve information on specific predefined paths that can be used as input for the :ansplugin:`community.routeros.api_modify <community.routeros.api_modify#module>` module, and the :ansplugin:`community.routeros.api_facts module <community.routeros.api_facts#module>` allows to retrieve Ansible facts using the RouterOS API.
No special setup is needed; the module needs to be run on a host that can connect to the device's API. The most common case is that the module is run on ``localhost``, either by using ``hosts: localhost`` in the playbook, or by using ``delegate_to: localhost`` for the task. The following example shows how to run the equivalent of ``/ip address print``:
.. code-block:: yaml+jinja
---
- name: RouterOS test with API
hosts: localhost
gather_facts: false
vars:
hostname: 192.168.1.1
username: admin
password: test1234
tasks:
- name: Get "ip address print"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "ip address"
# The following options configure TLS/SSL.
# Depending on your setup, these options need different values:
tls: true
validate_certs: true
validate_cert_hostname: true
# If you are using your own PKI, specify the path to your CA certificate here:
# ca_path: /path/to/ca-certificate.pem
register: print_path
- name: Show IP address of first interface
ansible.builtin.debug:
msg: "{{ print_path.msg[0].address }}"
This results in the following output:
.. code-block:: ansible-output
PLAY [RouterOS test] *********************************************************************************************
TASK [Get "ip address print"] ************************************************************************************
ok: [localhost]
TASK [Show IP address of first interface] ************************************************************************
ok: [localhost] => {
"msg": "192.168.2.1/24"
}
PLAY RECAP *******************************************************************************************************
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 <community.routeros.api#module>` for details on the options.
Using the ``community.routeros.api`` module defaults group
----------------------------------------------------------
To avoid having to specify common parameters for all the API based modules in every task, you can use the ``community.routeros.api`` :ref:`module defaults group <module_defaults_groups>`:
.. code-block:: yaml+jinja
---
- name: RouterOS test with API
hosts: localhost
gather_facts: false
module_defaults:
group/community.routeros.api:
hostname: 192.168.1.1
password: admin
username: test1234
# The following options configure TLS/SSL.
# Depending on your setup, these options need different values:
tls: true
validate_certs: true
validate_cert_hostname: true
# If you are using your own PKI, specify the path to your CA certificate here:
# ca_path: /path/to/ca-certificate.pem
tasks:
- name: Gather facts
community.routeros.api_facts:
- name: Get "ip address print"
community.routeros.api:
path: "ip address"
- name: Change IP address to 192.168.1.1 for interface bridge
community.routeros.api_find_and_modify:
path: ip address
find:
interface: bridge
values:
address: "192.168.1.1/24"
Here all three tasks will use the options set for the module defaults group.
Setting up encryption
---------------------
It is recommended to always use :ansopt:`tls=true` when connecting with the API, even if you are only connecting to the device through a trusted network. The following options control how TLS/SSL is used:
:force_no_cert: Setting to :ansval:`true` connects to the device without a certificate. **This is discouraged to use in production and is susceptible to Man-in-the-Middle attacks**, but might be useful when setting the device up. The default value is :ansval:`false`.
:validate_certs: Setting to :ansval:`false` disables any certificate validation. **This is discouraged to use in production**, but is needed when setting the device up. The default value is :ansval:`true`.
:validate_cert_hostname: Setting to :ansval:`false` (default) disables hostname verification during certificate validation. This is needed if the hostnames specified in the certificate do not match the hostname used for connecting (usually the device's IP). It is recommended to set up the certificate correctly and set this to :ansval:`true`; the default :ansval:`false` is chosen for backwards compatibility to an older version of the module.
:ca_path: If you are not using a commercially trusted CA certificate to sign your device's certificate, or have not included your CA certificate in Python's truststore, you need to point this option to the CA certificate.
We recommend to create a CA certificate that is used to sign the certificates for your RouterOS devices, and have the certificates include the correct hostname(s), including the IP of the device. That way, you can fully enable TLS and be sure that you always talk to the correct device.
Setting up a PKI
^^^^^^^^^^^^^^^^
Please follow the instructions in the ``community.crypto`` :ref:`ansible_collections.community.crypto.docsite.guide_ownca` guide to set up a CA certificate and sign a certificate for your router. You should add a Subject Alternative Name for the IP address (for example ``IP:192.168.1.1``) and - if available - for the DNS name (for example ``DNS:router.local``) to the certificate.
Installing a certificate on a MikroTik router
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Installing the certificate is best done with the SSH connection. (See the :ref:`ansible_collections.community.routeros.docsite.ssh-guide` guide for more information.) Once the certificate has been installed, and the HTTPS API enabled, it's easier to work with the API, since it has a quite a few less problems, and returns data as JSON objects instead of text you first have to parse.
First you have to convert the certificate and its private key to a `PKCS #12 bundle <https://en.wikipedia.org/wiki/PKCS_12>`_. This can be done with the :ansplugin:`community.crypto.openssl_pkcs12 <community.crypto.openssl_pkcs12#module>`. The following playbook assumes that the certificate is available as ``keys/{{ inventory_hostname }}.pem``, and its private key is available as ``keys/{{ inventory_hostname }}.key``. It generates a random passphrase to protect the PKCS#12 file.
.. code-block:: yaml+jinja
---
- name: Install certificates on devices
hosts: routers
gather_facts: false
tasks:
- block:
- set_fact:
random_password: "{{ lookup('community.general.random_string', length=32, override_all='0123456789abcdefghijklmnopqrstuvwxyz') }}"
- name: Create PKCS#12 bundle
openssl_pkcs12:
path: keys/{{ inventory_hostname }}.p12
certificate_path: keys/{{ inventory_hostname }}.pem
privatekey_path: keys/{{ inventory_hostname }}.key
friendly_name: '{{ inventory_hostname }}'
passphrase: "{{ random_password }}"
mode: "0600"
changed_when: false
delegate_to: localhost
- name: Copy router certificate onto router
ansible.netcommon.net_put:
src: 'keys/{{ inventory_hostname }}.p12'
dest: '{{ inventory_hostname }}.p12'
- name: Install router certificate and clean up
community.routeros.command:
commands:
# Import certificate:
- /certificate import name={{ inventory_hostname }} file-name={{ inventory_hostname }}.p12 passphrase="{{ random_password }}"
# Remove PKCS12 bundle:
- /file remove {{ inventory_hostname }}.p12
# Show certificates
- /certificate print
register: output
- name: Show result of certificate import
debug:
var: output.stdout_lines[0]
- name: Show certificates
debug:
var: output.stdout_lines[2]
always:
- name: Wipe PKCS12 bundle
command: wipe keys/{{ inventory_hostname }}.p12
changed_when: false
delegate_to: localhost
- name: Use certificate
community.routeros.command:
commands:
- /ip service set www-ssl address={{ admin_network }} certificate={{ inventory_hostname }} disabled=no tls-version=only-1.2
- /ip service set api-ssl address={{ admin_network }} certificate={{ inventory_hostname }} tls-version=only-1.2
The playbook also assumes that ``admin_network`` describes the network from which the HTTPS and API interface can be accessed. This can be for example ``192.168.1.0/24``.
When this playbook completed successfully, you should be able to use the HTTPS admin interface (reachable in a browser from ``https://192.168.1.1/``, with the correct IP inserted), as well as the :ansplugin:`community.routeros.api module <community.routeros.api#module>` module with TLS and certificate validation enabled:
.. code-block:: yaml+jinja
- community.routeros.api:
# ...
tls: true
validate_certs: true
validate_cert_hostname: true
ca_path: /path/to/ca-certificate.pem

View file

@ -0,0 +1,19 @@
..
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
.. _ansible_collections.community.routeros.docsite.quoting:
How to quote and unquote commands and arguments
===============================================
When using the :ansplugin:`community.routeros.command module <community.routeros.command#module>` or the :ansplugin:`community.routeros.api module <community.routeros.api#module>` modules, you need to pass text data in quoted form. While in some cases quoting is not needed (when passing IP addresses or names without spaces, for example), in other cases it is required, like when passing a comment which contains a space.
The community.routeros collection provides a set of Jinja2 filter plugins which helps you with these tasks:
- The :ansplugin:`community.routeros.quote_argument_value filter <community.routeros.quote_argument_value#filter>` quotes an argument value: ``'this is a "comment"' | community.routeros.quote_argument_value == '"this is a \\"comment\\""'``.
- The :ansplugin:`community.routeros.quote_argument filter <community.routeros.quote_argument#filter>` quotes an argument with or without a value: ``'comment=this is a "comment"' | community.routeros.quote_argument == 'comment="this is a \\"comment\\""'``.
- The :ansplugin:`community.routeros.join filter <community.routeros.join#filter>` quotes a list of arguments and joins them to one string: ``['foo=bar', 'comment=foo is bar'] | community.routeros.join == 'foo=bar comment="foo is bar"'``.
- The :ansplugin:`community.routeros.split filter <community.routeros.split#filter>` splits a command into a list of arguments (with or without values): ``'foo=bar comment="foo is bar"' | community.routeros.split == ['foo=bar', 'comment=foo is bar']``
- The :ansplugin:`community.routeros.list_to_dict filter <community.routeros.list_to_dict#filter>` splits a list of arguments with values into a dictionary: ``['foo=bar', 'comment=foo is bar'] | community.routeros.list_to_dict == {'foo': 'bar', 'comment': 'foo is bar'}``. It has two optional arguments: :ansopt:`community.routeros.list_to_dict#filter:require_assignment` (default value :ansval:`true`) allows to accept arguments without values when set to :ansval:`false`; and :ansopt:`community.routeros.list_to_dict#filter:skip_empty_values` (default value :ansval:`false`) allows to skip arguments whose value is empty.

View file

@ -0,0 +1,129 @@
..
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
.. _ansible_collections.community.routeros.docsite.ssh-guide:
How to connect to RouterOS devices with SSH
===========================================
The collection offers two modules to connect to RouterOS devies with SSH:
- The :ansplugin:`community.routeros.facts module <community.routeros.facts#module>` gathers facts about a RouterOS device;
- The :ansplugin:`community.routeros.command module <community.routeros.command#module>` executes commands on a RouterOS device.
The modules need the :ansplugin:`ansible.netcommon.network_cli connection plugin <ansible.netcommon.network_cli#connection>` for this.
Important notes
---------------
1. The SSH-based modules do not support arbitrary symbols in the router's identity. If you are having trouble connecting to your device, please make sure that your MikroTik's identity contains only alphanumeric characters and dashes. Also make sure that the identity string is not longer than 19 characters (`see issue for details <https://github.com/ansible-collections/community.routeros/issues/31>`__). Similar problems can happen for unsupported characters in your username.
2. The :ansplugin:`community.routeros.command module <community.routeros.command#module>` does not support nesting commands and expects every command to start with a forward slash (``/``). Running the following command will produce an error:
.. code-block:: yaml+jinja
- community.routeros.command:
commands:
- /ip
- print
3. When using the :ansplugin:`community.routeros.command module <community.routeros.command#module>` module, make sure to not specify too long commands. Alternatively, add something like ``+cet512w`` to the username (replace ``admin`` with ``admin+cet512w``) to tell RouterOS to not wrap before 512 characters in a line (`see issue for details <https://github.com/ansible-collections/community.routeros/issues/6>`__).
4. The :ansplugin:`ansible.netcommon.network_cli connection plugin <ansible.netcommon.network_cli#connection>` uses `paramiko <https://pypi.org/project/paramiko/>`_ by default to connect to devices with SSH. You can set its :ansopt:`ansible.netcommon.network_cli#connection:ssh_type` option to :ansval:`libssh` to use `ansible-pylibssh <https://pypi.org/project/ansible-pylibssh/>`_ instead, which offers Python bindings to libssh. See its documentation for details.
5. User is **not allowed** to login via SSH by password to modern Mikrotik if SSH key for the user is added!
Setting up an inventory
-----------------------
An example inventory ``hosts`` file for a RouterOS device is as follows:
.. code-block:: ini
[routers]
router ansible_host=192.168.2.1
[routers:vars]
ansible_connection=ansible.netcommon.network_cli
ansible_network_os=community.routeros.routeros
ansible_user=admin
ansible_ssh_pass=test1234
This tells Ansible that you have a RouterOS device called ``router`` with IP ``192.168.2.1``. Ansible should use the :ansplugin:`ansible.netcommon.network_cli connection plugin <ansible.netcommon.network_cli#connection>` together with the the :ansplugin:`community.routeros.routeros cliconf plugin <community.routeros.routeros#cliconf>`. The credentials are stored as ``ansible_user`` and ``ansible_ssh_pass`` in the inventory.
Connecting to the device
------------------------
With the above inventory, you can use the following playbook to execute ``/system resource print`` on the device
.. code-block:: yaml+jinja
---
- name: RouterOS test with network_cli connection
hosts: routers
gather_facts: false
tasks:
- 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: Gather facts
community.routeros.facts:
- name: Show a fact
debug:
msg: "First IP address: {{ ansible_net_all_ipv4_addresses[0] }}"
This results in the following output:
.. code-block:: ansible-output
PLAY [RouterOS test with network_cli connection] *****************************************************************
TASK [Gather system resources] ***********************************************************************************
ok: [router]
TASK [Show system resources] *************************************************************************************
ok: [router] => {
"system_resource_print.stdout_lines": [
[
"uptime: 3d10h28m51s",
" version: 6.48.3 (stable)",
" build-time: May/25/2021 06:09:45",
" free-memory: 31.2MiB",
" total-memory: 64.0MiB",
" cpu: MIPS 24Kc V7.4",
" cpu-count: 1",
" cpu-frequency: 400MHz",
" cpu-load: 1%",
" free-hdd-space: 54.2MiB",
" total-hdd-space: 128.0MiB",
" write-sect-since-reboot: 927",
" write-sect-total: 51572981",
" bad-blocks: 1%",
" architecture-name: mipsbe",
" board-name: RB750GL",
" platform: MikroTik"
]
]
}
TASK [Gather facts] **********************************************************************************************
ok: [router]
TASK [Show a fact] ***********************************************************************************************
ok: [router] => {
"msg": "First IP address: 192.168.2.1"
}
PLAY RECAP *******************************************************************************************************
router : ok=4 changed=0 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0

View file

@ -1,14 +1,22 @@
---
# 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
# See https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html
namespace: community
name: routeros
version: 1.0.0
version: 3.9.0
readme: README.md
authors:
- Egor Zaitsev (github.com/heuels)
- Nikolay Dachev (github.com/NikolayDachev)
description: Modules for MikroTik RouterOS
license_file: COPYING
- Felix Fontein (github.com/felixfontein)
description: Modules and plugins for MikroTik RouterOS
license:
- GPL-3.0-or-later
# license_file: COPYING
tags:
- network
- mikrotik
@ -16,8 +24,7 @@ tags:
dependencies:
ansible.netcommon: '>=1.0.0'
repository: https://github.com/ansible-collections/community.routeros
documentation: https://ansible.fontein.de/collections/community/routeros/
#documentation: https://github.com/ansible-collection-migration/community.routeros/tree/main/docs
documentation: https://docs.ansible.com/ansible/devel/collections/community/routeros/
homepage: https://github.com/ansible-collections/community.routeros
issues: https://github.com/ansible-collections/community.routeros/issues
build_ignore:

5
meta/ee-requirements.txt Normal file
View file

@ -0,0 +1,5 @@
# 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
librouteros

View file

@ -0,0 +1,8 @@
---
# 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
dependencies:
python: meta/ee-requirements.txt

View file

@ -1,2 +1,13 @@
---
requires_ansible: '>=2.9.10'
# 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
requires_ansible: '>=2.15.0'
action_groups:
api:
- api
- api_facts
- api_find_and_modify
- api_info
- api_modify

53
noxfile.py Normal file
View file

@ -0,0 +1,53 @@
# 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:
#
# /// 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()

View file

@ -1,42 +1,24 @@
#
# (c) 2017 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright (c) 2017 Red Hat Inc.
# 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
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
author: "Egor Zaitsev (@heuels)"
cliconf: routeros
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
from itertools import chain
from ansible.module_utils._text import to_bytes, to_text
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import to_list
from ansible.plugins.cliconf import CliconfBase, enable_mode
from ansible.module_utils.common.text.converters import to_text
from ansible.plugins.cliconf import CliconfBase
class Cliconf(CliconfBase):
@ -65,7 +47,7 @@ class Cliconf(CliconfBase):
return device_info
def get_config(self, source='running', format='text', flags=None):
def get_config(self, source='running', flags=None, format=None):
return
def edit_config(self, command):

View file

@ -0,0 +1,133 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2020, Nikolay Dachev <nikolay@dachev.info>
# GNU General Public License v3.0+ 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
class ModuleDocFragment(object):
DOCUMENTATION = r"""
options:
hostname:
description:
- RouterOS hostname API.
required: true
type: str
username:
description:
- RouterOS login user.
required: true
type: str
password:
description:
- RouterOS user password.
required: true
type: str
timeout:
description:
- Timeout for the request.
type: int
default: 10
version_added: 2.3.0
tls:
description:
- If is set TLS will be used for RouterOS API connection.
required: false
type: bool
default: false
aliases:
- ssl
port:
description:
- 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:
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).
type: bool
default: false
version_added: 2.4.0
validate_certs:
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.
type: bool
default: true
version_added: 1.2.0
validate_cert_hostname:
description:
- Set to V(true) to validate hostnames in certificates.
- See also O(validate_certs). Only used when O(tls=true) and O(validate_certs=true).
type: bool
default: false
version_added: 1.2.0
ca_path:
description:
- PEM formatted file that contains a CA certificate to be used for certificate validation.
- See also O(validate_cert_hostname). Only used when O(tls=true) and O(validate_certs=true).
type: path
version_added: 1.2.0
encoding:
description:
- Use the specified encoding when communicating with the RouterOS device.
- Default is V(ASCII). Note that V(UTF-8) requires librouteros 3.2.1 or newer.
type: str
default: ASCII
version_added: 2.1.0
requirements:
- librouteros
- 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.
"""
RESTRICT = r"""
options:
restrict:
type: list
elements: dict
suboptions:
field:
description:
- The field whose values to restrict.
required: true
type: str
match_disabled:
description:
- Whether disabled or not provided values should match.
type: bool
default: false
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.'
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.
type: str
invert:
description:
- Invert the condition. This affects O(restrict[].match_disabled), O(restrict[].values), and O(restrict[].regex).
type: bool
default: false
"""

View file

@ -0,0 +1,112 @@
# -*- coding: utf-8 -*-
# Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see COPYING 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
class ModuleDocFragment(object):
# Standard documentation fragment
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
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
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.
'''
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
'''
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.
"""
FACTS = r"""
options: {}
attributes:
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'''
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
'''
FILES = r"""
options: {}
attributes:
safe_file_operations:
description: Uses Ansible's strict file operation functions to ensure proper permissions and avoid data corruption.
"""
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.
"""

32
plugins/filter/join.yml Normal file
View file

@ -0,0 +1,32 @@
---
# 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
DOCUMENTATION:
name: join
short_description: Join a list of arguments to a command
version_added: 2.0.0
description:
- Join and quotes a list of arguments to a command.
options:
_input:
description:
- A list of arguments to quote and join.
type: list
elements: string
required: true
author:
- 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 }}"
# Should result in 'foo=bar comment="foo is bar"'
RETURN:
_value:
description: The joined and quoted result.
type: string

View file

@ -0,0 +1,42 @@
---
# 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
DOCUMENTATION:
name: list_to_dict
short_description: Convert a list of arguments to a dictionary
version_added: 2.0.0
description:
- Convert a list of arguments to a dictionary.
options:
_input:
description:
- A list of assignments. Can be the result of the P(community.routeros.split#filter) filter.
type: list
elements: string
required: true
require_assignment:
description:
- Allows to accept arguments without values when set to V(false).
type: boolean
default: true
skip_empty_values:
description:
- Allows to skip arguments whose value is empty when set to V(true).
type: boolean
default: false
author:
- 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 }}"
# dictionary == {'foo': 'bar', 'comment': 'foo is bar'}
RETURN:
_value:
description: A dictionary representation of the input data.
type: dictionary

View file

@ -0,0 +1,32 @@
---
# 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
DOCUMENTATION:
name: quote_argument
short_description: Quote an argument
version_added: 2.0.0
description:
- Quote an argument.
options:
_input:
description:
- An argument to quote.
type: string
required: true
author:
- 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 }}
# Should result in 'comment="this is a \"comment\""'
RETURN:
_value:
description: The quoted argument.
type: string

View file

@ -0,0 +1,32 @@
---
# 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
DOCUMENTATION:
name: quote_argument_value
short_description: Quote an argument value
version_added: 2.0.0
description:
- Quote an argument value.
options:
_input:
description:
- An argument value to quote.
type: string
required: true
author:
- 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 }}
# Should result in '"this is a \"comment\""'
RETURN:
_value:
description: The quoted argument value.
type: string

114
plugins/filter/quoting.py Normal file
View file

@ -0,0 +1,114 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Felix Fontein <felix@fontein.de>
# 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
from ansible.errors import AnsibleFilterError
from ansible.module_utils.common.text.converters import to_text
from ansible_collections.community.routeros.plugins.module_utils.quoting import (
ParseError,
convert_list_to_dictionary,
join_routeros_command,
quote_routeros_argument,
quote_routeros_argument_value,
split_routeros_command,
)
def wrap_exception(fn, *args, **kwargs):
try:
return fn(*args, **kwargs)
except ParseError as e:
raise AnsibleFilterError(to_text(e))
def split(line):
'''
Split a command into arguments.
Example:
'add name=wrap comment="with space"'
is converted to:
['add', 'name=wrap', 'comment=with space']
'''
return wrap_exception(split_routeros_command, line)
def quote_argument_value(argument):
'''
Quote an argument value.
Example:
'with "space"'
is converted to:
r'"with \"space\""'
'''
return wrap_exception(quote_routeros_argument_value, argument)
def quote_argument(argument):
'''
Quote an argument.
Example:
'comment=with "space"'
is converted to:
r'comment="with \"space\""'
'''
return wrap_exception(quote_routeros_argument, argument)
def join(arguments):
'''
Join a list of arguments to a command.
Example:
['add', 'name=wrap', 'comment=with space']
is converted to:
'add name=wrap comment="with space"'
'''
return wrap_exception(join_routeros_command, arguments)
def list_to_dict(string_list, require_assignment=True, skip_empty_values=False):
'''
Convert a list of arguments to a list of dictionary.
Example:
['foo=bar', 'comment=with space', 'additional=']
is converted to:
{'foo': 'bar', 'comment': 'with space', 'additional': ''}
If require_assignment is True (default), arguments without assignments are
rejected. (Example: in ['add', 'name=foo'], 'add' is an argument without
assignment.) If it is False, these are given value None.
If skip_empty_values is True, arguments with empty value are removed from
the result. (Example: in ['name='], 'name' has an empty value.)
If it is False (default), these are kept.
'''
return wrap_exception(
convert_list_to_dictionary,
string_list,
require_assignment=require_assignment,
skip_empty_values=skip_empty_values,
)
class FilterModule(object):
'''Ansible jinja2 filters for RouterOS command quoting and unquoting'''
def filters(self):
return {
'split': split,
'quote_argument': quote_argument,
'quote_argument_value': quote_argument_value,
'join': join,
'list_to_dict': list_to_dict,
}

33
plugins/filter/split.yml Normal file
View file

@ -0,0 +1,33 @@
---
# 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
DOCUMENTATION:
name: split
short_description: Split a command into arguments
version_added: 2.0.0
description:
- Split a command into arguments.
options:
_input:
description:
- A command.
type: string
required: true
author:
- 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 }}
# Should result in ['foo=bar', 'comment=foo is bar', 'baz']
RETURN:
_value:
description: The list of arguments.
type: list
elements: string

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,102 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022, Felix Fontein (@felixfontein) <felix@fontein.de>
# 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 data inside here is private to this collection. If you use this from outside the collection,
# you are on your own. There can be random changes to its format even in bugfix releases!
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import re
from ansible.module_utils.common.text.converters import to_text
def validate_and_prepare_restrict(module, path_info):
restrict = module.params['restrict']
if restrict is None:
return None
restrict_data = []
for rule in restrict:
field = rule['field']
if field.startswith('!'):
module.fail_json(msg='restrict: the field name "{0}" must not start with "!"'.format(field))
f = path_info.fields.get(field)
if f is None:
module.fail_json(msg='restrict: the field "{0}" does not exist for this path'.format(field))
new_rule = dict(
field=field,
match_disabled=rule['match_disabled'],
invert=rule['invert'],
)
if rule['values'] is not None:
new_rule['values'] = rule['values']
if rule['regex'] is not None:
regex = rule['regex']
try:
new_rule['regex'] = re.compile(regex)
new_rule['regex_source'] = regex
except Exception as exc:
module.fail_json(msg='restrict: invalid regular expression "{0}": {1}'.format(regex, exc))
restrict_data.append(new_rule)
return restrict_data
def _value_to_str(value):
if value is None:
return None
value_str = to_text(value)
if isinstance(value, bool):
value_str = value_str.lower()
return value_str
def _test_rule_except_invert(value, rule):
if value is None and rule['match_disabled']:
return True
if 'values' in rule and value in rule['values']:
return True
if 'regex' in rule and value is not None and rule['regex'].match(_value_to_str(value)):
return True
return False
def restrict_entry_accepted(entry, path_info, restrict_data):
if restrict_data is None:
return True
for rule in restrict_data:
# Obtain field and value
field = rule['field']
field_info = path_info.fields[field]
value = entry.get(field)
if value is None:
value = field_info.default
if field not in entry and field_info.absent_value:
value = field_info.absent_value
# Check
matches_rule = _test_rule_except_invert(value, rule)
if rule['invert']:
matches_rule = not matches_rule
if not matches_rule:
return False
return True
def restrict_argument_spec():
return dict(
restrict=dict(
type='list',
elements='dict',
options=dict(
field=dict(type='str', required=True),
match_disabled=dict(type='bool', default=False),
values=dict(type='list', elements='raw'),
regex=dict(type='str'),
invert=dict(type='bool', default=False),
),
),
)

120
plugins/module_utils/api.py Normal file
View file

@ -0,0 +1,120 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2022, Felix Fontein (@felixfontein) <felix@fontein.de>
# Copyright (c) 2020, Nikolay Dachev <nikolay@dachev.info>
# 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
from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.common.text.converters import to_native
import ssl
import traceback
LIB_IMP_ERR = None
try:
from librouteros import connect
from librouteros.exceptions import LibRouterosError # noqa: F401, pylint: disable=unused-import
HAS_LIB = True
except Exception as e:
HAS_LIB = False
LIB_IMP_ERR = traceback.format_exc()
def check_has_library(module):
if not HAS_LIB:
module.fail_json(
msg=missing_required_lib('librouteros'),
exception=LIB_IMP_ERR,
)
def api_argument_spec():
return dict(
username=dict(type='str', required=True),
password=dict(type='str', required=True, no_log=True),
hostname=dict(type='str', required=True),
port=dict(type='int'),
tls=dict(type='bool', default=False, aliases=['ssl']),
force_no_cert=dict(type='bool', default=False),
validate_certs=dict(type='bool', default=True),
validate_cert_hostname=dict(type='bool', default=False),
ca_path=dict(type='path'),
encoding=dict(type='str', default='ASCII'),
timeout=dict(type='int', default=10),
)
def _ros_api_connect(module, username, password, host, port, use_tls, force_no_cert, validate_certs, validate_cert_hostname, ca_path, encoding, timeout):
'''Connect to RouterOS API.'''
if not port:
if use_tls:
port = 8729
else:
port = 8728
try:
params = dict(
username=username,
password=password,
host=host,
port=port,
encoding=encoding,
timeout=timeout,
)
if use_tls:
ctx = ssl.create_default_context(cafile=ca_path)
wrap_context = ctx.wrap_socket
if force_no_cert:
ctx.check_hostname = False
ctx.set_ciphers("ADH:@SECLEVEL=0")
elif not validate_certs:
ctx.check_hostname = False
ctx.verify_mode = ssl.CERT_NONE
elif not validate_cert_hostname:
ctx.check_hostname = False
else:
# Since librouteros does not pass server_hostname,
# we have to do this ourselves:
def wrap_context(*args, **kwargs):
kwargs.pop('server_hostname', None)
return ctx.wrap_socket(*args, server_hostname=host, **kwargs)
params['ssl_wrapper'] = wrap_context
api = connect(**params)
except Exception as e:
connection = {
'username': username,
'hostname': host,
'port': port,
'ssl': use_tls,
'status': 'Error while connecting: %s' % to_native(e),
}
module.fail_json(msg=connection['status'], connection=connection)
return api
def create_api(module):
"""Create an API object."""
return _ros_api_connect(
module,
module.params['username'],
module.params['password'],
module.params['hostname'],
module.params['port'],
module.params['tls'],
module.params['force_no_cert'],
module.params['validate_certs'],
module.params['validate_cert_hostname'],
module.params['ca_path'],
module.params['encoding'],
module.params['timeout'],
)
def get_api_version(api):
"""Given an API object, query the system's version."""
system_info = list(api.path().join('system', 'resource'))[0]
return system_info['version'].split(' ', 1)[0]

View file

@ -0,0 +1,207 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Felix Fontein (@felixfontein) <felix@fontein.de>
# 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 sys
from ansible.module_utils.common.text.converters import to_native, to_bytes
class ParseError(Exception):
pass
ESCAPE_SEQUENCES = {
b'"': b'"',
b'\\': b'\\',
b'?': b'?',
b'$': b'$',
b'_': b' ',
b'a': b'\a',
b'b': b'\b',
b'f': b'\xFF',
b'n': b'\n',
b'r': b'\r',
b't': b'\t',
b'v': b'\v',
}
ESCAPE_SEQUENCE_REVERSED = dict([(v, k) for k, v in ESCAPE_SEQUENCES.items()])
ESCAPE_DIGITS = b'0123456789ABCDEF'
if sys.version_info[0] < 3:
_int_to_byte = chr
else:
def _int_to_byte(value):
return bytes((value, ))
def parse_argument_value(line, start_index=0, must_match_everything=True):
'''
Parse an argument value (quoted or not quoted) from ``line``.
Will start at offset ``start_index``. Returns pair ``(parsed_value,
end_index)``, where ``end_index`` is the first character after the
attribute.
If ``must_match_everything`` is ``True`` (default), will fail if
``end_index < len(line)``.
'''
line = to_bytes(line)
length = len(line)
index = start_index
if index == length:
raise ParseError('Expected value, but found end of string')
quoted = False
if line[index:index + 1] == b'"':
quoted = True
index += 1
current = []
while index < length:
ch = line[index:index + 1]
index += 1
if not quoted and ch == b' ':
index -= 1
break
elif ch == b'"':
if quoted:
quoted = False
if line[index:index + 1] not in (b'', b' '):
raise ParseError('Ending \'"\' must be followed by space or end of string')
break
raise ParseError('\'"\' must not appear in an unquoted value')
elif ch == b'\\':
if not quoted:
raise ParseError('Escape sequences can only be used inside double quotes')
if index == length:
raise ParseError('\'\\\' must not be at the end of the line')
ch = line[index:index + 1]
index += 1
if ch in ESCAPE_SEQUENCES:
current.append(ESCAPE_SEQUENCES[ch])
else:
d1 = ESCAPE_DIGITS.find(ch)
if d1 < 0:
raise ParseError('Invalid escape sequence \'\\{0}\''.format(to_native(ch)))
if index == length:
raise ParseError('Hex escape sequence cut off at end of line')
ch2 = line[index:index + 1]
d2 = ESCAPE_DIGITS.find(ch2)
index += 1
if d2 < 0:
raise ParseError('Invalid hex escape sequence \'\\{0}\''.format(to_native(ch + ch2)))
current.append(_int_to_byte(d1 * 16 + d2))
else:
if not quoted and ch in (b"'", b'=', b'(', b')', b'$', b'[', b'{', b'`'):
raise ParseError('"{0}" can only be used inside double quotes'.format(to_native(ch)))
if ch == b'?':
raise ParseError('"{0}" can only be used in escaped form'.format(to_native(ch)))
current.append(ch)
if quoted:
raise ParseError('Unexpected end of string during escaped parameter')
if must_match_everything and index < length:
raise ParseError('Unexpected data at end of value')
return to_native(b''.join(current)), index
def split_routeros_command(line):
line = to_bytes(line)
result = []
current = []
index = 0
length = len(line)
parsing_attribute_name = False
while index < length:
ch = line[index:index + 1]
index += 1
if ch == b' ':
if parsing_attribute_name:
parsing_attribute_name = False
result.append(b''.join(current))
current = []
elif ch == b'=' and parsing_attribute_name:
current.append(ch)
value, index = parse_argument_value(line, start_index=index, must_match_everything=False)
current.append(to_bytes(value))
parsing_attribute_name = False
result.append(b''.join(current))
current = []
elif ch in (b'"', b'\\', b"'", b'=', b'(', b')', b'$', b'[', b'{', b'`', b'?'):
raise ParseError('Found unexpected "{0}"'.format(to_native(ch)))
else:
current.append(ch)
parsing_attribute_name = True
if parsing_attribute_name and current:
result.append(b''.join(current))
return [to_native(part) for part in result]
def quote_routeros_argument_value(argument):
argument = to_bytes(argument)
result = []
quote = False
length = len(argument)
index = 0
while index < length:
letter = argument[index:index + 1]
index += 1
if letter in ESCAPE_SEQUENCE_REVERSED:
result.append(b'\\%s' % ESCAPE_SEQUENCE_REVERSED[letter])
quote = True
continue
elif ord(letter) < 32:
v = ord(letter)
v1 = v % 16
v2 = v // 16
result.append(b'\\%s%s' % (ESCAPE_DIGITS[v2:v2 + 1], ESCAPE_DIGITS[v1:v1 + 1]))
quote = True
continue
elif letter in (b' ', b'=', b';', b"'"):
quote = True
result.append(letter)
argument = to_native(b''.join(result))
if quote or not argument:
argument = '"%s"' % argument
return argument
def quote_routeros_argument(argument):
def check_attribute(attribute):
if ' ' in attribute:
raise ParseError('Attribute names must not contain spaces')
return attribute
if '=' not in argument:
check_attribute(argument)
return argument
attribute, value = argument.split('=', 1)
check_attribute(attribute)
value = quote_routeros_argument_value(value)
return '%s=%s' % (attribute, value)
def join_routeros_command(arguments):
return ' '.join([quote_routeros_argument(argument) for argument in arguments])
def convert_list_to_dictionary(string_list, require_assignment=True, skip_empty_values=False):
dictionary = {}
for p in string_list:
if '=' not in p:
if require_assignment:
raise ParseError("missing '=' after '%s'" % p)
dictionary[p] = None
continue
p = p.split('=', 1)
if not skip_empty_values or p[1]:
dictionary[p[0]] = p[1]
return dictionary

View file

@ -1,38 +1,15 @@
# This code is part of Ansible, but is an independent component.
# This particular file snippet, and this file snippet only, is BSD licensed.
# Modules you write using this snippet, which is embedded dynamically by Ansible
# still belong to the author of the module, and may assign their own license
# to the complete work.
#
# (c) 2016 Red Hat Inc.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
# IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Copyright (c) 2016 Red Hat Inc.
# Simplified BSD License (see LICENSES/BSD-2-Clause.txt or https://opensource.org/licenses/BSD-2-Clause)
# SPDX-License-Identifier: BSD-2-Clause
from __future__ import absolute_import, division, print_function
__metaclass__ = type
import json
from ansible.module_utils._text import to_native
from ansible.module_utils.common.text.converters import to_native
from ansible.module_utils.basic import env_fallback
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import to_list, ComplexList
from ansible_collections.community.routeros.plugins.module_utils.version import LooseVersion
from ansible.module_utils.connection import Connection, ConnectionError
_DEVICE_CONFIGS = {}
@ -127,6 +104,16 @@ def to_commands(module, commands):
return transform(commands)
def should_add_leading_space(module):
"""Determines whether adding a leading space to the command is needed
to workaround prompt bug in 6.49 <= ROS < 7.2"""
capabilities = get_capabilities(module)
network_os_version = capabilities.get('device_info', {}).get('network_os_version')
if network_os_version is None:
return False
return LooseVersion('6.49') <= LooseVersion(network_os_version) < LooseVersion('7.2')
def run_commands(module, commands, check_rc=True):
responses = list()
connection = get_connection(module)
@ -141,6 +128,9 @@ def run_commands(module, commands, check_rc=True):
prompt = None
answer = None
if should_add_leading_space(module):
command = " " + command
try:
out = connection.get(command, prompt, answer)
except ConnectionError as exc:

View file

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Felix Fontein <felix@fontein.de>
# 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
"""Provide version object to compare version numbers."""
from __future__ import absolute_import, division, print_function
__metaclass__ = type
from ansible.module_utils.compat.version import LooseVersion # pylint: disable=unused-import

View file

@ -1,282 +1,347 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2020, Nikolay Dachev <nikolay@dachev.info>
# Copyright (c) 2020, Nikolay Dachev <nikolay@dachev.info>
# GNU General Public License v3.0+ 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
DOCUMENTATION = '''
---
DOCUMENTATION = r"""
module: api
author: "Nikolay Dachev (@NikolayDachev)"
short_description: Ansible module for RouterOS API
description:
- Ansible module for RouterOS API with python librouteros.
- This module can add, remove, update, query and execute arbitrary command in routeros via API.
- Ansible module for RouterOS API with the Python C(librouteros) library.
- This module can add, remove, update, query, and execute arbitrary command in RouterOS through the API.
notes:
- I(add), I(remove), I(update), I(cmd) and I(query) are mutually exclusive.
- I(check_mode) is not supported.
requirements:
- librouteros
- Python >= 3.6 (for librouteros)
- 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.
extends_documentation_fragment:
- community.routeros.api
- community.routeros.attributes
- community.routeros.attributes.actiongroup_api
attributes:
check_mode:
support: none
diff_mode:
support: none
platform:
support: full
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:
hostname:
description:
- RouterOS hostname API.
required: true
type: str
username:
description:
- RouterOS login user.
required: true
type: str
password:
description:
- RouterOS user password.
required: true
type: str
ssl:
description:
- If is set TLS will be used for RouterOS API connection.
required: false
type: bool
port:
description:
- RouterOS api port. If ssl is set, port will apply to ssl connection.
- Defaults are C(8728) for the HTTP API, and C(8729) for the HTTPS API.
type: int
path:
description:
- Main path for all other arguments.
- If other arguments are not set, api will return all items in selected path.
- Example C(ip address). Equivalent of RouterOS CLI C(/ip address print).
- 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
add:
description:
- Will add selected arguments in selected path to RouterOS config.
- Example C(address=1.1.1.1/32 interface=ether1).
- Example V(address=1.1.1.1/32 interface=ether1).
- Equivalent in RouterOS CLI C(/ip address add address=1.1.1.1/32 interface=ether1).
type: str
remove:
description:
- Remove config/value from RouterOS by '.id'.
- Example C(*03) will remove config/value with C(id=*03) in selected path.
- Example V(*03) will remove config/value with C(id=*03) in selected path.
- Equivalent in RouterOS CLI C(/ip address remove numbers=1).
- Note C(number) in RouterOS CLI is different from C(.id).
type: str
update:
description:
- Update config/value in RouterOS by '.id' in selected path.
- Example C(.id=*03 address=1.1.1.3/32) and path C(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
query:
description:
- Query given path for selected query attributes from RouterOS aip and return '.id'.
- 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 C(==), C(!=), C(>), C(<).
- Example path C(ip address) and query C(.id address) will return only C(.id) and C(address) for all items in C(ip address) path.
- Example path C(ip address) and query C(.id address WHERE address == 1.1.1.3/32).
will return only C(.id) and C(address) for items in C(ip address) path, where address is eq to 1.1.1.3/32.
- Example path C(interface) and query C(mtu name WHERE mut > 1400) will
return only interfaces C(mtu,name) where mtu is bigger than 1400.
- 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.
- Equivalent in RouterOS CLI C(/interface print where mtu > 1400).
type: str
extended_query:
description:
- Extended query given path for selected query attributes from RouterOS API.
- Extended query allow conjunctive input. If there is no matching entry, an empty list will be returned.
type: dict
suboptions:
attributes:
description:
- The list of attributes to return.
- Every attribute used in a O(extended_query.where[]) clause need to be listed here.
type: list
elements: str
required: true
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.
type: list
elements: dict
suboptions:
attribute:
description:
- The attribute to match. Must be part of O(extended_query.attributes).
- 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
is:
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.
- 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
choices: ["==", "!=", ">", "<", "in", "eq", "not", "more", "less"]
value:
description:
- The value to compare to. Must be a list for O(extended_query.where[].is=in).
- 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: raw
or:
description:
- A list of conditions so that at least one of them has to match.
- 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: list
elements: dict
suboptions:
attribute:
description:
- The attribute to match. Must be part of O(extended_query.attributes).
type: str
required: true
is:
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.
type: str
choices: ["==", "!=", ">", "<", "in", "eq", "not", "more", "less"]
required: true
value:
description:
- The value to compare to. Must be a list for O(extended_query.where[].or[].is=in).
type: raw
required: true
cmd:
description:
- Execute any/arbitrary command in selected path, after the command we can add C(.id).
- Example path C(system script) and cmd C(run .id=*03) is equivalent in RouterOS CLI C(/system script run number=0).
- Example path C(ip address) and cmd C(print) is equivalent in RouterOS CLI C(/ip address print).
- Example path V(system script) and cmd V(run .id=*03) is equivalent in RouterOS CLI C(/system script run number=0).
- Example path V(ip address) and cmd V(print) is equivalent in RouterOS CLI C(/ip address print).
type: str
'''
seealso:
- ref: ansible_collections.community.routeros.docsite.quoting
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: Use RouterOS API
hosts: localhost
gather_facts: no
vars:
hostname: "ros_api_hostname/ip"
username: "admin"
password: "secret_password"
- name: Get example - ip address print
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "ip address"
register: ipaddrd_printout
nic: "ether2"
ip1: "1.1.1.1/32"
ip2: "2.2.2.2/32"
ip3: "3.3.3.3/32"
- name: Dump "Get example" output
ansible.builtin.debug:
msg: '{{ ipaddrd_printout }}'
tasks:
- name: Get "{{ path }} print"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "{{ path }}"
register: print_path
- name: Add example - ip address
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "ip address"
add: "address=192.168.255.10/24 interface=ether2"
- name: Dump "{{ path }} print" output
ansible.builtin.debug:
msg: '{{ print_path }}'
- name: Query example - ".id, address" in "ip address WHERE address == 192.168.255.10/24"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "ip address"
query: ".id address WHERE address == {{ ip2 }}"
register: queryout
- name: Add ip address "{{ ip1 }}" and "{{ ip2 }}"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "{{ path }}"
add: "{{ item }}"
loop:
- "address={{ ip1 }} interface={{ nic }}"
- "address={{ ip2 }} interface={{ nic }}"
register: addout
- name: Dump "Query example" output
ansible.builtin.debug:
msg: '{{ queryout }}'
- name: Dump "Add ip address" output - ".id" for new added items
ansible.builtin.debug:
msg: '{{ addout }}'
- name: Extended query example - ".id,address,network" where address is not 192.168.255.10/24 or is 10.20.36.20/24
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "ip address"
extended_query:
attributes:
- network
- address
- .id
where:
- attribute: "network"
is: "=="
value: "192.168.255.0"
- or:
- attribute: "address"
is: "!="
value: "192.168.255.10/24"
- attribute: "address"
is: "eq"
value: "10.20.36.20/24"
- attribute: "network"
is: "in"
value:
- "10.20.36.0"
- "192.168.255.0"
register: extended_queryout
- name: Query for ".id" in "{{ path }} WHERE address == {{ ip2 }}"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "{{ path }}"
query: ".id address WHERE address == {{ ip2 }}"
register: queryout
- name: Dump "Extended query example" output
ansible.builtin.debug:
msg: '{{ extended_queryout }}'
- name: Dump "Query for" output and set fact with ".id" for "{{ ip2 }}"
ansible.builtin.debug:
msg: '{{ queryout }}'
- name: Update example - ether2 ip address with ".id = *14"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
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 }}
- name: Store query_id for later usage
ansible.builtin.set_fact:
query_id: "{{ queryout['msg'][0]['.id'] }}"
- name: Remove example - ether2 ip 192.168.255.20/24 with ".id = *14"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "ip address"
remove: "*14"
- name: Update ".id = {{ query_id }}" taken with custom fact "fquery_id"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "{{ path }}"
update: ".id={{ query_id }} address={{ ip3 }}"
register: updateout
- name: Arbitrary command example "/system identity print"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "system identity"
cmd: "print"
register: arbitraryout
- name: Dump "Update" output
ansible.builtin.debug:
msg: '{{ updateout }}'
- name: Dump "Arbitrary command example" output
ansible.builtin.debug:
msg: '{{ arbitraryout }}'
"""
- name: Remove ips - stage 1 - query ".id" for "{{ ip2 }}" and "{{ ip3 }}"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "{{ path }}"
query: ".id address WHERE address == {{ item }}"
register: id_to_remove
loop:
- "{{ ip2 }}"
- "{{ ip3 }}"
- name: Set fact for ".id" from "Remove ips - stage 1 - query"
ansible.builtin.set_fact:
to_be_remove: "{{ to_be_remove |default([]) + [item['msg'][0]['.id']] }}"
loop: "{{ id_to_remove.results }}"
- name: Dump "Remove ips - stage 1 - query" output
ansible.builtin.debug:
msg: '{{ to_be_remove }}'
# Remove "{{ rmips }}" with ".id" by "to_be_remove" from query
- name: Remove ips - stage 2 - remove "{{ ip2 }}" and "{{ ip3 }}" by '.id'
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "{{ path }}"
remove: "{{ item }}"
register: remove
loop: "{{ to_be_remove }}"
- name: Dump "Remove ips - stage 2 - remove" output
ansible.builtin.debug:
msg: '{{ remove }}'
- name: Arbitrary command example "/system identity print"
community.routeros.api:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: "system identity"
cmd: "print"
register: cmdout
- name: Dump "Arbitrary command example" output
ansible.builtin.debug:
msg: "{{ cmdout }}"
'''
RETURN = '''
---
RETURN = r"""
message:
description: All outputs are in list with dictionary elements returned from RouterOS api.
sample: C([{...},{...}])
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.basic import missing_required_lib
from ansible.module_utils._text import to_native
from ansible.module_utils.common.text.converters import to_native
import ssl
import traceback
from ansible_collections.community.routeros.plugins.module_utils.quoting import (
ParseError,
convert_list_to_dictionary,
parse_argument_value,
split_routeros_command,
)
from ansible_collections.community.routeros.plugins.module_utils.api import (
api_argument_spec,
check_has_library,
create_api,
)
import re
LIB_IMP_ERR = None
try:
from librouteros import connect
from librouteros.query import Key
HAS_LIB = True
except Exception as e:
HAS_LIB = False
LIB_IMP_ERR = traceback.format_exc()
from librouteros.exceptions import LibRouterosError
from librouteros.query import Key, Or
except Exception:
# Handled in api module_utils
pass
class ROS_api_module:
def __init__(self):
module_args = (dict(
username=dict(type='str', required=True),
password=dict(type='str', required=True, no_log=True),
hostname=dict(type='str', required=True),
port=dict(type='int'),
ssl=dict(type='bool', default=False),
module_args = dict(
path=dict(type='str', required=True),
add=dict(type='str'),
remove=dict(type='str'),
update=dict(type='str'),
cmd=dict(type='str'),
query=dict(type='str')))
query=dict(type='str'),
extended_query=dict(type='dict', options=dict(
attributes=dict(type='list', elements='str', required=True),
where=dict(
type='list',
elements='dict',
options={
'attribute': dict(type='str'),
'is': dict(type='str', choices=["==", "!=", ">", "<", "in", "eq", "not", "more", "less"]),
'value': dict(type='raw'),
'or': dict(type='list', elements='dict', options={
'attribute': dict(type='str', required=True),
'is': dict(type='str', choices=["==", "!=", ">", "<", "in", "eq", "not", "more", "less"], required=True),
'value': dict(type='raw', required=True),
}),
},
required_together=[('attribute', 'is', 'value')],
mutually_exclusive=[('attribute', 'or')],
required_one_of=[('attribute', 'or')],
),
)),
)
module_args.update(api_argument_spec())
self.module = AnsibleModule(argument_spec=module_args,
supports_check_mode=False,
mutually_exclusive=(('add', 'remove', 'update',
'cmd', 'query'),),)
'cmd', 'query', 'extended_query'),),)
if not HAS_LIB:
self.module.fail_json(msg=missing_required_lib("librouteros"),
exception=LIB_IMP_ERR)
check_has_library(self.module)
self.api = self.ros_api_connect(self.module.params['username'],
self.module.params['password'],
self.module.params['hostname'],
self.module.params['port'],
self.module.params['ssl'])
self.api = create_api(self.module)
self.path = self.list_remove_empty(self.module.params['path'].split(' '))
self.path = self.module.params['path'].split()
self.add = self.module.params['add']
self.remove = self.module.params['remove']
self.update = self.module.params['update']
@ -284,13 +349,7 @@ class ROS_api_module:
self.where = None
self.query = self.module.params['query']
if self.query:
if 'WHERE' in self.query:
split = self.query.split('WHERE')
self.query = self.list_remove_empty(split[0].split(' '))
self.where = self.list_remove_empty(split[1].split(' '))
else:
self.query = self.list_remove_empty(self.module.params['query'].split(' '))
self.extended_query = self.module.params['extended_query']
self.result = dict(
message=[])
@ -298,36 +357,79 @@ class ROS_api_module:
# create api base path
self.api_path = self.api_add_path(self.api, self.path)
# api call's
if self.add:
self.api_add()
elif self.remove:
self.api_remove()
elif self.update:
self.api_update()
elif self.query:
self.api_query()
elif self.arbitrary:
self.api_arbitrary()
else:
self.api_get_all()
# api calls
try:
if self.add:
self.api_add()
elif self.remove:
self.api_remove()
elif self.update:
self.api_update()
elif self.query:
self.check_query()
self.api_query()
elif self.extended_query:
self.check_extended_query()
self.api_extended_query()
elif self.arbitrary:
self.api_arbitrary()
else:
self.api_get_all()
except UnicodeEncodeError as exc:
self.module.fail_json(msg='Error while encoding text: {error}'.format(error=exc))
def list_remove_empty(self, check_list):
while("" in check_list):
check_list.remove("")
return check_list
def check_query(self):
where_index = self.query.find(' WHERE ')
if where_index < 0:
self.query = self.split_params(self.query)
else:
where = self.query[where_index + len(' WHERE '):]
self.query = self.split_params(self.query[:where_index])
# where must be of the format '<attribute> <operator> <value>'
m = re.match(r'^\s*([^ ]+)\s+([^ ]+)\s+(.*)$', where)
if not m:
self.errors("invalid syntax for 'WHERE %s'" % where)
try:
self.where = [
m.group(1), # attribute
m.group(2), # operator
parse_argument_value(m.group(3).rstrip())[0], # value
]
except ParseError as exc:
self.errors("invalid syntax for 'WHERE %s': %s" % (where, exc))
try:
idx = self.query.index('WHERE')
self.where = self.query[idx + 1:]
self.query = self.query[:idx]
except ValueError:
# Raised when WHERE has not been found
pass
def check_extended_query_syntax(self, test_atr, or_msg=''):
if test_atr['is'] == "in" and not isinstance(test_atr['value'], list):
self.errors("invalid syntax 'extended_query':'where':%s%s 'value' must be a type list" % (or_msg, test_atr))
def check_extended_query(self):
if self.extended_query["where"]:
for i in self.extended_query['where']:
if i["or"] is not None:
if len(i['or']) < 2:
self.errors("invalid syntax 'extended_query':'where':'or':%s 'or' requires minimum two items" % i["or"])
for orv in i['or']:
self.check_extended_query_syntax(orv, ":'or':")
else:
self.check_extended_query_syntax(i)
def list_to_dic(self, ldict):
dict = {}
for p in ldict:
if '=' not in p:
self.errors("missing '=' after '%s'" % p)
p = p.split('=')
if p[0] == 'id':
self.errors("'%s' must be '.id'" % p[0])
if p[1]:
dict[p[0]] = p[1]
return dict
return convert_list_to_dictionary(ldict, skip_empty_values=True, require_assignment=True)
def split_params(self, params):
if not isinstance(params, str):
raise AssertionError('Parameters can only be a string, received %s' % type(params))
try:
return split_routeros_command(params)
except ParseError as e:
self.module.fail_json(msg=to_native(e))
def api_add_path(self, api, path):
api_path = api.path()
@ -340,16 +442,16 @@ class ROS_api_module:
for i in self.api_path:
self.result['message'].append(i)
self.return_result(False, True)
except Exception as e:
except LibRouterosError as e:
self.errors(e)
def api_add(self):
param = self.list_to_dic(self.add.split(' '))
param = self.list_to_dic(self.split_params(self.add))
try:
self.result['message'].append("added: .id= %s"
% self.api_path.add(**param))
self.return_result(True)
except Exception as e:
except LibRouterosError as e:
self.errors(e)
def api_remove(self):
@ -357,18 +459,18 @@ class ROS_api_module:
self.api_path.remove(self.remove)
self.result['message'].append("removed: .id= %s" % self.remove)
self.return_result(True)
except Exception as e:
except LibRouterosError as e:
self.errors(e)
def api_update(self):
param = self.list_to_dic(self.update.split(' '))
param = self.list_to_dic(self.split_params(self.update))
if '.id' not in param.keys():
self.errors("missing '.id' for %s" % param)
try:
self.api_path.update(**param)
self.result['message'].append("updated: %s" % param)
self.return_result(True)
except Exception as e:
except LibRouterosError as e:
self.errors(e)
def api_query(self):
@ -379,27 +481,21 @@ class ROS_api_module:
keys[k] = Key(k)
try:
if self.where:
if len(self.where) < 3:
self.errors("invalid syntax for 'WHERE %s'"
% ' '.join(self.where))
where = []
if self.where[1] == '==':
if self.where[1] in ('==', 'eq'):
select = self.api_path.select(*keys).where(keys[self.where[0]] == self.where[2])
elif self.where[1] == '!=':
elif self.where[1] in ('!=', 'not'):
select = self.api_path.select(*keys).where(keys[self.where[0]] != self.where[2])
elif self.where[1] == '>':
elif self.where[1] in ('>', 'more'):
select = self.api_path.select(*keys).where(keys[self.where[0]] > self.where[2])
elif self.where[1] == '<':
elif self.where[1] in ('<', 'less'):
select = self.api_path.select(*keys).where(keys[self.where[0]] < self.where[2])
else:
self.errors("'%s' is not operator for 'where'"
% self.where[1])
for row in select:
self.result['message'].append(row)
else:
for row in self.api_path.select(*keys):
self.result['message'].append(row)
select = self.api_path.select(*keys)
for row in select:
self.result['message'].append(row)
if len(self.result['message']) < 1:
msg = "no results for '%s 'query' %s" % (' '.join(self.path),
' '.join(self.query))
@ -407,12 +503,55 @@ class ROS_api_module:
msg = msg + ' WHERE %s' % ' '.join(self.where)
self.result['message'].append(msg)
self.return_result(False)
except Exception as e:
except LibRouterosError as e:
self.errors(e)
def build_api_extended_query(self, item):
if item['attribute'] not in self.extended_query['attributes']:
self.errors("'%s' attribute is not in attributes: %s"
% (item, self.extended_query['attributes']))
if item['is'] in ('eq', '=='):
return self.query_keys[item['attribute']] == item['value']
elif item['is'] in ('not', '!='):
return self.query_keys[item['attribute']] != item['value']
elif item['is'] in ('less', '<'):
return self.query_keys[item['attribute']] < item['value']
elif item['is'] in ('more', '>'):
return self.query_keys[item['attribute']] > item['value']
elif item['is'] == 'in':
return self.query_keys[item['attribute']].In(*item['value'])
else:
self.errors("'%s' is not operator for 'is'" % item['is'])
def api_extended_query(self):
self.query_keys = {}
for k in self.extended_query['attributes']:
if k == 'id':
self.errors("'extended_query':'attributes':'%s' must be '.id'" % k)
self.query_keys[k] = Key(k)
try:
if self.extended_query['where']:
where_args = []
for i in self.extended_query['where']:
if i['or']:
where_or_args = []
for ior in i['or']:
where_or_args.append(self.build_api_extended_query(ior))
where_args.append(Or(*where_or_args))
else:
where_args.append(self.build_api_extended_query(i))
select = self.api_path.select(*self.query_keys).where(*where_args)
else:
select = self.api_path.select(*self.extended_query['attributes'])
for row in select:
self.result['message'].append(row)
self.return_result(False)
except LibRouterosError as e:
self.errors(e)
def api_arbitrary(self):
param = {}
self.arbitrary = self.arbitrary.split(' ')
self.arbitrary = self.split_params(self.arbitrary)
arb_cmd = self.arbitrary[0]
if len(self.arbitrary) > 1:
param = self.list_to_dic(self.arbitrary[1:])
@ -421,12 +560,12 @@ class ROS_api_module:
for i in arbitrary_result:
self.result['message'].append(i)
self.return_result(False)
except Exception as e:
except LibRouterosError as e:
self.errors(e)
def return_result(self, ch_status=False, status=True):
if status == "False":
self.module.fail_json(msg=to_native(self.result['message']))
if not status:
self.module.fail_json(msg=self.result['message'])
else:
self.module.exit_json(changed=ch_status,
msg=self.result['message'])
@ -434,43 +573,10 @@ class ROS_api_module:
def errors(self, e):
if e.__class__.__name__ == 'TrapError':
self.result['message'].append("%s" % e)
self.return_result(False, True)
self.return_result(False, False)
self.result['message'].append("%s" % e)
self.return_result(False, False)
def ros_api_connect(self, username, password, host, port, use_ssl):
# connect to routeros api
conn_status = {"connection": {"username": username,
"hostname": host,
"port": port,
"ssl": use_ssl,
"status": "Connected"}}
try:
if use_ssl is True:
if not port:
port = 8729
conn_status["connection"]["port"] = port
ctx = ssl.create_default_context()
ctx.check_hostname = False
ctx.set_ciphers('ADH:@SECLEVEL=0')
api = connect(username=username,
password=password,
host=host,
ssl_wrapper=ctx.wrap_socket,
port=port)
else:
if not port:
port = 8728
conn_status["connection"]["port"] = port
api = connect(username=username,
password=password,
host=host,
port=port)
except Exception as e:
conn_status["connection"]["status"] = "error: %s" % e
self.module.fail_json(msg=to_native([conn_status]))
return api
def main():

View file

@ -0,0 +1,492 @@
#!/usr/bin/python
# Copyright (c) 2022, Felix Fontein <felix@fontein.de>
# Copyright (c) 2020, Nikolay Dachev <nikolay@dachev.info>
# Copyright (c) 2018, Egor Zaitsev (@heuels)
# 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
DOCUMENTATION = r"""
module: api_facts
author:
- "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_<fact>). 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.
extends_documentation_fragment:
- community.routeros.api
- community.routeros.attributes
- 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
platforms: RouterOS
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.
required: false
default:
- all
type: list
elements: str
seealso:
- module: community.routeros.facts
- module: community.routeros.api
- module: community.routeros.api_find_and_modify
- module: community.routeros.api_info
- module: community.routeros.api_modify
"""
EXAMPLES = r"""
---
- name: Collect all facts from the device
community.routeros.api_facts:
hostname: 192.168.88.1
username: admin
password: password
gather_subset: all
- name: Do not collect hardware facts
community.routeros.api_facts:
hostname: 192.168.88.1
username: admin
password: password
gather_subset:
- "!hardware"
"""
RETURN = r"""
ansible_facts:
description: "Dictionary of IP geolocation facts for a host's IP address."
returned: always
type: dict
contains:
ansible_net_gather_subset:
description: The list of fact subsets collected from the device.
returned: always
type: list
# default
ansible_net_model:
description: The model name returned from the device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_serialnum:
description: The serial number of the remote device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_version:
description: The operating system version running on the remote device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_hostname:
description: The configured hostname of the device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_arch:
description: The CPU architecture of the device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_uptime:
description: The uptime of the device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_cpu_load:
description: Current CPU load.
returned: O(gather_subset) contains V(default)
type: str
# hardware
ansible_net_spacefree_mb:
description: The available disk space on the remote device in MiB.
returned: O(gather_subset) contains V(hardware)
type: dict
ansible_net_spacetotal_mb:
description: The total disk space on the remote device in MiB.
returned: O(gather_subset) contains V(hardware)
type: dict
ansible_net_memfree_mb:
description: The available free memory on the remote device in MiB.
returned: O(gather_subset) contains V(hardware)
type: int
ansible_net_memtotal_mb:
description: The total memory on the remote device in MiB.
returned: O(gather_subset) contains V(hardware)
type: int
# interfaces
ansible_net_all_ipv4_addresses:
description: All IPv4 addresses configured on the device.
returned: O(gather_subset) contains V(interfaces)
type: list
ansible_net_all_ipv6_addresses:
description: All IPv6 addresses configured on the device.
returned: O(gather_subset) contains V(interfaces)
type: list
ansible_net_interfaces:
description: A hash of all interfaces running on the system.
returned: O(gather_subset) contains V(interfaces)
type: dict
ansible_net_neighbors:
description: The list of neighbors from the remote device.
returned: O(gather_subset) contains V(interfaces)
type: dict
# routing
ansible_net_bgp_peer:
description: A dictionary with BGP peer information.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_bgp_vpnv4_route:
description: A dictionary with BGP vpnv4 route information.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_bgp_instance:
description: A dictionary with BGP instance information.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_route:
description: A dictionary for routes in all routing tables.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_ospf_instance:
description: A dictionary with OSPF instances.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_ospf_neighbor:
description: A dictionary with OSPF neighbors.
returned: O(gather_subset) contains V(routing)
type: dict
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.six import iteritems
from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.routeros.plugins.module_utils.api import (
api_argument_spec,
check_has_library,
create_api,
)
try:
from librouteros.exceptions import LibRouterosError
except Exception:
# Handled in api module_utils
pass
class FactsBase(object):
COMMANDS = []
def __init__(self, module, api):
self.module = module
self.api = api
self.facts = {}
self.responses = None
def populate(self):
self.responses = []
for path in self.COMMANDS:
self.responses.append(self.query_path(path))
def query_path(self, path):
api_path = self.api.path()
for part in path:
api_path = api_path.join(part)
try:
return list(api_path)
except LibRouterosError as e:
self.module.warn('Error while querying path {path}: {error}'.format(
path=' '.join(path),
error=to_native(e),
))
return []
class Default(FactsBase):
COMMANDS = [
['system', 'identity'],
['system', 'resource'],
['system', 'routerboard'],
]
def populate(self):
super(Default, self).populate()
data = self.responses[0]
if data:
self.facts['hostname'] = data[0].get('name')
data = self.responses[1]
if data:
self.facts['version'] = data[0].get('version')
self.facts['arch'] = data[0].get('architecture-name')
self.facts['uptime'] = data[0].get('uptime')
self.facts['cpu_load'] = data[0].get('cpu-load')
data = self.responses[2]
if data:
self.facts['model'] = data[0].get('model')
self.facts['serialnum'] = data[0].get('serial-number')
class Hardware(FactsBase):
COMMANDS = [
['system', 'resource'],
]
def populate(self):
super(Hardware, self).populate()
data = self.responses[0]
if data:
self.parse_filesystem_info(data[0])
self.parse_memory_info(data[0])
def parse_filesystem_info(self, data):
self.facts['spacefree_mb'] = self.to_megabytes(data.get('free-hdd-space'))
self.facts['spacetotal_mb'] = self.to_megabytes(data.get('total-hdd-space'))
def parse_memory_info(self, data):
self.facts['memfree_mb'] = self.to_megabytes(data.get('free-memory'))
self.facts['memtotal_mb'] = self.to_megabytes(data.get('total-memory'))
def to_megabytes(self, value):
if value is None:
return None
return float(value) / 1024 / 1024
class Interfaces(FactsBase):
COMMANDS = [
['interface'],
['ip', 'address'],
['ipv6', 'address'],
['ip', 'neighbor'],
]
def populate(self):
super(Interfaces, self).populate()
self.facts['interfaces'] = {}
self.facts['all_ipv4_addresses'] = []
self.facts['all_ipv6_addresses'] = []
self.facts['neighbors'] = []
data = self.responses[0]
if data:
interfaces = self.parse_interfaces(data)
self.populate_interfaces(interfaces)
data = self.responses[1]
if data:
data = self.parse_detail(data)
self.populate_addresses(data, 'ipv4')
data = self.responses[2]
if data:
data = self.parse_detail(data)
self.populate_addresses(data, 'ipv6')
data = self.responses[3]
if data:
self.facts['neighbors'] = list(self.parse_detail(data))
def populate_interfaces(self, data):
for key, value in iteritems(data):
self.facts['interfaces'][key] = value
def populate_addresses(self, data, family):
for value in data:
key = value['interface']
iface = self.facts['interfaces'].setdefault(key, (
{"type": "ansible:unknown"} if key.startswith('*') else
{"type": "ansible:mismatch"}))
iface_addrs = iface.setdefault(family, [])
addr, subnet = value['address'].split('/')
subnet = subnet.strip()
# Try to convert subnet to an integer
try:
subnet = int(subnet)
except Exception:
pass
ip = dict(address=addr.strip(), subnet=subnet)
self.add_ip_address(addr.strip(), family)
iface_addrs.append(ip)
def add_ip_address(self, address, family):
if family == 'ipv4':
self.facts['all_ipv4_addresses'].append(address)
else:
self.facts['all_ipv6_addresses'].append(address)
def parse_interfaces(self, data):
facts = {}
for entry in data:
if 'name' not in entry:
continue
entry.pop('.id', None)
facts[entry['name']] = entry
return facts
def parse_detail(self, data):
for entry in data:
if 'interface' not in entry:
continue
entry.pop('.id', None)
yield entry
class Routing(FactsBase):
COMMANDS = [
['routing', 'bgp', 'peer'],
['routing', 'bgp', 'vpnv4-route'],
['routing', 'bgp', 'instance'],
['ip', 'route'],
['routing', 'ospf', 'instance'],
['routing', 'ospf', 'neighbor'],
]
def populate(self):
super(Routing, self).populate()
self.facts['bgp_peer'] = {}
self.facts['bgp_vpnv4_route'] = {}
self.facts['bgp_instance'] = {}
self.facts['route'] = {}
self.facts['ospf_instance'] = {}
self.facts['ospf_neighbor'] = {}
data = self.responses[0]
if data:
peer = self.parse(data, 'name')
self.populate_result('bgp_peer', peer)
data = self.responses[1]
if data:
vpnv4 = self.parse(data, 'interface')
self.populate_result('bgp_vpnv4_route', vpnv4)
data = self.responses[2]
if data:
instance = self.parse(data, 'name')
self.populate_result('bgp_instance', instance)
data = self.responses[3]
if data:
route = self.parse(data, 'routing-mark', fallback='main')
self.populate_result('route', route)
data = self.responses[4]
if data:
instance = self.parse(data, 'name')
self.populate_result('ospf_instance', instance)
data = self.responses[5]
if data:
instance = self.parse(data, 'instance')
self.populate_result('ospf_neighbor', instance)
def parse(self, data, key, fallback=None):
facts = {}
for line in data:
name = line.get(key) or fallback
line.pop('.id', None)
facts[name] = line
return facts
def populate_result(self, name, data):
for key, value in iteritems(data):
self.facts[name][key] = value
FACT_SUBSETS = dict(
default=Default,
hardware=Hardware,
interfaces=Interfaces,
routing=Routing,
)
VALID_SUBSETS = frozenset(FACT_SUBSETS.keys())
def main():
argument_spec = dict(
gather_subset=dict(
default=['all'],
type='list',
elements='str',
)
)
argument_spec.update(api_argument_spec())
module = AnsibleModule(argument_spec=argument_spec, supports_check_mode=True)
check_has_library(module)
api = create_api(module)
gather_subset = module.params['gather_subset']
runable_subsets = set()
exclude_subsets = set()
for subset in gather_subset:
if subset == 'all':
runable_subsets.update(VALID_SUBSETS)
continue
if subset.startswith('!'):
subset = subset[1:]
if subset == 'all':
exclude_subsets.update(VALID_SUBSETS)
continue
exclude = True
else:
exclude = False
if subset not in VALID_SUBSETS:
module.fail_json(msg='Bad subset: %s' % subset)
if exclude:
exclude_subsets.add(subset)
else:
runable_subsets.add(subset)
if not runable_subsets:
runable_subsets.update(VALID_SUBSETS)
runable_subsets.difference_update(exclude_subsets)
runable_subsets.add('default')
facts = {}
facts['gather_subset'] = sorted(runable_subsets)
instances = []
for key in runable_subsets:
instances.append(FACT_SUBSETS[key](module, api))
for inst in instances:
inst.populate()
facts.update(inst.facts)
ansible_facts = {}
for key, value in iteritems(facts):
key = 'ansible_net_%s' % key
ansible_facts[key] = value
module.exit_json(ansible_facts=ansible_facts)
if __name__ == '__main__':
main()

View file

@ -0,0 +1,367 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2022, Felix Fontein <felix@fontein.de>
# GNU General Public License v3.0+ 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
DOCUMENTATION = r"""
module: api_find_and_modify
author:
- "Felix Fontein (@felixfontein)"
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.
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."
extends_documentation_fragment:
- community.routeros.api
- community.routeros.attributes
- community.routeros.attributes.actiongroup_api
attributes:
check_mode:
support: full
diff_mode:
support: full
platform:
support: full
platforms: RouterOS
idempotent:
support: full
options:
path:
description:
- Path to query.
- An example value is V(ip address). This is equivalent to running C(/ip address) in the RouterOS CLI.
required: true
type: str
find:
description:
- Fields to search for.
- The module will only consider entries in the given O(path) that match all fields provided here.
- Use YAML V(~), or prepend keys with V(!), to specify an unset value.
- Note that if the dictionary specified here is empty, every entry in the path will be matched.
required: true
type: dict
values:
description:
- On all entries matching the conditions in O(find), set the keys of this option to the values specified here.
- Use YAML V(~), or prepend keys with V(!), to specify to unset a value.
required: true
type: dict
require_matches_min:
description:
- Make sure that there are no less matches than this number.
- If there are less matches, fail instead of modifying anything.
type: int
default: 0
require_matches_max:
description:
- Make sure that there are no more matches than this number.
- If there are more matches, fail instead of modifying anything.
- If not specified, there is no upper limit.
type: int
allow_no_matches:
description:
- 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
- module: community.routeros.api_modify
- module: community.routeros.api_info
"""
EXAMPLES = r"""
---
- name: Rename bridge from 'bridge' to 'my-bridge'
community.routeros.api_find_and_modify:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: interface bridge
find:
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:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: ip address
find:
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.
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"""
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
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
match_count:
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
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.routeros.plugins.module_utils.api import (
api_argument_spec,
check_has_library,
create_api,
)
from ansible_collections.community.routeros.plugins.module_utils._api_data import (
split_path,
)
try:
from librouteros.exceptions import LibRouterosError
except Exception:
# Handled in api module_utils
pass
def compose_api_path(api, path):
api_path = api.path()
for p in path:
api_path = api_path.join(p)
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', )
def main():
module_args = dict(
path=dict(type='str', required=True),
find=dict(type='dict', required=True),
values=dict(type='dict', required=True),
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())
module = AnsibleModule(
argument_spec=module_args,
supports_check_mode=True,
)
if module.params['allow_no_matches'] is None:
module.params['allow_no_matches'] = module.params['require_matches_min'] <= 0
find = module.params['find']
for key, value in sorted(find.items()):
if key.startswith('!'):
key = key[1:]
if value not in (None, ''):
module.fail_json(msg='The value for "!{key}" in `find` must not be non-trivial!'.format(key=key))
if key in find:
module.fail_json(msg='`find` must not contain both "{key}" and "!{key}"!'.format(key=key))
values = module.params['values']
for key, value in sorted(values.items()):
if key.startswith('!'):
key = key[1:]
if value not in (None, ''):
module.fail_json(msg='The value for "!{key}" in `values` must not be non-trivial!'.format(key=key))
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)
path = split_path(module.params['path'])
api_path = compose_api_path(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
matching_entries = []
for index, entry in enumerate(new_data):
matches = True
for key, value in find.items():
if key.startswith('!'):
# Allow to specify keys that should not be present by prepending '!'
key = key[1:]
value = None
current_value = entry.get(key)
if key in DISABLED_MEANS_EMPTY_STRING and value == '' and current_value is None:
current_value = value
if current_value != value:
matches = False
break
if matches:
matching_entries.append((index, entry))
# Check whether the correct amount of entries was found
if matching_entries:
if len(matching_entries) < module.params['require_matches_min']:
module.fail_json(msg='Found %d entries, but expected at least %d' % (len(matching_entries), module.params['require_matches_min']))
if module.params['require_matches_max'] is not None and len(matching_entries) > module.params['require_matches_max']:
module.fail_json(msg='Found %d entries, but expected at most %d' % (len(matching_entries), module.params['require_matches_max']))
elif not module.params['allow_no_matches']:
module.fail_json(msg='Found no entries, but allow_no_matches=false')
# Identify entries to update
modifications = []
for index, entry in matching_entries:
modification = {}
for key, value in values.items():
if key.startswith('!'):
# Allow to specify keys to remove by prepending '!'
key = key[1:]
value = None
current_value = entry.get(key)
if key in DISABLED_MEANS_EMPTY_STRING and value == '' and current_value is None:
current_value = value
if current_value != value:
if value is None:
disable_key = '!%s' % key
if key in DISABLED_MEANS_EMPTY_STRING:
disable_key = key
modification[disable_key] = ''
entry.pop(key, None)
else:
modification[key] = value
entry[key] = value
if modification:
if '.id' in entry:
modification['.id'] = entry['.id']
modifications.append(modification)
# Apply changes
if not module.check_mode and modifications:
for modification in modifications:
try:
api_path.update(**modification)
except (LibRouterosError, UnicodeEncodeError) as e:
module.fail_json(
msg='Error while modifying for .id={id}: {error}'.format(
id=modification['.id'],
error=to_native(e),
)
)
new_data = filter_entries(list(api_path), ignore_dynamic=ignore_dynamic, ignore_builtin=ignore_builtin)
# Produce return value
more = {}
if module._diff:
# Only include the matching values
more['diff'] = {
'before': {
'values': [old_data[index] for index, entry in matching_entries],
},
'after': {
'values': [entry for index, entry in matching_entries],
},
}
module.exit_json(
changed=bool(modifications),
old_data=old_data,
new_data=new_data,
match_count=len(matching_entries),
modify_count=len(modifications),
**more
)
if __name__ == '__main__':
main()

500
plugins/modules/api_info.py Normal file
View file

@ -0,0 +1,500 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2022, Felix Fontein (@felixfontein) <felix@fontein.de>
# 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
DOCUMENTATION = r"""
module: api_info
author:
- "Felix Fontein (@felixfontein)"
short_description: Retrieve information from API
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/).
extends_documentation_fragment:
- community.routeros.api
- 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:
support: full
platforms: RouterOS
options:
path:
description:
- Path to query.
- An example value is V(ip address). This is equivalent to running C(/ip address print) 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 6to4
- 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 ethernet switch port-isolation
- 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 access-list
- interface wireless align
- interface wireless cap
- interface wireless connect-list
- 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 forwarders
- 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 mode-config
- 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 bfd configuration
- 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:
- Whether to output all fields, and not just the ones supported as input for M(community.routeros.api_modify).
- Unfiltered output can contain counters and other state information.
type: bool
default: false
handle_disabled:
description:
- How to handle unset values.
- V(exclamation) prepends the keys with V(!) in the output with value V(null).
- V(null-value) uses the regular key with value V(null).
- V(omit) omits these values from the result.
type: str
choices:
- exclamation
- null-value
- omit
default: exclamation
hide_defaults:
description:
- Whether to hide default values.
type: bool
default: true
include_dynamic:
description:
- Whether to include dynamic values.
- By default, they are not returned, and the C(dynamic) keys are omitted.
- If set to V(true), they are returned as well, and the C(dynamic) keys are returned as well.
type: bool
default: false
include_builtin:
description:
- Whether to include builtin values.
- By default, they are not returned, and the C(builtin) keys are omitted.
- If set to V(true), they are returned as well, and the C(builtin) keys are returned as well.
type: bool
default: false
version_added: 2.4.0
include_read_only:
description:
- Whether to include read-only fields.
- By default, they are not returned.
type: bool
default: false
version_added: 2.10.0
restrict:
description:
- Restrict output to entries matching the following criteria.
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_modify
"""
EXAMPLES = r"""
---
- name: Get IP addresses
community.routeros.api_info:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: ip address
register: ip_addresses
- name: Print data for IP addresses
ansible.builtin.debug:
var: ip_addresses.result
- name: Get IP addresses
community.routeros.api_info:
hostname: "{{ hostname }}"
password: "{{ password }}"
username: "{{ username }}"
path: ip address
register: ip_addresses
- name: Print data for IP addresses
ansible.builtin.debug:
var: ip_addresses.result
"""
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
"""
from ansible.module_utils.basic import AnsibleModule
from ansible.module_utils.common.text.converters import to_native
from ansible_collections.community.routeros.plugins.module_utils.api import (
api_argument_spec,
check_has_library,
create_api,
get_api_version,
)
from ansible_collections.community.routeros.plugins.module_utils._api_data import (
PATHS,
join_path,
split_path,
)
from ansible_collections.community.routeros.plugins.module_utils._api_helper import (
restrict_argument_spec,
restrict_entry_accepted,
validate_and_prepare_restrict,
)
try:
from librouteros.exceptions import LibRouterosError
except Exception:
# Handled in api module_utils
pass
def compose_api_path(api, path):
api_path = api.path()
for p in path:
api_path = api_path.join(p)
return api_path
def main():
module_args = dict(
path=dict(type='str', required=True, choices=sorted([join_path(path) for path in PATHS if PATHS[path].fully_understood])),
unfiltered=dict(type='bool', default=False),
handle_disabled=dict(type='str', choices=['exclamation', 'null-value', 'omit'], default='exclamation'),
hide_defaults=dict(type='bool', default=True),
include_dynamic=dict(type='bool', default=False),
include_builtin=dict(type='bool', default=False),
include_read_only=dict(type='bool', default=False),
)
module_args.update(api_argument_spec())
module_args.update(restrict_argument_spec())
module = AnsibleModule(
argument_spec=module_args,
supports_check_mode=True,
)
check_has_library(module)
api = create_api(module)
path = split_path(module.params['path'])
versioned_path_info = PATHS.get(tuple(path))
if versioned_path_info is None:
module.fail_json(msg='Path /{path} is not yet supported'.format(path='/'.join(path)))
if versioned_path_info.needs_version:
api_version = get_api_version(api)
supported, not_supported_msg = versioned_path_info.provide_version(api_version)
if not supported:
msg = 'Path /{path} is not supported for API version {api_version}'.format(path='/'.join(path), api_version=api_version)
if not_supported_msg:
msg = '{0}: {1}'.format(msg, not_supported_msg)
module.fail_json(msg=msg)
path_info = versioned_path_info.get_data()
handle_disabled = module.params['handle_disabled']
hide_defaults = module.params['hide_defaults']
include_dynamic = module.params['include_dynamic']
include_builtin = module.params['include_builtin']
include_read_only = module.params['include_read_only']
restrict_data = validate_and_prepare_restrict(module, path_info)
try:
api_path = compose_api_path(api, path)
result = []
unfiltered = module.params['unfiltered']
for entry in api_path:
if not include_dynamic:
if entry.get('dynamic', False):
continue
if not include_builtin:
if entry.get('builtin', False):
continue
if not restrict_entry_accepted(entry, path_info, restrict_data):
continue
if not unfiltered:
for k in list(entry):
if k == '.id':
continue
if k == 'dynamic' and include_dynamic:
continue
if k == 'builtin' and include_builtin:
continue
if k not in path_info.fields:
entry.pop(k)
if handle_disabled != 'omit':
for k, field_info in path_info.fields.items():
if field_info.write_only:
entry.pop(k, None)
continue
if k not in entry:
if handle_disabled == 'exclamation':
k = '!%s' % k
entry[k] = None
for k, field_info in path_info.fields.items():
if hide_defaults:
if field_info.default is not None and entry.get(k) == field_info.default:
entry.pop(k)
if field_info.absent_value and k not in entry:
entry[k] = field_info.absent_value
if not include_read_only and k in entry and field_info.read_only:
entry.pop(k)
result.append(entry)
module.exit_json(result=result)
except (LibRouterosError, UnicodeEncodeError) as e:
module.fail_json(msg=to_native(e))
if __name__ == '__main__':
main()

File diff suppressed because it is too large Load diff

View file

@ -1,63 +1,83 @@
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# 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
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.
- 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.
diff_mode:
support: none
platform:
support: full
platforms: RouterOS
idempotent:
support: N/A
details:
- Whether the executed command is idempotent depends on the command.
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 I(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 I(match) argument is used in conjunction with the
I(wait_for) argument to specify the match policy. Valid
values are C(all) or C(any). If the value is set to C(all)
then all conditionals in the wait_for must be satisfied. If
the value is set to C(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
I(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.
- ref: ansible_collections.community.routeros.docsite.quoting
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
@ -83,31 +103,29 @@ 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: ['...', '...']
"""
import re
import time
from ansible_collections.community.routeros.plugins.module_utils.routeros import run_commands
from ansible_collections.community.routeros.plugins.module_utils.routeros import routeros_argument_spec
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.utils import ComplexList
from ansible_collections.ansible.netcommon.plugins.module_utils.network.common.parsing import Conditional
from ansible.module_utils.six import string_types
@ -123,10 +141,10 @@ def main():
"""main entry point for module execution
"""
argument_spec = dict(
commands=dict(type='list', required=True),
commands=dict(type='list', elements='str', required=True),
wait_for=dict(type='list'),
match=dict(default='all', choices=['all', 'any']),
wait_for=dict(type='list', elements='str'),
match=dict(type='str', default='all', choices=['all', 'any']),
retries=dict(default=10, type='int'),
interval=dict(default=1, type='int')
@ -135,7 +153,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}
@ -168,7 +186,7 @@ def main():
module.fail_json(msg=msg, failed_conditions=failed_conditions)
result.update({
'changed': False,
'changed': True,
'stdout': responses,
'stdout_lines': list(to_lines(responses))
})

View file

@ -1,35 +1,48 @@
#!/usr/bin/python
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# 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
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 RotuerOS. This module prepends all of the
base network fact keys with C(ansible_net_<fact>). 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_<fact>). 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
- community.routeros.attributes.facts
- community.routeros.attributes.facts_module
- community.routeros.attributes.idempotent_not_modify_state
attributes:
platform:
support: full
platforms: RouterOS
options:
gather_subset:
description:
- When supplied, this argument will restrict the facts collected
to a given subset. Possible values for this argument include
C(all), C(hardware), C(config), and C(interfaces). Can specify a list of
values to include a larger subset. Values can also be used
with an initial C(!) 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'
'''
default:
- '!config'
type: list
elements: str
seealso:
- ref: ansible_collections.community.routeros.docsite.ssh-guide
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
@ -45,113 +58,123 @@ EXAMPLES = """
- "!hardware"
"""
RETURN = """
RETURN = r"""
ansible_facts:
description: "Dictionary of ip geolocation facts for a host's IP address"
description: "Dictionary of IP geolocation facts for a host's IP address."
returned: always
type: dict
contains:
ansible_net_gather_subset:
description: The list of fact subsets collected from the device
description: The list of fact subsets collected from the device.
returned: always
type: list
# default
ansible_net_model:
description: The model name returned from the device
returned: always
description: The model name returned from the device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_serialnum:
description: The serial number of the remote device
returned: always
description: The serial number of the remote device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_version:
description: The operating system version running on the remote device
returned: always
description: The operating system version running on the remote device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_hostname:
description: The configured hostname of the device
returned: always
description: The configured hostname of the device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_arch:
description: The CPU architecture of the device
returned: always
description: The CPU architecture of the device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_uptime:
description: The uptime of the device
returned: always
description: The uptime of the device.
returned: O(gather_subset) contains V(default)
type: str
ansible_net_cpu_load:
description: Current CPU load
returned: always
description: Current CPU load.
returned: O(gather_subset) contains V(default)
type: str
# hardware
ansible_net_spacefree_mb:
description: The available disk space on the remote device in MiB
returned: when hardware is configured
description: The available disk space on the remote device in MiB.
returned: O(gather_subset) contains V(hardware)
type: dict
ansible_net_spacetotal_mb:
description: The total disk space on the remote device in MiB
returned: when hardware is configured
description: The total disk space on the remote device in MiB.
returned: O(gather_subset) contains V(hardware)
type: dict
ansible_net_memfree_mb:
description: The available free memory on the remote device in MiB
returned: when hardware is configured
description: The available free memory on the remote device in MiB.
returned: O(gather_subset) contains V(hardware)
type: int
ansible_net_memtotal_mb:
description: The total memory on the remote device in MiB
returned: when hardware is configured
description: The total memory on the remote device in MiB.
returned: O(gather_subset) contains V(hardware)
type: int
# config
ansible_net_config:
description: The current active config from the device
returned: when config is configured
description: The current active config from the device.
returned: O(gather_subset) contains V(config)
type: str
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.
returned: O(gather_subset) contains V(config)
type: str
version_added: 1.2.0
# interfaces
ansible_net_all_ipv4_addresses:
description: All IPv4 addresses configured on the device
returned: when interfaces is configured
description: All IPv4 addresses configured on the device.
returned: O(gather_subset) contains V(interfaces)
type: list
ansible_net_all_ipv6_addresses:
description: All IPv6 addresses configured on the device
returned: when interfaces is configured
description: All IPv6 addresses configured on the device.
returned: O(gather_subset) contains V(interfaces)
type: list
ansible_net_interfaces:
description: A hash of all interfaces running on the system
returned: when interfaces is configured
description: A hash of all interfaces running on the system.
returned: O(gather_subset) contains V(interfaces)
type: dict
ansible_net_neighbors:
description: The list of neighbors from the remote device
returned: when interfaces is configured
description: The list of neighbors from the remote device.
returned: O(gather_subset) contains V(interfaces)
type: dict
# routing
ansible_net_bgp_peer:
description: The dict bgp peer
returned: peer information
description: A dictionary with BGP peer information.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_bgp_vpnv4_route:
description: The dict bgp vpnv4 route
returned: vpnv4 route information
description: A dictionary with BGP vpnv4 route information.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_bgp_instance:
description: The dict bgp instance
returned: bgp instance information
description: A dictionary with BGP instance information.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_route:
description: The dict routes in all routing table
returned: routes information in all routing table
description: A dictionary for routes in all routing tables.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_ospf_instance:
description: The dict ospf instance
returned: ospf instance information
description: A dictionary with OSPF instances.
returned: O(gather_subset) contains V(routing)
type: dict
ansible_net_ospf_neighbor:
description: The dict ospf neighbor
returned: ospf neighbor information
description: A dictionary with OSPF neighbors.
returned: O(gather_subset) contains V(routing)
type: dict
"""
import re
@ -280,14 +303,26 @@ class Hardware(FactsBase):
class Config(FactsBase):
COMMANDS = ['/export verbose']
COMMANDS = [
'/export verbose',
'/export',
]
RM_DATE_RE = re.compile(r'^# [a-z0-9/-][a-z0-9/-]* [0-9:]* by RouterOS')
def populate(self):
super(Config, self).populate()
data = self.responses[0]
if data:
self.facts['config'] = data
data = self.responses[1]
if data:
# remove datetime
data = re.sub(self.RM_DATE_RE, r'# RouterOS', data)
self.facts['config_nonverbose'] = data
class Interfaces(FactsBase):
@ -353,7 +388,7 @@ class Interfaces(FactsBase):
for line in data.split('\n'):
if len(line) == 0 or line[:5] == 'Flags':
continue
elif not re.match(self.WRAPPED_LINE_RE, line):
elif not preprocessed or not re.match(self.WRAPPED_LINE_RE, line):
preprocessed.append(line)
else:
preprocessed[-1] += line
@ -430,7 +465,7 @@ class Routing(FactsBase):
for line in data.split('\n'):
if len(line) == 0 or line[:5] == 'Flags':
continue
elif not re.match(self.WRAPPED_LINE_RE, line):
elif not preprocessed or not re.match(self.WRAPPED_LINE_RE, line):
preprocessed.append(line)
else:
preprocessed[-1] += line
@ -554,14 +589,12 @@ FACT_SUBSETS = dict(
VALID_SUBSETS = frozenset(FACT_SUBSETS.keys())
warnings = list()
def main():
"""main entry point for module execution
"""
argument_spec = dict(
gather_subset=dict(default=['!config'], type='list')
gather_subset=dict(default=['!config'], type='list', elements='str')
)
argument_spec.update(routeros_argument_spec)
@ -618,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__':

View file

@ -1,29 +1,13 @@
#
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
#
# Copyright (c) 2016 Red Hat Inc.
# 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 json
import re
from ansible.errors import AnsibleConnectionFailure
from ansible.module_utils._text import to_text, to_bytes
from ansible.plugins.terminal import TerminalBase
from ansible.utils.display import Display
@ -47,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\-\.\/]+\] ?(<SAFE)?> ?$"),
re.compile(br"Please press \"Enter\" to continue!"),
re.compile(br"Do you want to see the software license\? \[Y\/n\]: ?"),
]

9
tests/config.yml Normal file
View file

@ -0,0 +1,9 @@
---
# 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
# See template for more information:
# https://github.com/ansible/ansible/blob/devel/test/lib/ansible_test/config/config.yml
modules:
python_requires: default

18
tests/ee/all.yml Normal file
View file

@ -0,0 +1,18 @@
---
# 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
- hosts: localhost
tasks:
- name: Find all roles
find:
paths:
- "{{ (playbook_dir | default('.')) ~ '/roles' }}"
file_type: directory
depth: 1
register: result
- name: Include all roles
include_role:
name: "{{ item }}"
loop: "{{ result.files | map(attribute='path') | map('regex_replace', '.*/', '') | sort }}"

View file

@ -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
shippable/posix/group1
skip/python2.6

View file

@ -0,0 +1,63 @@
---
# 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: "Test split filter"
assert:
that:
- "'' | community.routeros.split == []"
- "'foo bar' | community.routeros.split == ['foo', 'bar']"
- >
'foo bar="a b c"' | community.routeros.split == ['foo', 'bar=a b c']
- name: "Test split filter error handling"
set_fact:
test: >-
{{ 'a="' | community.routeros.split }}
ignore_errors: true
register: result
- name: "Verify split filter error handling"
assert:
that:
- >-
"Unexpected end of string during escaped parameter" in result.msg
- name: "Test quote_argument filter"
assert:
that:
- >
'a=' | community.routeros.quote_argument == 'a=""'
- >
'a=b' | community.routeros.quote_argument == 'a=b'
- >
'a=b c' | community.routeros.quote_argument == 'a="b\\_c"'
- >
'a=""' | community.routeros.quote_argument == 'a="\\"\\""'
- name: "Test quote_argument_value filter"
assert:
that:
- >
'' | community.routeros.quote_argument_value == '""'
- >
'foo' | community.routeros.quote_argument_value == 'foo'
- >
'"foo bar"' | community.routeros.quote_argument_value == '"\\"foo\\_bar\\""'
- name: "Test join filter"
assert:
that:
- >
['a=', 'b=c d'] | community.routeros.join == 'a="" b="c\\_d"'
- name: "Test list_to_dict filter"
assert:
that:
- >
['a=', 'b=c'] | community.routeros.list_to_dict == {'a': '', 'b': 'c'}
- >
['a=', 'b=c'] | community.routeros.list_to_dict(skip_empty_values=True) == {'b': 'c'}
- >
['a', 'b=c'] | community.routeros.list_to_dict(require_assignment=False) == {'a': none, 'b': 'c'}

View file

@ -0,0 +1,43 @@
---
# 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: Run api module
community.routeros.api:
username: foo
password: bar
hostname: localhost
path: ip address
ignore_errors: true
register: result
- name: Validate result
assert:
that:
- result is failed
- result.msg in potential_errors
vars:
potential_errors:
- "Error while connecting: [Errno 111] Connection refused"
- "Error while connecting: [Errno 99] Cannot assign requested address"
- name: Run command module
community.routeros.command:
commands:
- /ip address print
vars:
ansible_host: localhost
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: community.routeros.routeros
ansible_user: foo
ansible_ssh_pass: bar
ansible_ssh_port: 12349
ignore_errors: true
register: result
- name: Validate result
assert:
that:
- result is failed
- "'Unable to connect to port 12349 ' in result.msg or 'ssh connect failed: Connection refused' in result.msg"

View file

@ -0,0 +1,7 @@
---
# 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
collections:
- ansible.netcommon

View file

@ -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
shippable/posix/group1
skip/python2.6

View file

@ -0,0 +1,63 @@
---
# 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: "Test split filter"
assert:
that:
- "'' | community.routeros.split == []"
- "'foo bar' | community.routeros.split == ['foo', 'bar']"
- >
'foo bar="a b c"' | community.routeros.split == ['foo', 'bar=a b c']
- name: "Test split filter error handling"
set_fact:
test: >-
{{ 'a="' | community.routeros.split }}
ignore_errors: true
register: result
- name: "Verify split filter error handling"
assert:
that:
- >-
"Unexpected end of string during escaped parameter" in result.msg
- name: "Test quote_argument filter"
assert:
that:
- >
'a=' | community.routeros.quote_argument == 'a=""'
- >
'a=b' | community.routeros.quote_argument == 'a=b'
- >
'a=b c' | community.routeros.quote_argument == 'a="b\\_c"'
- >
'a=""' | community.routeros.quote_argument == 'a="\\"\\""'
- name: "Test quote_argument_value filter"
assert:
that:
- >
'' | community.routeros.quote_argument_value == '""'
- >
'foo' | community.routeros.quote_argument_value == 'foo'
- >
'"foo bar"' | community.routeros.quote_argument_value == '"\\"foo\\_bar\\""'
- name: "Test join filter"
assert:
that:
- >
['a=', 'b=c d'] | community.routeros.join == 'a="" b="c\\_d"'
- name: "Test list_to_dict filter"
assert:
that:
- >
['a=', 'b=c'] | community.routeros.list_to_dict == {'a': '', 'b': 'c'}
- >
['a=', 'b=c'] | community.routeros.list_to_dict(skip_empty_values=True) == {'b': 'c'}
- >
['a', 'b=c'] | community.routeros.list_to_dict(require_assignment=False) == {'a': none, 'b': 'c'}

View file

@ -1,4 +0,0 @@
integration_tests_dependencies:
- ansible.netcommon
unit_tests_dependencies:
- ansible.netcommon

View file

@ -1,5 +1,9 @@
plugins/modules/command.py validate-modules:doc-missing-type
plugins/modules/command.py validate-modules:parameter-list-no-elements
plugins/modules/command.py validate-modules:parameter-type-not-in-doc
plugins/modules/facts.py validate-modules:parameter-list-no-elements
plugins/modules/facts.py validate-modules:parameter-type-not-in-doc
docs/docsite/rst/api-guide.rst rstcheck
docs/docsite/rst/quoting.rst rstcheck
docs/docsite/rst/ssh-guide.rst rstcheck
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

View file

@ -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

View file

@ -1,5 +1,6 @@
plugins/modules/command.py validate-modules:doc-missing-type
plugins/modules/command.py validate-modules:parameter-list-no-elements
plugins/modules/command.py validate-modules:parameter-type-not-in-doc
plugins/modules/facts.py validate-modules:parameter-list-no-elements
plugins/modules/facts.py validate-modules:parameter-type-not-in-doc
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

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -0,0 +1 @@
tests/update-docs.py shebang

View file

@ -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

View file

@ -1,3 +1,9 @@
plugins/modules/command.py validate-modules:doc-missing-type
plugins/modules/command.py validate-modules:parameter-type-not-in-doc
plugins/modules/facts.py validate-modules:parameter-type-not-in-doc
docs/docsite/rst/api-guide.rst rstcheck
docs/docsite/rst/quoting.rst rstcheck
docs/docsite/rst/ssh-guide.rst rstcheck
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

View file

@ -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

View file

@ -1,33 +0,0 @@
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# 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__
except ImportError:
BUILTINS = 'builtins'
else:
BUILTINS = '__builtin__'

View file

@ -1,122 +0,0 @@
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# 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 *
except ImportError:
# Python 2
# pylint: disable=wildcard-import,unused-wildcard-import
try:
from mock 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

View file

@ -1,38 +0,0 @@
# (c) 2014, Toshio Kuratomi <tkuratomi@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# 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 *
except ImportError:
print('You need unittest2 installed on python2.6.x to run tests')
else:
from unittest import *

Some files were not shown because too many files have changed in this diff Show more