From d5bef82dfedc72eb2d51ef899578098c35738085 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Wed, 16 Aug 2017 14:43:45 +0100 Subject: [PATCH] Ubuntu: Use dnsmasq-base, not dnsmasq In Ubuntu the 'dnsmasq' package actually includes init scripts and service configuration which conflict with LXC and are best not included. The actual dependent package is 'dnsmasq-base'. With this change, the cleanup is no longer required because the files are removed by the purge or not installed in the first place. Closes-Bug: #1711140 Change-Id: I0b0a8dec3943651f379479ea1a3b8038736b9219 --- ...asq-lxc-conflict-fix-c8968f6a16d033c6.yaml | 10 +++++++ tasks/lxc_dnsmasq_cleanup.yml | 28 ------------------- tasks/lxc_install_apt.yml | 8 ++++++ tasks/main.yml | 4 --- vars/ubuntu-16.04.yml | 6 +++- 5 files changed, 23 insertions(+), 33 deletions(-) create mode 100644 releasenotes/notes/dnsmasq-lxc-conflict-fix-c8968f6a16d033c6.yaml delete mode 100644 tasks/lxc_dnsmasq_cleanup.yml diff --git a/releasenotes/notes/dnsmasq-lxc-conflict-fix-c8968f6a16d033c6.yaml b/releasenotes/notes/dnsmasq-lxc-conflict-fix-c8968f6a16d033c6.yaml new file mode 100644 index 00000000..e240a38c --- /dev/null +++ b/releasenotes/notes/dnsmasq-lxc-conflict-fix-c8968f6a16d033c6.yaml @@ -0,0 +1,10 @@ +--- +fixes: + - | + In Ubuntu the ``dnsmasq`` package actually includes + init scripts and service configuration which + conflict with LXC and are best not included. The + actual dependent package is ``dnsmasq-base``. The + package list has been adjusted and a task added + to remove the ``dnsmasq`` package and purge the + related configuration files from all LXC hosts. diff --git a/tasks/lxc_dnsmasq_cleanup.yml b/tasks/lxc_dnsmasq_cleanup.yml deleted file mode 100644 index 7ef23a7d..00000000 --- a/tasks/lxc_dnsmasq_cleanup.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -# Copyright 2014, Rackspace US, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -- name: Ensure dnsmasq stopped - service: - name: "dnsmasq" - state: "stopped" - enabled: "no" - -- name: Remove dnsmasq file(s) - file: - path: "{{ item }}" - state: "absent" - with_items: - - /var/run/dnsmasq/resolv.conf - - /etc/dnsmasq.conf diff --git a/tasks/lxc_install_apt.yml b/tasks/lxc_install_apt.yml index 37e9a9a9..54115166 100644 --- a/tasks/lxc_install_apt.yml +++ b/tasks/lxc_install_apt.yml @@ -13,6 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. +- name: Remove conflicting packages + apt: + pkg: "{{ lxc_hosts_remove_distro_packages }}" + state: absent + purge: yes + tags: + - lxc-apt-packages + - name: Install apt packages apt: pkg: "{{ lxc_hosts_distro_packages }}" diff --git a/tasks/main.yml b/tasks/main.yml index f2d11576..0c343a88 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -66,10 +66,6 @@ tags: - lxc_hosts-config -- include: lxc_dnsmasq_cleanup.yml - tags: - - lxc_hosts-config - - include: lxc_cache.yml tags: - lxc_hosts-install diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index 26cd36bd..463f9bb7 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -27,7 +27,7 @@ lxc_hosts_distro_packages: - cgroup-lite - dbus - debootstrap - - dnsmasq + - dnsmasq-base - git - iptables - irqbalance @@ -41,6 +41,10 @@ lxc_hosts_distro_packages: - systemd-container - pxz +# Package to remove from the host +lxc_hosts_remove_distro_packages: + - dnsmasq + lxc_xz_bin: pxz system_config_dir: "/etc/default"