From eececf267fdd90155eb3d6f82d0ac39d6c0e5abb Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Sat, 19 May 2018 13:39:26 -0500 Subject: [PATCH] Add trailing slash to copy files Without the trailing slash the sync task will create a nested directory for the target when is a directory. This change ensures we're copying copying the directories correctly. This behaviour has been documented in the defaults file. Change-Id: I6965e132674238727d69606464f2140ec42d6434 Signed-off-by: Kevin Carter --- defaults/main.yml | 4 ++++ vars/ubuntu-16.04.yml | 4 +++- vars/ubuntu-18.04.yml | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 160204f..9a90436 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -110,6 +110,10 @@ nspawn_cache_map: "{{ _nspawn_cache_map | default({}) }}" # 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. + +# NOTICE: With all of the copy options it should be noted that it's using rsync +# within the task. If the target being copied is a "directory" the path +# should end with a tailing slash. nspawn_default_copy_from_host: - /etc/default/locale - /etc/environment diff --git a/vars/ubuntu-16.04.yml b/vars/ubuntu-16.04.yml index 63f90a4..22e4f17 100644 --- a/vars/ubuntu-16.04.yml +++ b/vars/ubuntu-16.04.yml @@ -58,4 +58,6 @@ _nspawn_cache_map: release: xenial _nspawn_copy_from_host: - - /etc/apt + - /etc/apt/sources.list + - /etc/apt/apt.conf.d/ + - /etc/apt/preferences.d/ diff --git a/vars/ubuntu-18.04.yml b/vars/ubuntu-18.04.yml index 1da12aa..01de84e 100644 --- a/vars/ubuntu-18.04.yml +++ b/vars/ubuntu-18.04.yml @@ -58,4 +58,6 @@ _nspawn_cache_map: release: bionic _nspawn_copy_from_host: - - /etc/apt + - /etc/apt/sources.list + - /etc/apt/apt.conf.d/ + - /etc/apt/preferences.d/