openstack-ansible-lxc_hosts/vars/redhat-7.yml
Jesse Pretorius a5e5567369 Improve LXC cache preparation process
Without this patch, any errors that happen during the
'apt-get update' execution will cause the 'apt-get install'
execution to never happen.

This patch implements the following:

- It sets the cache prep script to exit on error to ensure
  that the task fails if there is an error.

- It splits the upgrade and install command on to different
  lines to ensure that each command's success can be
  determined individually.

- It removes the clearing of the archive metadata introduced
  in https://review.openstack.org/310091 as this also removes
  apt lock files and other things which should not be removed.
  Removing all this is unnecessary with the new cache prep
  process and the 'apt-get clean' execution later clears the
  cache before it is packaged.

- It removes the copy of /etc/apt/sources.list.d/ from the host
  to prevent a situation where a host apt source requires
  additional packages to be installed (for example curl) and
  those packages can't be installed due to the 'apt-get update'
  command failing because the package to update the index is
  missing.

Change-Id: I07a864e4125a7fc076cbf5bf7380a8e34e6d2d7c
2016-06-23 11:43:34 -05:00

72 lines
1.9 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.
lxc_download_url: "https://linuxcontainers.org/downloads/lxc/lxc-2.0.1.tar.gz"
# Required rpm packages.
lxc_packages:
- '@Development Tools'
- automake
- autoconf
- bridge-utils
- debootstrap
- docbook2X
- dnsmasq
- git
- graphviz
- libseccomp
- libseccomp-devel
- libcap-devel
- libselinux
- libselinux-devel
- python-devel
- python34-libs
- python34-devel
- pkgconfig
- redhat-lsb
- xz
lxc_cache_map:
distro: centos
arch: amd64
release: 7
copy_from_host:
- /etc/yum.repos.d/
- /etc/pki/rpm-gpg/
- /etc/resolv.conf
cache_prep_commands: |
yum install -y {{ lxc_cache_packages | join(' ') }}
rm -f /usr/bin/python
ln -s /usr/bin/python2.7 /usr/bin/python
/usr/bin/wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -O /tmp/epel-release-latest-7.noarch.rpm
/usr/bin/rpm -ivh /tmp/epel-release-latest-7.noarch.rpm || true
yum clean all
lxc_cache_packages:
- ca-certificates
- openssh-server
- python2
- sudo
- wget
pip_install_options: >
--global-option=build_ext
--global-option="-L/opt/lxc_embedded/x86_64-linux-gnu/"
--global-option="-I/opt/lxc_embedded/include/"
lxc_cached_network_interfaces:
- src: "lxc-net-ifcfg-bridge.cfg.j2"
dest: "/etc/sysconfig/network-scripts/ifcfg-lxcbr0"