Add ability to copy more files from LXC host into cache

When preparing the cache, it may be useful to copy more
files into the container cache prior to executing the
package installation. For example, an extra repo config
file may be needed.

This patch allows an optional extra list of files to be
added to the container cache in addition to the existing
set that this defined in vars.

Change-Id: I14a396cda8d1ad23f7ceb61e7867203013f50823
This commit is contained in:
Jesse Pretorius 2017-08-02 11:56:41 +00:00
parent a6af16b424
commit 1a5e775d8e
2 changed files with 10 additions and 4 deletions

View File

@ -102,13 +102,21 @@ lxc_cache_sshd_configuration:
# The compression ratio used when creating the container cache rootfs archive
lxc_image_compression_ratio: 0
# A list of files may be copied into the container image cache during its preparation.
# A list of files may be copied into the container image cache from the
# deployment host during its preparation.
# Example:
# lxc_container_cache_files:
# - src: "/etc/openstack_deploy/files/etc/issue"
# dest: "/etc/issue"
lxc_container_cache_files: []
# A list of files may be copied into the container image cache from the
# LXC host during its preparation.
# Example:
# lxc_container_cache_files_from_host:
# - "/etc/apt/sources.list.d/myrepo.list"
lxc_container_cache_files_from_host: []
# DNS servers to use during cache preparation
lxc_cache_prep_dns:
- "{{ lxc_net_address }}"

View File

@ -69,8 +69,6 @@
when:
- ansible_pkg_mgr == 'apt'
# TODO(evrardjp): replace this with a copy with remote_src: True
# when ansible2.0 will be supported
- name: Rsyncing files from the LXC host to the container cache
shell: |
if [[ -e "{{ item }}" ]]; then
@ -78,7 +76,7 @@
fi
args:
executable: "/bin/bash"
with_items: "{{ lxc_cache_map.copy_from_host }}"
with_items: "{{ (lxc_cache_map.copy_from_host | union(lxc_container_cache_files_from_host)) | list }}"
tags:
- skip_ansible_lint