Files
openstack-ansible/playbooks/roles/lxc_container_create/defaults/main.yml
Kevin Carter ef0d28eb80 Adds the ability to define repositories within a container
This change implements the ability to set the apt repositories
within a container upon container create from both a deployed
image as well as when using the lxc-openstack container build
template.

* There are two new namespaced variables that set the main
  and security repositories for Ubuntu. These two variables
  are the same in both the `lxc_container_create` and `lxc_hosts`
  roles. These two new variables have been set as defaults in their
  respective roles.

* The method by which the template and container create deploy the
  repositories within the container is the same. The old sources list
  is removed and the new entries are created. This will provide a
  consistent experience between hosts and containers as they can now
  use the same repositories without human intervention.

With this change it will now be possible to deploy containers within
a walled garden where the apt repository may not be publicly
accessible.

Juno-Backport-Potential
Closes-Bug: #1433412
Change-Id: Iaf51a5e3919f684b20da370a9470dc45e2452d4e
2015-03-17 23:28:42 -05:00

62 lines
2.1 KiB
YAML

---
# 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.
lxc_container_config: /etc/lxc/lxc-openstack.conf
# Default container template to build from
lxc_container_template: openstack
# container_fs.* is only used with building on an LVM backend
lxc_container_fs_size: 5G
lxc_container_fs_type: ext4
# Default store is lvm, however will fall back to dir if the
# container_volume_group is not found.
lxc_container_backing_store: lvm
lxc_container_vg_name: lxc
# Default image to build from
lxc_container_release: trusty
lxc_container_template_main_apt_repo: "http://archive.ubuntu.com/ubuntu"
lxc_container_template_security_apt_repo: "http://security.ubuntu.com/ubuntu"
lxc_container_default_interfaces: |
# The loopback network interface
auto lo
iface lo inet loopback
# LXC interface, this is ALWAYS assumed to be DHCP.
auto eth0
iface eth0 inet dhcp
# Load any additional configs
source /etc/network/interfaces.d/*.cfg
# The container interface variable is a a default object that assume the
# Ansible iterator type is `with_dict`.
lxc_container_interface: |
### start generated network for [ {{ item.value.interface }} ] ###
auto {{ item.value.interface }}
{% if item.value.address is defined %}
iface {{ item.value.interface }} inet static
address {{ item.value.address }}
netmask {{ item.value.netmask }}
{% if item.value.gateway is defined %}
gateway {{ item.value.gateway }}
{% endif %}
{% else %}
iface {{ item.value.interface }} inet manual
{% endif %}
### end generated network for [ {{ item.value.interface }} ] ###