diff --git a/defaults/main.yml b/defaults/main.yml index b3b0065e..4893e5b4 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 }}" diff --git a/tasks/lxc_cache_preparation.yml b/tasks/lxc_cache_preparation.yml index 458131de..f7f59896 100644 --- a/tasks/lxc_cache_preparation.yml +++ b/tasks/lxc_cache_preparation.yml @@ -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