From f21bb596ab6cace65ba9fcea160802c73a8123f5 Mon Sep 17 00:00:00 2001 From: Jesse Pretorius Date: Tue, 9 Feb 2016 18:53:52 +0000 Subject: [PATCH] Set container apt sources to use a configured list of components re: http://lists.openstack.org/pipermail/openstack-dev/2016-February/086000.html Ubuntu has 4 different 'components' - main, universe, multiverse and restricted: - Main: Officially supported software. - Restricted: Supported software that is not available under a completely free license. - Universe: Community maintained software, i.e. not officially supported software. - Multiverse: Software that is not free. Practically speaking there should be nothing particularly useful to OpenStack-Ansible in Restricted or Multiverse - it's mostly software for desktop users. This patch introduces a new variable 'lxc_container_template_apt_components' which is a list of the components to configure in the apt sources list. The default list does not include the unnecessary components. Change-Id: I0eef6454d273f5ba1977a68151fbf6103ff3ed8d --- defaults/main.yml | 4 +++- templates/sources.list.j2 | 10 +++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index c72c2168..0be4eae4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -55,7 +55,9 @@ lxc_container_template_options: > lxc_container_template_main_apt_repo: "https://mirror.rackspace.com/ubuntu" lxc_container_template_security_apt_repo: "https://mirror.rackspace.com/ubuntu" - +lxc_container_template_apt_components: + - main + - universe # Required apt packages. lxc_apt_packages: diff --git a/templates/sources.list.j2 b/templates/sources.list.j2 index 3190b2b6..fa9a336b 100644 --- a/templates/sources.list.j2 +++ b/templates/sources.list.j2 @@ -1,5 +1,5 @@ -# Sources created by the ansible -deb {{ lxc_container_template_main_apt_repo }} {{ lxc_container_release }} main restricted universe multiverse -deb {{ lxc_container_template_main_apt_repo }} {{ lxc_container_release }}-updates main restricted universe multiverse -deb {{ lxc_container_template_main_apt_repo }} {{ lxc_container_release }}-backports main restricted universe multiverse -deb {{ lxc_container_template_security_apt_repo }} {{ lxc_container_release }}-security main restricted universe multiverse +# {{ ansible_managed }} +deb {{ lxc_container_template_main_apt_repo }} {{ lxc_container_release }} {{ lxc_container_template_apt_components | join(" ") }} +deb {{ lxc_container_template_main_apt_repo }} {{ lxc_container_release }}-updates {{ lxc_container_template_apt_components | join(" ") }} +deb {{ lxc_container_template_main_apt_repo }} {{ lxc_container_release }}-backports {{ lxc_container_template_apt_components | join(" ") }} +deb {{ lxc_container_template_security_apt_repo }} {{ lxc_container_release }}-security {{ lxc_container_template_apt_components | join(" ") }}