Commit graph

72 commits

Author SHA1 Message Date
Felix Fontein
ab1026504c
Allow to ignore dynamic and builtin entries. (#373) 2025-05-31 16:50:52 +02:00
Felix Fontein
08152376de Fix linting errors. 2025-04-26 12:18:29 +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
e286d768c0
Use antsibull-nox for CI. (#361) 2025-04-19 13:07:53 +02: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
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
dcdca90dd0 Add extra sanity test for routeros action group. 2025-01-03 14:49:49 +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
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
c864078549
Add stable-2.18 to CI. (#317) 2024-09-24 13:47:53 +03: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
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
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
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
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
a823d66b33
Fix typos, improve markup (#231)
* Fix typos.

* Improve markup.
2023-10-29 08:28:00 +01:00
Felix Fontein
170240480c
Add ansible-core 2.16 to the matrix. (#222) 2023-09-19 17:51:13 +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
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
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
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
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
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
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
Felix Fontein
1dfa79c5ef
Remove unnecessary test imports. (#150) 2023-02-12 21:17:22 +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
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
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
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
Felix Fontein
5affbf6b05
Add stable-2.14 to CI. (#112) 2022-09-21 10:40:45 +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
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
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
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
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
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