xci: bootstrap-host: Make active network interface consistent 81/54581/1
authorMarkos Chandras <mchandras@suse.de>
Wed, 28 Mar 2018 15:10:28 +0000 (16:10 +0100)
committerMarkos Chandras <mchandras@suse.de>
Wed, 28 Mar 2018 21:05:21 +0000 (22:05 +0100)
commit396ea65c98f71580a2e789c7d93c8d8611878b64
tree9ec5127a61b523deb058fa982d61b251b747c02c
parent25ec0a542c5948b4ec515138ddb339fa12234a4b
xci: bootstrap-host: Make active network interface consistent

When we run XCI for the first time, Ansible picks the first active
interface as the default one. However, after we configure all the XCI
bridges etc, and we try to run this role again, Ansible may have changed
its mind about what interface is active and it could default to one of
the bridges. This forces the role to redo the network configuration but
this time the bridges are being attached to bridges so everything goes
terribly wrong after that. The way to solve this would be to add a local
fact about what interface should be considered as the 'real' default one
so subsequent calls to this role to not destroy the network.

This also drops the task which removed the network configuration files
on SUSE platforms since Ansible is smart enough to not touch them if
they are configured properly.

Change-Id: Ic0525e934b1934a40d69e6cf977615ab9b3dac6d
Signed-off-by: Markos Chandras <mchandras@suse.de>
xci/playbooks/roles/bootstrap-host/handlers/main.yml [new file with mode: 0644]
xci/playbooks/roles/bootstrap-host/tasks/network.yml