From 196807bbda5f7c2dbafff9270b43a571956487f0 Mon Sep 17 00:00:00 2001 From: Michael Gugino Date: Wed, 17 Aug 2016 15:49:25 -0400 Subject: [PATCH] Mask lxc-net.service for systemd On systemd-based systems, lxc-net is started whenever lxc is started. This is because lxc-net is declared as a dependency of lxc. We currently mask the service on upstart systems. We are presently manually configuring the lxcbr0 on all systems, systemd-based systems included. This patch will mask the lxc-net.service to enable lxcbr0 to be brought up without error due to conflicting lxc-net.service. Closes-Bug: #1580766 Change-Id: I099cf638bbb8874ca45b815383de8588fecbe7b6 --- tasks/lxc_net.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tasks/lxc_net.yml b/tasks/lxc_net.yml index 71759141..640fa13e 100644 --- a/tasks/lxc_net.yml +++ b/tasks/lxc_net.yml @@ -41,7 +41,7 @@ tags: - lxc-net -# All installations of LXC on init based systems (upstart primarily) will need to have the +# All installations of LXC will need to have the # the lxc-net service override in place to ensure its not restarted on system boot - name: Drop lxc-net override file for upstart template: @@ -56,6 +56,17 @@ - lxc-files - lxc-net +- name: Mask lxc-net systemd service + file: + src: /dev/null + path: /etc/systemd/system/lxc-net.service + state: link + when: + - pid1_name == "systemd" + tags: + - lxc-files + - lxc-net + # All Debian based systems use the interfaces.d directory for extra network configs # this check ensures the needed source line is in the base config file - name: Ensure networking includes interfaces.d