Commit graph

265 commits

Author SHA1 Message Date
Till Maas
1b95e02b98 tasks/initscripts: Create /etc/sysconfig/network
The initscripts network service requires /etc/sysconfig/network to be
present. The file might be missing in container images, for example
currently in CentOS 7. It seems to be created by anaconda usually.
Therefore just create it if necessary as it can be empty.

References:
https://bugs.centos.org/view.php?id=16010
2019-04-15 17:35:08 +02:00
Till Maas
25181ed5b7 tasks/initscripts: Do not start network service
The network service from initscripts fails if there are network profiles
for unknown devices. Also it does not start an actual daemon but just
activates all profiles on disk. Therefore only enable it to ensure it
will come up after boot.
2019-04-15 17:34:51 +02:00
Till Maas
74b3a31f90
Merge pull request #101 from linux-system-roles/th/nm-connection-type
[th/nm connection-type] fix creating vlan and mac profiles for NetworkManager
2019-02-08 09:58:38 +01:00
Thomas Haller
7157713b14 module: fix setting NM connection-type for "vlan" and "macvlan"
Otherwise:

  failure: created connection failed to normalize: nm-connection-error-quark:
  connection.type: property is missing (6)
2019-02-08 07:30:54 +01:00
Thomas Haller
cff6989606 module: use introspection variables instead of plain strings for setting names 2019-02-08 07:30:54 +01:00
Till Maas
f5ee8a7e1c
Merge pull request #95 from tyll/update2
Make connections volatile instead of removing them
2019-01-10 22:11:09 +01:00
Till Maas
0d4beae1b8
Merge pull request #94 from tyll/less_noise
tasks: Do not log full service facts
2019-01-10 22:10:49 +01:00
Till Maas
c0b7605c4f
Merge pull request #96 from tyll/generate_fix
Tests: Only show missing test files when checking
2019-01-10 20:21:59 +01:00
Thomas Haller
d2ce509320 module: rework polling in NMUtil.wait_till_connection_is_gone()
time.sleep() does not sleep an exact amount of time, hence, adding
up the sleep-times will not give the exact total wait-time.
An alternative would be to take a CLOCK_BOOTTIME timestamp (or similar)
and determine the elapsed time based on that.

Instead, do something different, and use a GLib timeout for polling.
2019-01-10 14:39:15 +01:00
Thomas Haller
c0b2430144 module: minor cleanup of Util.GMainLoop_run()
It was rather confusing whether the boolean return value meant
that the timeout was reached or the opposite.

Rename the internal variable, I think now it's quite clear.
2019-01-10 14:39:15 +01:00
Till Maas
1ca27dc09c Clarify missing type error 2019-01-10 14:39:15 +01:00
Till Maas
6fc00a0d43 Make connections volatile instead of removing them
This keeps the profile up in Network Manager for
persistent_state:absent.
2019-01-10 14:39:15 +01:00
Till Maas
16f06b18a8 Tests: Only show missing test files when checking 2019-01-09 22:59:27 +01:00
Till Maas
2f605ea8df tasks: Do not log full service facts
The service facts create too much noise in test logs, therefore hide
them.
2019-01-09 22:52:27 +01:00
Till Maas
9314a2b251
Merge pull request #93 from tyll/asserts
test asserts: Clarify name
2019-01-08 20:52:28 +01:00
Till Maas
a1d258d9dc
Merge pull request #91 from tyll/name_other_provider_tasks
Tests: Add names for other provider tasks/playbooks
2019-01-08 20:52:00 +01:00
Till Maas
9b3712cbdf test asserts: Clarify name 2019-01-08 17:11:38 +01:00
Till Maas
4d9f475ce7 Tests: Add names for other provider tasks/playbooks 2019-01-08 17:10:31 +01:00
Pavel Cahyna
b144a026b4 Add Fedora 29 support to Galaxy metadata 2018-11-14 15:53:32 +01:00
Till Maas
64b2d76de7
Merge pull request #90 from tyll/ansible27
Fix Ansible 2.7 support
2018-10-16 12:11:03 +02:00
Till Maas
49c7c6a0f4 tests: Properly set the name of assert tasks
Otherwise it breaks with Ansible 2.7 or does not show the name with
previous Ansible versions.
2018-10-16 11:31:22 +02:00
Till Maas
207d31b4d0 tests: Use vars: with include_tasks
Specifying vars as foo=bar does not work anymore with Ansible 2.7.
Specify the vars using a dictionary instead.

This fixes #89
2018-10-16 11:31:22 +02:00
Till Maas
eb6b954e32
Merge pull request #88 from tyll/fedora29
Fix Fedora 29 support
2018-10-16 11:30:14 +02:00
Till Maas
4d16eadd03
Merge pull request #87 from linux-system-roles/th/module-minor-cleanups
th/module-minor-cleanups
2018-10-15 21:03:13 +02:00
Till Maas
97adeb5668 Default to install network-scripts for initscripts
Newer releases of `initscripts` ship the network scripts in a separate
package called `network-scripts`.

This fixes #81
2018-10-15 21:00:26 +02:00
Till Maas
d4936d1ca7 Require bridge-utils only for older distributions
The initscripts provider uses iproute2 in newer releases to setup
bridges.

This fixes #84
2018-10-15 21:00:05 +02:00
Till Maas
84fe98508e Use is version instead of |version_compare
Using tests as filters is deprecated and `version_compare` was renamed
to `version` in Ansible 2.5.
2018-10-15 20:53:20 +02:00
Thomas Haller
b4972517a4 module: fix name for ArgValidator_DictConnection
The name is actually not ever used, because
ArgValidator_DictConnection() is never validated directly.
Instead, it is always nested inside ArgValidator_ListConnections()
which passes "connections[$IDX]" as name to self.nested._validate().

Anyway, still when looking at the name of a ArgValidator_DictConnection
instance, it makes slightly more sense to call it just "connection".
2018-10-10 15:20:25 +02:00
Thomas Haller
97e216c716 module: don't expose "name" parameter for ArgValidator.validate()
The "name" argument is an implementation detail, that is used
by ArgValidatorDict and ArgValidatorList to pass a complex (nested)
name of what is currently parsed.

Callers are not supposed to see or use this argument.
Hide it, by adding an internal helper method _validate().
2018-10-10 15:20:25 +02:00
Thomas Haller
6856b5407d module: rename internal ArgValidator._validate()
First a trivial renaming because the next commit will
add a different "_validate" method.
2018-10-10 15:20:25 +02:00
Thomas Haller
8daa14eb36 module: make Utils.create_uuid() working without pygobject
Utils.create_uuid() only needs the "uuid" module, which
is commonly available. Don't load it together with the
NM module, as that requires pygobject.
2018-10-10 15:20:25 +02:00
Pavel Cahyna
979145cbae More doc improvements 2018-10-04 15:54:06 +02:00
Pavel Cahyna
ddada6e4c9 Restore previous meaning
in cases where it was lost or garbled by the restructuring.

Other minor doc improvements.
2018-10-04 15:54:06 +02:00
Vaclav Dolezal
60843a7f8d readme: apply some other suggestions from pcahyna 2018-10-04 15:54:06 +02:00
Vaclav Dolezal
3e7a373b39 readme: apply some suggestions from pcahyna 2018-10-04 15:54:06 +02:00
Vaclav Dolezal
8c6f4e7f94 Apply requested changes to README 2018-10-04 15:54:06 +02:00
Vaclav Dolezal
89e2903032 Update and cleanup README
Co-author: Ioanna Gkioka <igkioka@redhat.com>
Signed-off-by: Vaclav Dolezal <vdolezal@redhat.com>
2018-10-04 15:54:06 +02:00
Till Maas
a10e72b905
Merge pull request #83 from tyll/network_provider_debug
Print network provider early
2018-08-28 18:42:46 +02:00
Till Maas
db6384f83c Print network provider early
The list of packages to install depends on the network provider, so
print it out early.
2018-08-24 15:21:03 +02:00
Pavel Cahyna
8369b953cc Update Galaxy tags.
Remove beta and add tags.

Update the OS versions and Ansible version (2.5 because of service_facts).
2018-08-21 20:47:38 +02:00
Till Maas
d0562b2ecd
Reword warnings 2018-08-15 18:41:26 +02:00
Pavel Cahyna
e1b50047c7 Fix typo 2018-08-15 17:02:57 +02:00
Pavel Cahyna
ff04b5aff0 consistent style for booleans 2018-08-15 16:47:13 +02:00
Pavel Cahyna
6440103bab Delete a spurious character 2018-08-15 16:46:40 +02:00
Pavel Cahyna
bc8b0398b0 Add a prominent warning about things that the role removes. 2018-08-15 16:41:39 +02:00
Till Maas
712ff3fa88 Fix typo 2018-08-15 10:04:47 +02:00
Till Maas
53ee0e37ed Do not mention wait:-1 2018-08-15 10:04:47 +02:00
Till Maas
09258d84e3 Support compatibility values for 'state' setting 2018-08-15 10:04:47 +02:00
Till Maas
e1bb399311 Use loop to install packages 2018-08-15 10:04:47 +02:00
Till Maas
23605615da Separate 'persistent_state' from 'state'
- persistent_state represents whether a profile is stored on disk
- persistent_state defaults to 'present'
- When there is no type specified for the profile, it is enough for a
profile with the same name to be stored on the target's systems file
system. Otherwise the role will fail
- state now represents the runtime state and can be up, down or
unspecified
- translate the state definitions into actions that will be performed.
The actions correspond to the previous states.
- add the possibility to write unit tests to only verify parts of the
resulting connection dictionary to only check for the expected changes
instead of the full connection that can also contain unrelated defaults
2018-08-15 10:04:47 +02:00