Commit graph

399 commits

Author SHA1 Message Date
Felix Fontein
e797f2e07d
ansible/ansible's stable-2.11 branch has been created. (#26) 2021-04-06 05:10:50 +00: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
7bab58eae9
Stop using ansible-galaxy collection install to install a collection due to https://github.com/ansible/galaxy/issues/2429. (#24) 2021-03-27 09:57:59 +01:00
Felix Fontein
36ff772aaa Next regular release is 1.2.0. 2021-01-04 13:21:10 +01:00
Felix Fontein
5c11a27345 Release 1.1.0. 2021-01-04 13:20:42 +01:00
Felix Fontein
992d5b3025 Add release summary. 2021-01-03 21:43:38 +01:00
Felix Fontein
99ede01d63
Fix plugin 'name'. (#19) 2020-12-25 10:45:55 +03:00
Egor Zaitsev
389924be6e
feat: support dashes in username (#18)
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-12-24 14:46:05 +03:00
Egor Zaitsev
b322351c11
docs: add note about hostnames and nested commands (#16)
* docs: add note about hostnames and nested commands

* docs: clarify command nesting

* Update README.md

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2020-12-18 13:12:08 +01:00
Felix Fontein
fbc47fb503 Next expected release is 1.1.0. 2020-12-11 21:04:39 +01:00
Felix Fontein
e1534da6aa Release 1.0.1. 2020-12-11 20:44:27 +01:00
Felix Fontein
5526cc1a1e Prepare 1.0.1 release. 2020-12-11 20:42:01 +01:00
Nikolay Dachev
6c618cab26
remove .id restriction for list_to_dic (#15)
* remove .id restriction for list_to_dic

* add change log

* Update changelogs/fragments/13-remove-id-restriction-for-api.yaml

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

Co-authored-by: dako <dako@syslin.sof.dachev.lan>
Co-authored-by: Felix Fontein <felix@fontein.de>
2020-12-10 23:43:03 +02:00
Felix Fontein
649809b2be
Fix bool default value. (#12) 2020-11-22 20:46:05 +03:00
Felix Fontein
32bcf8b02c Bump to next minor release. 2020-11-17 07:25:50 +01:00
Felix Fontein
a562080159 First non-prerelease release. 2020-11-17 07:24:42 +01:00
Felix Fontein
58b518ac3b Prepare 1.0.0 release. 2020-11-17 07:23:53 +01:00
Felix Fontein
95da72ce90
Add preliminary documentation links. (#10) 2020-11-10 08:11:13 +02:00
Felix Fontein
49ca4c0279
Update routeros.py (#138) (#9)
* Update routeros.py

Adjust the terminal detection line to support forward slashes in device hostnames (connections fail without clear reason otherwise)

* Add changelog fragment.

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit 3f3e0d0)

Fore-ported from ansible-collections/community.network#138.
2020-11-09 14:47:22 +03:00
Felix Fontein
70208c0401 Add path translation for codcov. 2020-11-07 17:10:58 +01:00
Felix Fontein
c4ccca40eb Bump version. 2020-10-31 14:32:36 +01:00
Felix Fontein
1dc9011830 Release 0.1.1. 2020-10-31 14:32:22 +01:00
Felix Fontein
63057d96e4 Prepare 0.1.1 release. 2020-10-31 14:31:53 +01:00
Renato Almeida de Oliveira
e5ad772703
Change to_text for to_native (#5) 2020-10-29 00:57:17 +03:00
Felix Fontein
ed0c7d377e
More docs updates (#4)
* Fix names.

* Remove superfluous tasks:.
2020-10-28 09:22:02 +02:00
Felix Fontein
3c0df4b343
Fix crash when ssl parameter of api is used. (#3)
tested from me as well, thanks again !
2020-10-27 13:08:57 +02:00
Felix Fontein
5368e44f83
Improve docs (#2) 2020-10-27 14:05:19 +03:00
Felix Fontein
5297d4c494 Bump version number to 0.2.0. 2020-10-26 20:31:38 +01:00
Felix Fontein
eb3dd5e19b Prepare 0.1.0 release. 2020-10-26 20:31:11 +01:00
Felix Fontein
e1d0864335 Remove version_added's that refer to other collections. 2020-10-26 20:28:15 +01:00
Felix Fontein
025364c383 Add usage example. 2020-10-26 20:24:36 +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
Felix Fontein
bbcf2f1010 Improve README again. 2020-10-26 15:26:18 +01:00
Felix Fontein
967fda6174 Add release summary. 2020-10-26 15:22:54 +01:00
Felix Fontein
5cd2f02929 Update README. 2020-10-26 15:22:54 +01:00
Felix Fontein
7b13948c8c Simplify CI matrix.
By running unit tests for all Python versions with one ansible-test command,
we save quite some runtime (we don't have to set up the same ansible-test
environment multiple times) and reduce the large amount of unit test entries
in the CI.
2020-10-26 15:22:54 +01:00
Felix Fontein
1b9c46fbe5 Initial cleanup. 2020-10-26 15:18:40 +01:00
John R Barker
cfde9713bd Add collection template. 2020-10-26 15:18:40 +01:00
Felix Fontein
eec35c2612 Fix authors (#123)
* Mark author as unkown for missing authors.

* Mark unknown authors.
2020-10-26 15:18:40 +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
Felix Fontein
6ccc2eab79 Add boilerplate (#108)
* Add boilerplate to doc_fragments and module_utils.

* Add boilerplate to unit tests.

* Add boilerplate to modules.
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
Nikolay Dachev
cc273e7ec1 add api.py (#97)
* 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>
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
Renato Almeida de Oliveira
3634150468 routeros: Bug fix: Exception catching (#27)
* Bug fix: Exception catching

The function get_capabilities was failing to catch connections exceptions, what make an ugly output

OUTPUT BEFORE CHANGES:

The full traceback is:
Traceback (most recent call last):
  File "/root/.ansible/tmp/ansible-local-20843l7aphwz5/ansible-tmp-1588555470.4121525-264386939405924/AnsiballZ_routeros_comle>
    _ansiballz_main()
  File "/root/.ansible/tmp/ansible-local-20843l7aphwz5/ansible-tmp-1588555470.4121525-264386939405924/AnsiballZ_routeros_comallz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/root/.ansible/tmp/ansible-local-20843l7aphwz5/ansible-tmp-1588555470.4121525-264386939405924/AnsiballZ_routeros_com_module
    runpy.run_module(mod_name='ansible.modules.network.routeros.command', init_globals=None, run_name='__main__', a
  File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
    fname, loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/modules/network/routeros/r7, in <module>
  File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/modules/network/routeros/r7, in main
  File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/module_utils/network/routein run_commands
  File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/module_utils/network/routen get_connection
  File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/module_utils/network/routen get_capabilities
  File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/module_utils/connection.py
ansible.module_utils.connection.ConnectionError: Failed to authenticate: Authentication failed.
fatal: [MK]: FAILED! => changed=false
  module_stderr: |-
    Traceback (most recent call last):
      File "/root/.ansible/tmp/ansible-local-20843l7aphwz5/ansible-tmp-1588555470.4121525-264386939405924/AnsiballZ_routerosmodule>
        _ansiballz_main()
      File "/root/.ansible/tmp/ansible-local-20843l7aphwz5/ansible-tmp-1588555470.4121525-264386939405924/AnsiballZ_routerosnsiballz_main
        invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
      File "/root/.ansible/tmp/ansible-local-20843l7aphwz5/ansible-tmp-1588555470.4121525-264386939405924/AnsiballZ_routerosvoke_module
        runpy.run_module(mod_name='ansible.modules.network.routeros.command', init_globals=None, run_name='__main__
      File "/usr/lib64/python2.7/runpy.py", line 176, in run_module
        fname, loader, pkg_name)
      File "/usr/lib64/python2.7/runpy.py", line 82, in _run_module_code
        mod_name, mod_fname, mod_loader, pkg_name)
      File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
        exec code in run_globals
      File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/modules/network/routere 187, in <module>
      File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/modules/network/routere 157, in main
      File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/module_utils/network/r25, in run_commands
      File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/module_utils/network/r5, in get_connection
      File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/module_utils/network/r9, in get_capabilities
      File "/tmp/ansible_command_payload_XbsRY1/ansible_command_payload.zip/ansible/module_utils/connectio
    ansible.module_utils.connection.ConnectionError: Failed to authenticate: Authentication failed.
  module_stdout: ''
  msg: |-
    MODULE FAILURE
    See stdout/stderr for the exact error
  rc: 1

OUTPUT AFTER CHANGES

fatal: [MK]: FAILED! => changed=false
  msg: 'Failed to authenticate: Authentication failed.'

* Lint Fix

* changelog fragment

* changelog update

* to_text refactoring
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