Commit graph

222 commits

Author SHA1 Message Date
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
Till Maas
987c8d05bb Do not log long list of installed packages
This keeps the output more readable.
2018-08-15 10:04:47 +02:00
Till Maas
d76ac65581 Do not require profiles to be specified for 'up'
This allows to up profiles that are only available on disk.
2018-08-15 10:04:47 +02:00
Till Maas
382c34197b Modularize role
Splitting the role in smaller parts helps to keep the overview and to
develop separate tests.
2018-08-15 10:04:47 +02:00
Till Maas
d866422d9d
Merge pull request #74 from tyll/autodetect_provider
Use network manager only when it is running
2018-08-01 23:43:59 +02:00
Till Maas
c279f0afc5 Run integration tests with other provider, too
- Amend and add files to run integration tests against the provider that
was not autodetected, too.
- Add check to ensure that all integration tests run against both
providers
- Run black check for all python scripts
2018-08-01 23:13:30 +02:00
Till Maas
4b9c91763b Use nm provider by default only when NetworkManager is running
- Use initscripts as provider except when NetworkManager is running
- Rename network_provider_default to network_provider_os_default, since
it contains the default based on the OS
2018-08-01 18:32:01 +02:00
Till Maas
441667560e Update limitations of initscripts and nm provider 2018-08-01 18:13:58 +02:00
Till Maas
22539bdc18
Merge pull request #75 from tyll/interface_name
Use profile name for interface name by default
2018-08-01 09:41:28 +02:00
Till Maas
3c826ad355 More README clarifications on the variables and behavior 2018-07-30 19:12:44 +02:00
Till Maas
6bf70bcf60 Use profile name for interface name by default
* by default ```name``` is used as ```interface_name```
* if ```interface_name``` is set to the empty string, it will not be set
* if ```mac``` is specified, ```interface_name``` defaults to not being set

This fixes #41
2018-07-25 21:56:43 +02:00
Till Maas
64879e74d9
Merge pull request #73 from tyll/black-squash
Use black as formatter and enable flake8/pylint
2018-07-20 13:16:20 +02:00
Till Maas
2f6605cf79
Merge pull request #72 from tyll/test_bridge1
Working tests from #53
2018-07-18 17:29:54 +02:00
Till Maas
e32033f995 Use black as formatter and enable flake8/pylint 2018-07-18 17:23:18 +02:00
Till Maas
35f2dcf8f7 Install bridge-utils if necessary for initscripts
Fixes #68
2018-07-16 08:26:50 +02:00
Till Maas
9b3d2d3ad8 Add simple test for bridges 2018-07-16 08:26:50 +02:00
pcahyna
7d44710f44
Merge pull request #69 from tyll/fixes
Fix typo in tox.ini
2018-07-11 15:32:02 +02:00
Till Maas
7c5dce7a1d Fix typo in tox.ini 2018-07-11 12:35:35 +02:00
Till Maas
fdcd0f8ea7
Merge pull request #52 from tyll/test_connection_down
Taking a connection down does not work
2018-07-11 12:34:16 +02:00
Till Maas
459601c8e7 Fail when trying to down a non-existing NM profile 2018-07-11 10:06:45 +02:00
Till Maas
756be9a8de Allow to take down connections if not in config
Allow to take down connections regardless of whether they are defined in
the configuration. It should be enough that the connection is defined on
the system.
2018-07-09 14:39:40 +02:00
Till Maas
d370966ee2 Add test to take interface down 2018-07-09 14:39:40 +02:00
Till Maas
44a9d70981
Merge pull request #65 from tyll/no_vars_symlinks
Use set_facts to set default provider
2018-07-09 13:37:19 +02:00
Till Maas
5f30c5b5e3 Use set_facts to set default provider
This avoids symlinks that do not work on Windows:
https://github.com/linux-system-roles/network/pull/64#issuecomment-401740870
2018-07-09 11:56:01 +02:00
Till Maas
61557e05e6
Merge pull request #67 from tyll/package_facts
Work around slow package manager
2018-07-09 11:20:49 +02:00
Till Maas
3e8cb619b8 Work around slow package manager 2018-07-06 21:16:33 +02:00
Till Maas
b52193984f Update .gitignore 2018-07-03 12:55:27 +02:00
Till Maas
775b7648fe
Merge pull request #63 from tyll/initscripts
tests_ethernet: run with initscripts provider, too
2018-06-29 16:35:56 +02:00
Till Maas
053dd62720 tests_ethernet: run with initscripts provider, too 2018-06-29 16:06:43 +02:00
Till Maas
f2e493cd75
Merge pull request #62 from tyll/fixes
Various minor fixes
2018-06-28 18:04:03 +02:00
Till Maas
488c59a5f5 Rename/symlink accidentally checked-in files 2018-06-28 16:55:37 +02:00
Till Maas
8cf13dbc22 tox.ini: Fix PYTHONPATH 2018-06-28 16:31:35 +02:00
Till Maas
fce335d79e tests_ethernet: Use correct test IP range 2018-06-28 16:31:35 +02:00
Thomas Haller
5b9e1331f8 library: fix try-count handling in SysUtil.link_infos()
https://github.com/linux-system-roles/network/issues/61
2018-06-18 21:56:37 +02:00
Till Maas
ed1d30a53d
Merge pull request #60 from linux-system-roles/th/main-function
th/main-function
2018-06-11 20:15:29 +02:00
Till Maas
ec65f5c78e
Merge pull request #59 from tyll/fix_global_connections
Use proper connections attribute
2018-06-11 15:36:37 +02:00
Till Maas
70d3e9e96c
Merge pull request #58 from smasc/fix_autoconnect
Fix handling of autoconnect parameter
2018-06-11 15:36:15 +02:00
Thomas Haller
cf8522e5cc library: move main code to explicit main() function
Without it, we unintentionally declared 3 global variables
(connections, cmd, run_env_ansible). This was not intended,
and results in possibly wrong behavior by accidentally using
the global variables.
2018-06-11 08:49:35 +02:00
Till Maas
63314aeb92 Use proper connections attribute 2018-06-08 21:35:31 +02:00
Shannon Mascarenhas
70e69226c1 Add test for disabling autoconnect 2018-05-30 08:25:25 -05:00
Shannon Mascarenhas
5b45f9bc46 Fix handling of autoconnect parameter
This fixes a bug in the `network_connections` module when using the
`initscripts` provider and encountering a connection with `autoconnect`
set to false. It fails to write any `ONBOOT=` line to the interface's
`ifcfg-*` file, which RHEL treats as equivalent to `ONBOOT=yes`.

This explicitly sets `ONBOOT` for all interfaces defined, instead of
relying on what RHEL considers its default value.
2018-05-29 12:52:02 -05:00
Till Maas
fd110a4deb
Merge pull request #51 from tyll/type_keyerror
Detect and fix keyerror
2018-05-25 20:36:02 +02:00
Till Maas
dd24f020a9 Handle undefined type attribute
This fixes this exception (issue #40):

 [WARNING]: exception: Traceback (most recent call last):   File
"/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2812, in <module>     cmd.run()   File
"/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2398, in run     self.run_prepare()   File
"/tmp/ansible_FfjjGk/ansible_module_network_connections.py", line 2653, in run_prepare     if connection['type'] in [
'macvlan' ]: KeyError: 'type'
2018-05-25 19:52:10 +02:00
Till Maas
0fc1b5bbb5 Add test to remove Ethernet profile 2018-05-25 19:52:10 +02:00