Commit graph

155 commits

Author SHA1 Message Date
Till Maas
7c51a71cf4 Run tests for python 2.6 and 3.7, too 2018-05-17 12:23:31 +02:00
pcahyna
9f00e45818
Merge pull request #46 from tyll/coveralls
Travis-CI + Coveralls + move of tests and restructuring of the roles subdirectory
2018-05-17 11:29:47 +02:00
Till Maas
8d014e7a1d Update gitignore 2018-05-17 11:15:28 +02:00
Till Maas
3ad7589913 Add status badges 2018-05-17 11:15:28 +02:00
Till Maas
fb76fba61d Add initial travis and coveralls support via tox
Do not run coveralls by default and do not run flake8 and pylint in
travis. They make it always fail at the moment.
2018-05-17 11:15:14 +02:00
Till Maas
8e6f1bf96b Move unit tests to tests dir 2018-05-16 20:18:05 +02:00
Till Maas
3e6e536248 Avoid symlink loop and nonstandard top level roles directory - move to tests 2018-05-16 20:03:05 +02:00
Till Maas
4ead3cfea8 Move tests to /tests directory and rename to new naming scheme
Ansible Galaxy and
https://fedoraproject.org/wiki/CI/Standard_Test_Interface suggest to use
a /tests directory and a names matching test*.yml.
2018-05-16 19:48:23 +02:00
Till Maas
57a67a3785 Fix role symlink 2018-05-14 17:06:24 +02:00
Till Maas
af34b18b0f Use common roles directory to detect loops
This helps pytest to detect a loop.
2018-05-14 16:53:39 +02:00
Till Maas
b3163cdf20 Test more boolean values 2018-05-14 16:53:39 +02:00
Till Maas
9528ab4cba Use linux-system-roles.network as role name 2018-05-14 16:53:39 +02:00
Pavel Cahyna
08187ae624 Unset the executable bit on Ansible module.
Per the policy defined in https://docs.ansible.com/ansible/latest/dev_guide/testing/sanity/shebang.html.
(Some RPM checks
f7e8f73ead/f/brp-mangle-shebangs
do not like an executable script to have a #!/usr/bin/python shebang.)
2018-05-10 18:28:13 +02:00
Till Maas
b5143f8b44
Merge pull request #37 from tyll/dns_simpletest
Add unittest for single IPv4 DNS server
2018-04-12 21:31:26 +02:00
Till Maas
2c3fd58458
Merge pull request #36 from pcahyna/add0.4docs
Improved documentation, especially of the new options added in 0.4, and DNS.
2018-03-14 08:34:42 +01:00
Pavel Cahyna
5106cb67e8 doc: corrections from @tyll: among others, use yes/no for bools 2018-03-14 01:39:18 +01:00
Till Maas
168bd43629 Add unittest for single IPv4 DNS server 2018-03-13 16:15:35 +01:00
Till Maas
f0d0e0637b Add SPDX-License-Identifier headers 2018-03-13 10:06:30 +01:00
Till Maas
ab73cbc864 Rename license file to match linux system role template 2018-03-13 10:06:29 +01:00
Till Maas
5cd3d680fd Update license header 2018-03-13 10:06:29 +01:00
Pavel Cahyna
0204786c8a doc: infiniband is a valid connection type as well. 2018-03-09 15:36:46 +01:00
Pavel Cahyna
06eb0ff5d3 doc: document the ethernet specific options. 2018-03-09 15:36:34 +01:00
Pavel Cahyna
7e1b2f0117 doc: document the static routing related options. 2018-03-09 15:36:27 +01:00
Pavel Cahyna
0a7df307d4 doc: add a brief description of the dns and dns_search options
requested in bz1550128.
2018-03-09 15:32:00 +01:00
Pavel Cahyna
0921678f1b correct typo in documentation 2018-03-09 11:28:57 +01:00
Thomas Haller
84e4d3ac95 library: merge branch 'macvlan-pr27'
https://github.com/linux-system-roles/network/pull/27
2018-02-13 08:25:18 +01:00
Thomas Haller
2dbc68b7d9 library: fix tests for macvlan with initscripts 2018-02-13 08:23:59 +01:00
Roland Pabel
15a1ca8b7c add macvlan support 2018-02-13 08:23:59 +01:00
Thomas Haller
d3f4fe715b library: cleanup Util.boolean() implementation 2018-01-25 12:18:58 +01:00
Thomas Haller
0098878895 network: merge branch 'th/nest-vlan-infiniband'
https://github.com/linux-system-roles/network/pull/26
2018-01-25 11:49:41 +01:00
Thomas Haller
be6d51d7cf library: deprecate top-level 'infiniband*' paramters in favour of nested 'infiniband'
Like for 'bond' and 'ethernet', don't merge the infiniband specific property
in the top-level. Instead, nest them under 'infiniband'.

This duplicates and deprecates the existing infiniband settings, but the old
parameters are still supported.
2018-01-25 11:39:09 +01:00
Thomas Haller
72f7c8ab4d library: deprecate top-level 'vlan_id' paramter in favour of nested 'vlan'
Like for 'bond' and 'ethernet', don't merge the vlan specific property
in the top-level. Instead, nest them under 'vlan'.

This duplicates and deprecates the existing 'vlan_id', but the old
parameter is still supported.
2018-01-25 11:31:09 +01:00
Thomas Haller
b2901ebd3f Revert "network: install python-gobject package by default"
The package is not called python-gobject on RHEL.

This reverts commit a799777d1a.
2018-01-24 14:06:41 +01:00
Thomas Haller
d76e98ec64 library: fix handling missing arguments of ArgValidatorNum type
It was impossible to set default_value = ArgValidator.MISSING, which can
be useful.
2018-01-24 12:52:54 +01:00
Thomas Haller
23325cda41 library/test: add tests for validating infiniband profiles 2018-01-24 12:51:46 +01:00
Thomas Haller
83249eb042 library/test: add test for a slave profile 2018-01-24 11:40:46 +01:00
Thomas Haller
a799777d1a network: install python-gobject package by default
The "nm" provider talks to NetworkManager via libnm and python GObject
introspection. Install the required python library by default.

Unfortunately, it's not immediately clear whether we want to install
python2-gobject or python3-gobject. Yeay, python.
2018-01-23 16:29:30 +01:00
Thomas Haller
e0c492eeb5 network: install ethtool package by default
The role uses ethtool to obtain the permanent MAC address of interfaces.
It should be installed by the role as well.
2018-01-23 16:19:58 +01:00
Thomas Haller
f62dea9c10 library: merge branch 'th/ansible-independent'
Refactor the code, to make Cmd independent of ansible includes.
This would simplify to extend the library to run as stand-alone
application or to re-use parts without ansible.

Also, it better separates the code.

https://github.com/linux-system-roles/network/pull/23
2018-01-22 11:01:58 +01:00
Thomas Haller
068db05080 library: fix handling of "changed" flag
run() supports a --check mode (DRY_RUN) and a real mode,
where the real mode consists of a PRE_RUN that only simulates
the steps and a REAL_RUN.

Actualy changes can only happen during REAL_RUN (and we pretend
that they happen during DRY_RUN).

Fix handling of the change flag, is was broken previously.

Also, we need to set the is-changed flag to True before actually
invoking the action. Because, if we fail, we might fail_json()
right away, and need to correct changed flag.
2018-01-22 10:33:45 +01:00
Thomas Haller
db7fc2b60e library: move ansible_managed header outside of IfcfgUtil 2018-01-22 10:33:45 +01:00
Thomas Haller
a5eb321ef3 library: cleanup handling of run_results in RunEnvironmentAnsible 2018-01-22 10:33:45 +01:00
Thomas Haller
1ae5196a87 library/trivial: rename AnsibleUtil to RunEnvironmentAnsible 2018-01-22 10:33:45 +01:00
Thomas Haller
8db7f496b2 library: don't create AnsibleUtil.module lazily
Now, that we only create the AnsibleUtil instance when we already
know that we run under ansible (not from unit tests), we can avoid
initializing the AnsibleModule lazily.
2018-01-22 10:33:45 +01:00
Thomas Haller
4e6ace727e library: move change-tracking from AnsibleUtil to Cmd 2018-01-22 10:33:45 +01:00
Thomas Haller
c9bbb69d7e library: track connections in Cmd instead of AnsibleUtil
For now this looks more complicated then before. It will get better...
2018-01-22 10:33:44 +01:00
Thomas Haller
e2c575cb84 library: refactor handling of run_results
Make it more independent of AnsibleUtil.connections. Eventually,
we want to move parts to Cmd.
2018-01-22 10:33:44 +01:00
Thomas Haller
7e08386e7e library: handle ignore-errors parameter outside of AnsibleUtil 2018-01-22 10:33:44 +01:00
Thomas Haller
080fb56bfe library: don't call run_command() via AnsibleUtil 2018-01-22 10:33:44 +01:00
Thomas Haller
25497bfa63 library: remove unused function 2018-01-22 10:33:44 +01:00