openstack-ansible-lxc_hosts/vars/ubuntu-14.04.yml
Jesse Pretorius c2266350c8 Ensure that modified files are kept when installing/upgrading
In a situation where the LXC cache and the apt mirror used do
not have matching package versions, or where the host and the
LXC cache have mismatches, the 'apt-get upgrade' and/or
'apt-get install' actions can fail due to dpkg asking what to
do about the config file mismatches.

This patch ensures that dpkg knows what to do, which is to
keep the existing in-place file (the file copied from the
host). This ensures that whatever apt configuration was
implemented on the host is definitely used in the containers.

Change-Id: I1f8bc785a8acdac71f46eff0e0d9573ba5c62ab3
2016-05-26 16:38:00 +01:00

132 lines
3.4 KiB
YAML

---
# Copyright 2016, 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.
## APT Cache Options
cache_timeout: 600
# Required apt packages.
lxc_packages:
- apparmor
- apparmor-utils
- bridge-utils
- cgmanager
- cgroup-lite
- debootstrap
- dnsmasq
- git
- irqbalance
- language-pack-en
- liblxc1
- lxc
- lxc-dev
- lxc-templates
- python-dev
- python3-lxc
- pxz
lxc_cache_map:
distro: ubuntu
arch: "{{ lxc_architecture_mapping.get( ansible_architecture ) }}"
release: trusty
copy_from_host:
- /etc/apt/sources.list
- /etc/apt/sources.list.d/
- /etc/apt/apt.conf.d/
- /root/repo.keys
cache_prep_commands: |
rm /run/resolvconf/resolv.conf
# This enforces the resolvers from within the image
{% for resolver in lxc_cache_resolvers %}
echo "{{ resolver }}" | tee -a /run/resolvconf/resolv.conf
{% endfor %}
cp /run/resolvconf/resolv.conf /etc/resolvconf/resolv.conf.d/base
echo "# NONE" > /etc/resolvconf/resolv.conf.d/tail
echo "# NONE" > /etc/resolvconf/resolv.conf.d/original
rm -rf /var/lib/apt/lists/*
apt-key add /root/repo.keys
rm /root/repo.keys
{{ lxc_cache_install_command }} {{ lxc_cache_packages | join(' ') }}
apt-get upgrade -y {{ lxc_cache_install_debconf }}
rm -f /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python
mkdir -p /root/.ssh
chmod 700 /root/.ssh
userdel --force --remove ubuntu || true
apt-get clean
lxc_cache_install_command: "export DEBIAN_FRONTEND=noninteractive && apt-get update && apt-get install -y {{ lxc_cache_install_debconf }}"
# This forces any modified configurations to remain, and any unmodified configs to be replaced
# ref: http://serverfault.com/questions/259226/automatically-keep-current-version-of-config-files-when-apt-get-install
lxc_cache_install_debconf: '-o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes'
lxc_cache_packages:
- apt-transport-https
- bridge-utils
- bsdmainutils
- build-essential
- ca-certificates
- cgmanager
- cgmanager-utils
- cgroup-lite
- comerr-dev
- curl
- debconf-utils
- debhelper
- dh-apparmor
- gettext
- gir1.2-glib-2.0
- git
- groff-base
- intltool-debian
- iptables
- iso-codes
- krb5-multidev
- libcgmanager-dev
- libdbus-1-dev
- libdbus-glib-1-2
- libdevmapper-event1.02.1
- libexpat1-dev
- libffi-dev
- libpq-dev
- libpq5
- libpython-dev
- libxml2-dev
- libxslt1-dev
- libxslt1.1
- lvm2
- openssh-server
- python2.7
- python-apt
- python-apt-common
- python-dev
- python-pycurl
- python-software-properties
- python3-apt
- python3-dbus
- python3-gi
- python3-minimal
- python3-pycurl
- python3-software-properties
- software-properties-common
- sqlite3
- ssh
- sshpass
- time
lxc_cached_network_interfaces:
- src: "lxc-net-bridge.cfg.j2"
dest: "/etc/network/interfaces.d/lxc-net-bridge.cfg"