debops / ansible-ifupdown

Manage network interface configuration in /etc/network/interfaces
GNU General Public License v3.0
25 stars 14 forks source link

Bridge-Interface is not taken down when "deconfiguring" it #45

Open htgoebel opened 8 years ago

htgoebel commented 8 years ago
  1. Set up debops ifupdown normally. This will get you a bridge interface.
  2. Configure the interface(s) to not use a bridge (see example_static.yml)
  3. Run debops service/ifupdown
  4. The interface config-files are changed, but the bridge-interface is still up.

I'd expect the bridge interface to be down.

drybjed commented 8 years ago

This actually depends on a few things. The debops.ifupdown role needs to know about interfaces you are trying to configure - if you replace the current interface configuration list with a new one without the old interfaces being there and configured for deletion, debops.ifupdown won't touch the old network configuration. The same happens with the ifupdown scripts as well - if the old network configuration is replaced without being turned off first, the scripts lose track of what is confgured and the network configuration is broken.

So the correct steps to change the already configured interfaces to a different set would be:

Of course this is not an issue when you have an already configured interfaces in inventory and apply that configuration to a new host. So it's good to design an interface configuration beforehand, on a disposable VM, expecting to apply that on a new host.

ypid commented 7 years ago

Just tried this with v0.3.0 which is just being released. It should work now as expected thanks to @drybjed who carefully redesigned and updated the role. @htgoebel I can confirm that state: absent removes a prevously configured bridge so this issue can be closed.