* 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
* 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.
* 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>
* 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