network/TEST
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
..
roles first version 2016-12-05 18:14:20 +01:00
.gitignore first version 2016-12-05 18:14:20 +01:00
README.md test, library: improve example and disable STP of bridge 2016-12-07 13:27:14 +01:00
test-playbook-3.yml library: let the module handle all connections at once 2017-01-12 19:22:52 +01:00
test-playbook.yml first version 2016-12-05 18:14:20 +01:00

TEST

git clone git://github.com/ansible/ansible.git --recursive
. ./ansible/hacking/env-setup

git clone git@github.com:NetworkManager/ansible-network-role.git

cd ./ansible-network-role/

cat <<EOF > ./TEST/inventory
[network-test]
v-rhel6 ansible_user=root network_iphost=196 network_mac=52:54:00:44:9f:ba
v-rhel7 ansible_user=root network_iphost=97  network_mac=52:54:00:05:f5:b3
EOF

../ansible/hacking/test-module -m ./library/network_connections.py -a 'provider=nm name=t-eth0 state=present type=ethernet' --check

ansible-playbook -i ./TEST/inventory -l '*rhel*' ./TEST/test-playbook-3.yml --verbose --check