Remove generic default interfaces

With the implementation of networkd the ENI scripts and config files for
the default interfaces shipped with the lxc container images we use is
no longer useful. These old files can cause conflicts in networking
should the old scripts and networkd get confused especially when it
comes to an interface that is setup for DHCP. This change simply defines
the default interfaces for both suse and ubuntu and ensures they're
deleted.

The interface flush handler has been set to failed when false because on
initial container create the eth0 device may not exist until
systemd-networkd is restarted for the first time.

Change-Id: I70abb5ec4226a81a065e495e19f5e7e0c569e1b0
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
This commit is contained in:
Kevin Carter 2018-03-17 01:50:21 -05:00
parent f2b3780c8d
commit 514a894cce
No known key found for this signature in database
GPG Key ID: 9443251A787B9FB3
3 changed files with 3 additions and 1 deletions

View File

@ -51,6 +51,7 @@
- name: Flush addresses
command: "ip addr flush {{ item.value.interface }}"
with_dict: "{{ lxc_container_networks_combined }}"
failed_when: false
when:
- item.value.interface is defined
listen: Restart networkd

View File

@ -20,6 +20,7 @@
lxc_container_interface: suse-interface.j2
lxc_container_route_interface: suse-routes.j2
lxc_container_default_route_interfaces: "/etc/sysconfig/network/ifroute-{{ item.value.interface }}"
lxc_container_default_interface: "/etc/sysconfig/network/ifcfg-eth0"
# Note this is a used in an iterable and requires the <item.value.interface> variable
lxc_container_interface_target: "/etc/sysconfig/network/ifcfg-{{ item.value.interface }}"

View File

@ -18,7 +18,7 @@
# Remote this in the "R" release.
lxc_container_default_route_interfaces: "/etc/network/interfaces.d/{{ item.value.interface }}.cfg"
lxc_container_interface_target: "/etc/network/interfaces.d/{{ item.value.interface }}.cfg"
lxc_container_default_interface: "/etc/network/interfaces.d/lxc-net-bridge.cfg"
lxc_container_default_interface: "/etc/network/interfaces"
lxc_container_map:
distro: ubuntu