Merge "Allow variant and extra options to be passed to the cache creation"

This commit is contained in:
Jenkins 2017-03-01 15:10:05 +00:00 committed by Gerrit Code Review
commit d14298ea97
3 changed files with 7 additions and 3 deletions

View File

@ -128,12 +128,16 @@ lxc_image_cache_secondary_keyserver: hkp://keyserver.ubuntu.com:80
# --arch CONTAINER_ARCH # --arch CONTAINER_ARCH
# --force-cache # --force-cache
# --server SERVER_TO_GET_IMAGES_FROM # --server SERVER_TO_GET_IMAGES_FROM
lxc_cache_default_variant: default
lxc_cache_download_template_extra_options: ""
lxc_cache_download_template_options: > lxc_cache_download_template_options: >
--dist {{ lxc_cache_map.distro }} --dist {{ lxc_cache_map.distro }}
--release {{ lxc_cache_map.release }} --release {{ lxc_cache_map.release }}
--arch {{ lxc_cache_map.arch }} --arch {{ lxc_cache_map.arch }}
--force-cache --force-cache
--server {{ lxc_image_cache_server }} --server {{ lxc_image_cache_server }}
--variant {{ lxc_cache_default_variant }}
{{ lxc_cache_download_template_extra_options }}
# LXC must be installed from a COPR repository on CentOS 7 since the version # LXC must be installed from a COPR repository on CentOS 7 since the version
# provided in EPEL is much too old (1.x). # provided in EPEL is much too old (1.x).

View File

@ -15,7 +15,7 @@
- name: Remove existing cache archive - name: Remove existing cache archive
file: file:
path: "{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/default/rootfs.tar.xz" path: "{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/{{ lxc_cache_default_variant }}/rootfs.tar.xz"
state: "absent" state: "absent"
tags: tags:
- lxc-cache - lxc-cache
@ -27,7 +27,7 @@
shell: | shell: |
tar -Opc -C /var/lib/lxc/LXC_NAME/rootfs . | {{ lxc_xz_bin }} -{{ lxc_image_compression_ratio }} -c - > rootfs.tar.xz tar -Opc -C /var/lib/lxc/LXC_NAME/rootfs . | {{ lxc_xz_bin }} -{{ lxc_image_compression_ratio }} -c - > rootfs.tar.xz
args: args:
chdir: "{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/default/" chdir: "{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/{{ lxc_cache_default_variant }}/"
notify: Destroy base container notify: Destroy base container
tags: tags:
- skip_ansible_lint - skip_ansible_lint

View File

@ -68,7 +68,7 @@
- name: Stat the prepared LXC cache - name: Stat the prepared LXC cache
stat: stat:
path: "{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/default/rootfs.tar.xz" path: "{{ lxc_container_cache_path }}/{{ lxc_cache_map.distro }}/{{ lxc_cache_map.release }}/{{ lxc_cache_map.arch }}/{{ lxc_cache_default_variant }}/rootfs.tar.xz"
register: lxc_cache_stat register: lxc_cache_stat
tags: tags:
- always - always