* 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.
* 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>
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>
* 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
* 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>
* 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>
* 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>
* 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.
* 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>
* 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.
* 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.
* 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>
* 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>
* 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>
* Set export on Config to verbose
SUMMARY
In the configuration export session i think that using /export verbose is better than just /export, because with export only some configurations sections are going to be missed like BGP configuration, as proposed in https://github.com/ansible/ansible/pull/67868
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
facts.py
ADDITIONAL INFORMATION
extract of the output with /export verbose
# software id =
#
#
#
/interface ethernet
set [ find default-name=ether1 ] advertise=\
10M-half,10M-full,100M-half,100M-full,1000M-full arp=enabled arp-timeout=\
auto auto-negotiation=yes cable-settings=default disable-running-check=\
yes disabled=no full-duplex=yes loop-protect=default \
loop-protect-disable-time=5m loop-protect-send-interval=5s mac-address=\
50:00:00:02:00:00 mtu=1500 name=ether1 orig-mac-address=50:00:00:02:00:00 \
rx-flow-control=off speed=1Gbps tx-flow-control=off
set [ find default-name=ether2 ] advertise=\
10M-half,10M-full,100M-half,100M-full,1000M-full arp=enabled arp-timeout=\
auto auto-negotiation=yes cable-settings=default disable-running-check=\
yes disabled=no full-duplex=yes loop-protect=default \
loop-protect-disable-time=5m loop-protect-send-interval=5s mac-address=\
50:00:00:02:00:01 mtu=1500 name=ether2 orig-mac-address=50:00:00:02:00:01 \
rx-flow-control=off speed=1Gbps tx-flow-control=off
set [ find default-name=ether3 ] advertise=\
.....
.....
Extract of Output with only /export:
# software id =
#
#
#
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
/ip dhcp-client
add dhcp-options=hostname,clientid disabled=no interface=ether1
<END>
* Create 104_facts_export_verbose
* Update changelogs/fragments/104_facts_export_verbose
Co-authored-by: Felix Fontein <felix@fontein.de>
* Rename export to export_verbose
* Rename 104_facts_export_verbose to 104_facts_export_verbose.yml
Co-authored-by: Felix Fontein <felix@fontein.de>
* add api.py
* fix yaml
* query doc fix
* query doc fix
* fix exmaples
* dummy force retest
* fix small typo in RETURN
* remove no_log which conflict with routeros add param.
* fix pep8
* fix no_log conflict base on issue: password/pass no_log #49465
* ver 1.0.1
* small docs change
* more docs fix
* last one for docs change
* pip8 fix
* Update plugins/modules/api.py
I did not nice that .. Thank you!
Co-authored-by: Felix Fontein <felix@fontein.de>
* remove metadata block
* do not allow empty values to be added in execution path
* Update plugins/modules/api.py
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* fixes for the last review
* Apply suggestions from code review
more fixes
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* small changes in examples 'a' vs 'A'
* Apply suggestions from code review
more docs string fixes
Co-authored-by: Felix Fontein <felix@fontein.de>
* fixses in docs, reomve no_logs
* fix example vars
* fix again example a/A
* missing C in C()
* add external conn func
* fix pep8
* fix pep8 test2
* fix pep8 test3
* fix HAS_LIB
* return Ex as e
* fix pep8
* api unit test
* change unit test, change module structure
* pep8 fix
* more pep8
* some progress with unit test
* mm fix
* mock libros fix
* test
* try to fix mock
* test
* test mock
* more unit test
* libtoueros py3 only
* pytest importskyp added
* more unit test
* add update func unit test
* +more unit, fix mutually_exclusive
* fix missed , for module arg
* Apply suggestions from code review
typos fixes
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* Update plugins/modules/api.py
will fix others as well
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* fix docs
* small doc fix
* fix missing dots etc. in doc
* unit test completed
* reduce dummy Key func
* fix Key return
* final fix
* fix pep8
* fix pep8
Co-authored-by: root <root@syslin.sof.dachev.lan>
Co-authored-by: Nikolay Dachev <dako@Uranus.sof.dachev.lan>
Co-authored-by: Felix Fontein <felix@fontein.de>
Co-authored-by: Andrew Klychkov <aaklychkov@mail.ru>
* facts: Allow multiple entries per iface
There can be multiple addresses per interface, as well as multiple
neighbors.
This changes the format of "ansible_net_neighbors" to list instead of
dict, because the old format could not store multiple neighbors per
interface.
Also, this fixes a crash when the ipv6 module is not loaded, because the
error "bad command name" was being parsed with interface=None
* facts: Fix tests
* facts: Add changelog fragment