From 559987522a4b42cc41f5347a743600ec0fab8ee1 Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Fri, 18 May 2018 00:41:55 -0500 Subject: [PATCH] Update copy from host options This change removes some more boiler plate and ensures all of the required files are copied into the base container image. Change-Id: I4f74364d0969363297b286ae8327291659d20a00 Signed-off-by: Kevin Carter --- defaults/main.yml | 13 +++++++++++-- vars/redhat-7.yml | 1 - vars/suse-42.yml | 4 +--- vars/ubuntu-16.04.yml | 5 +---- vars/ubuntu-18.04.yml | 5 +---- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index ac85368..e829ea2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -107,11 +107,20 @@ nspawn_cache_prep_dns: nspawn_cache_map: "{{ _nspawn_cache_map | default({}) }}" # Default list of files to copy from the host into the container when the -# default cache is created. +# default cache is created. This list is merged to create the list of files +# to copy into the container base image which is captured under the +# `nspawn_copy_from_host` option. +nspawn_default_copy_from_host: + - /etc/default/locale + - /etc/environment + - /etc/localtime + - /etc/locale.conf + - /etc/protocols + # nspawn_copy_from_host: # - /etc/resolve.conf # - /etc/apt/sources.list -nspawn_copy_from_host: "{{ _nspawn_copy_from_host | default([]) }}" +nspawn_copy_from_host: "{{ nspawn_default_copy_from_host | union(_nspawn_copy_from_host | default([])) }}" # Default list of files to copy from the host into the container when the # default cache is created. This list will be merged with the option diff --git a/vars/redhat-7.yml b/vars/redhat-7.yml index 95f4ab4..c7d860a 100644 --- a/vars/redhat-7.yml +++ b/vars/redhat-7.yml @@ -58,6 +58,5 @@ _nspawn_cache_map: release: 7 _nspawn_copy_from_host: - - /etc/localtime - /etc/pki/rpm-gpg/ - /etc/yum.repos.d/ diff --git a/vars/suse-42.yml b/vars/suse-42.yml index 6eb2b25..63027af 100644 --- a/vars/suse-42.yml +++ b/vars/suse-42.yml @@ -54,9 +54,7 @@ _nspawn_cache_map: release: "{{ hostvars[physical_host]['ansible_distribution_version'] }}" _nspawn_copy_from_host: - - /etc/localtime - - /etc/zypp/repos.d/repo-oss.repo - - /etc/zypp/repos.d/repo-update.repo + - /etc/zypp ## Set default mirror for openSUSE repositories # NOTE(hwoarang): Ensure that the full path to the 'opensuse' directory is used. diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index 8b43be7..047adb8 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -55,7 +55,4 @@ _nspawn_cache_map: release: xenial _nspawn_copy_from_host: - - /etc/apt/apt.conf.d/ - - /etc/apt/preferences.d/ - - /etc/apt/sources.list - - /etc/localtime + - /etc/apt diff --git a/vars/ubuntu-18.04.yml b/vars/ubuntu-18.04.yml index 35d617b..f924b0a 100644 --- a/vars/ubuntu-18.04.yml +++ b/vars/ubuntu-18.04.yml @@ -55,7 +55,4 @@ _nspawn_cache_map: release: bionic _nspawn_copy_from_host: - - /etc/apt/apt.conf.d/ - - /etc/apt/preferences.d/ - - /etc/apt/sources.list - - /etc/localtime + - /etc/apt