Commit graph

19 commits

Author SHA1 Message Date
Thomas Haller
151a611695 module: add allow_empty validation option to ArgValidatorStr() 2017-03-02 16:15:23 +01:00
Thomas Haller
adcdd28bb3 library: support configuring manual DNS servers 2017-02-19 22:26:06 +01:00
Thomas Haller
61e91b6c3d library: support prune-all by omiting 'name' for state 'absent'
When omiting the 'name' for state='absent', we prune all existing
profiles that are not explicitly mentioned in the list of connections.
2017-02-19 22:26:06 +01:00
Thomas Haller
0d964dab26 library: fix handling black_list_uuid in connection_list() 2017-02-19 22:08:11 +01:00
Thomas Haller
37664fda92 library: check that 'mac'/'interface_name' refers to an existing interface
When configuring a profile that specifies a MAC address or an
interface-name, make sure that such an interface actually exists.
2017-02-19 22:08:11 +01:00
Thomas Haller
faf3b699ba library: fetch the MAC address from the interfaces 2017-02-19 21:57:55 +01:00
Thomas Haller
8682cb64b8 module: support a 'ignore_errors' argument
It's more idiomatic for ansible then "on_error".

'ignore_errors' can be specified as a module argument.
But it can also be specified on a per-profile level,
with the intuitive behavior that the per-profile setting
overwrites the per-module setting.
2017-02-19 21:57:55 +01:00
Thomas Haller
b30bf38957 library: add timeout for async NM operations
We use libnm for the async operations. We would expect that
an async operation always returns, but there might be a bug
in libnm so that it doesn't

Add our own timeout around the libnm calls to avoid hanging.
2017-01-13 15:29:34 +01:00
Thomas Haller
edcb4a2850 library: let the module handle all connections at once
Instead, of having the tasks call the "network_connections.py"
library for each connection profile individually (using with_items),
pass all profiles at once.

The advantage is:

 - the module can validate the input arguments better as it has
   access to all profiles. For example, when a slave connection
   refers to another master profile from the same play. Previously,
   each invocation of the module only sees the current profile and
   cannot verify whether the reference is valid.

 - while configuring the network, the play might need to shortly
   disconnect the control connection. In the previous way, after
   tearing down the network the target host becomes unreachable for
   ansible and the following steps cannot be executed anymore.
   Now, all steps are done as a whole on the target host, via
   one connection. If the host becomes unreachable for a short
   time, that is not a problem as long as the connectivty is
   restored at the end.
   Ansible also supports to switch the host IP (or SSH port). With
   this new way, the ansible play can apply a bunch of profiles
   autonomously and the ansible play can potentially handle a changing
   IP configuration.
2017-01-12 19:22:52 +01:00
Thomas Haller
407e3b81af test, library: improve example and disable STP of bridge
For the early PoC, STP just annoys with testing. Later,
this should become configurable.
2016-12-07 13:27:14 +01:00
Thomas Haller
17c581a1cd readme: update documentation 2016-12-07 12:53:12 +01:00
Thomas Haller
ba11497f19 library: don't fail in check-mode if connection doesn't exists
During an actual run, the connection profile might be created
in a previous step. Simulate success, but add a warning.
2016-12-07 12:34:33 +01:00
Thomas Haller
9c3b2ad422 test,library: add example playbooks and bug fixes 2016-12-06 17:07:21 +01:00
Thomas Haller
8c69f5b851 readme: improve documentation 2016-12-06 16:16:48 +01:00
Thomas Haller
e079827da9 merge branch 'role-restructure'
https://github.com/NetworkManager/ansible-network-role/pull/1
2016-12-05 22:19:56 +01:00
Sam Doran
9c54c68858 Restructure role
Change default variables to include lookup table.
Change tasks to set variables based on distribution version.
2016-12-05 16:07:19 -05:00
Sam Doran
1d17b3fa93 Use multi-line YAML syntax 2016-12-05 13:18:05 -05:00
Thomas Haller
ac35802240 first version 2016-12-05 18:14:20 +01:00
Thomas Haller
8585a7ecab initial commit 2016-11-10 11:55:12 +01:00