Commit graph

24 commits

Author SHA1 Message Date
Felix Fontein
08152376de Fix linting errors. 2025-04-26 12:18:29 +02: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
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
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
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
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
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
af6524a1fd
Fix docs. (#105) 2022-08-04 14:32:01 +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
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
txt-file
e9fdf19253
fix typo (#64) 2022-01-22 08:26:53 +01:00
Felix Fontein
4ccd70cc8f
Fix sanity errors. (#55) 2021-10-19 13:04:30 +01: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
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
5368e44f83
Improve docs (#2) 2020-10-27 14:05:19 +03:00
Felix Fontein
e1d0864335 Remove version_added's that refer to other collections. 2020-10-26 20:28:15 +01:00
Felix Fontein
fa4825ba5f Improve documentation. This way, antsiull-docs is mentioned the result values as 'facts' and not as regular return values. 2020-10-26 20:24:31 +01:00
Renato Almeida de Oliveira
5dd6ae782a Set export on Config to verbose (#104)
* 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>
2020-10-26 15:18:40 +01:00
adeptvin1
f1ae008c4d Update facts (#101)
* Update facts.py

* Update facts.py

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Update plugins/modules/facts.py

Co-authored-by: Egor Zaitsev <heuels@gmail.com>

* Create 101_update_facts.yml

* Update plugins/modules/facts.py

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

* Update changelogs/fragments/101_update_facts.yml

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

* add test default function

* add test data

* Update routing_ospf_neighbor_print_detail_without-paging

* add test function "Routing"

* added information of version

* Removed extra spaces

* add one more version, "ansible_net_cpu_load"

* remove many blank lines

* remove 'too many blank lines'

* renamed arhitec to arch

* Update facts.py

* Update test_facts.py

* Update test_facts.py

* one more

* remove one route

* Update test_facts.py

* remove one neighbor

Co-authored-by: Egor Zaitsev <heuels@gmail.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-10-26 15:18:40 +01:00
Andrew Klychkov
82f9288507 modules: fix examples to use FQCN (#88)
* modules: fix examples to use FQCN

* fix

* fix
2020-10-26 15:18:40 +01:00
Andrew Klychkov
283749481e Fix example formatting (#37) 2020-10-26 15:18:40 +01:00
Jan-Philipp Litza
d26dfa16c7 facts: Allow multiple entries per iface (#6)
* 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
2020-10-26 15:18:40 +01:00
Andrew Klychkov
138e27a31e Remove ANSIBLE_METADATA (#35) 2020-10-26 15:18:40 +01:00
John R Barker
bcfea39ddc Add networking (#1)
Initial commit of network content that was previously in community.general
2020-10-26 15:18:40 +01:00