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.
This commit is contained in:
Felix Fontein 2022-07-31 22:06:19 +02:00 committed by GitHub
parent 1abaa8e7ca
commit 2911710f1b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 3277 additions and 6 deletions

View file

@ -8,7 +8,7 @@
How to connect to RouterOS devices with the RouterOS API
========================================================
You can use the :ref:`community.routeros.api module <ansible_collections.community.routeros.api_module>` to connect to a RouterOS device with the RouterOS API. A more specific module to modify certain entries is the :ref:`community.routeros.api_find_and_modify module <ansible_collections.community.routeros.api_find_and_modify_module>`. The :ref:`community.routeros.api_facts module <ansible_collections.community.routeros.api_facts_module>` allows to retrieve Ansible facts using the RouterOS API.
You can use the :ref:`community.routeros.api module <ansible_collections.community.routeros.api_module>` to connect to a RouterOS device with the RouterOS API. More specific module to modify certain entries are the :ref:`community.routeros.api_modify <ansible_collections.community.routeros.api_modify_module>` and :ref:`community.routeros.api_find_and_modify <ansible_collections.community.routeros.api_find_and_modify_module>` modules. The :ref:`community.routeros.api_info module <ansible_collections.community.routeros.api_info_module>` allows to retrieve information on specific predefined paths that can be used as input for the ``community.routeros.api_modify`` module, and the :ref:`community.routeros.api_facts module <ansible_collections.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``: