diff --git a/tasks/lxc_net.yml b/tasks/lxc_net.yml index 1632bbca..cff1fd61 100644 --- a/tasks/lxc_net.yml +++ b/tasks/lxc_net.yml @@ -29,6 +29,24 @@ - lxc-bridge - lxc-interfaces +- name: Drop lxc net bridge routes (SUSE) + template: + src: "lxc-net-suse-routes.cfg.j2" + dest: "/etc/sysconfig/network/ifroute-{{ lxc_net_bridge }}" + owner: "root" + group: "root" + mode: "0644" + when: + - lxc_net_gateway is not none + - ansible_pkg_mgr == "zypper" + notify: + - Bring bridge up + tags: + - lxc-files + - lxc-net + - lxc-bridge + - lxc-interfaces + # All Debian installations of LXC use the lxc-net service. This service breaks our network # model and needs to be disabled - name: Disable and stop lxc-net diff --git a/templates/lxc-net-suse-bridge.cfg.j2 b/templates/lxc-net-suse-bridge.cfg.j2 index 061c32aa..7a3b9da3 100644 --- a/templates/lxc-net-suse-bridge.cfg.j2 +++ b/templates/lxc-net-suse-bridge.cfg.j2 @@ -1,17 +1,14 @@ # {{ ansible_managed }} -DEVICE={{ lxc_net_bridge }} BRIDGE='yes' IPADDR={{ lxc_net_address }} NETMASK={{ lxc_net_netmask }} -{% if lxc_net_gateway is not none %} -GATEWAY={{ lxc_net_gateway }} -{% endif %} {% if lxc_net_mtu is defined %} MTU={{ lxc_net_mtu }} {% endif %} BOOTPROTO=static -BRIDGE_STP='on' +STARTMODE=auto +BRIDGE_STP='off' # POST_UP script POST_UP_SCRIPT="compat:suse:ifup-post-{{ lxc_net_bridge }}" # POST_DOWN script diff --git a/templates/lxc-net-suse-routes.cfg.j2 b/templates/lxc-net-suse-routes.cfg.j2 new file mode 100644 index 00000000..1bc2a1c7 --- /dev/null +++ b/templates/lxc-net-suse-routes.cfg.j2 @@ -0,0 +1 @@ +default {{ lxc_net_gateway }}