Merge "Allow variant and extra options to be passed to the cache creation"
This commit is contained in:
commit
d14298ea97
@ -128,12 +128,16 @@ lxc_image_cache_secondary_keyserver: hkp://keyserver.ubuntu.com:80
|
||||
# --arch CONTAINER_ARCH
|
||||
# --force-cache
|
||||
# --server SERVER_TO_GET_IMAGES_FROM
|
||||
lxc_cache_default_variant: default
|
||||
lxc_cache_download_template_extra_options: ""
|
||||
lxc_cache_download_template_options: >
|
||||
--dist {{ lxc_cache_map.distro }}
|
||||
--release {{ lxc_cache_map.release }}
|
||||
--arch {{ lxc_cache_map.arch }}
|
||||
--force-cache
|
||||
--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
|
||||
# provided in EPEL is much too old (1.x).
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
- name: Remove existing cache archive
|
||||
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"
|
||||
tags:
|
||||
- lxc-cache
|
||||
@ -27,7 +27,7 @@
|
||||
shell: |
|
||||
tar -Opc -C /var/lib/lxc/LXC_NAME/rootfs . | {{ lxc_xz_bin }} -{{ lxc_image_compression_ratio }} -c - > rootfs.tar.xz
|
||||
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
|
||||
tags:
|
||||
- skip_ansible_lint
|
||||
|
@ -68,7 +68,7 @@
|
||||
|
||||
- name: Stat the prepared LXC cache
|
||||
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
|
||||
tags:
|
||||
- always
|
||||
|
Loading…
Reference in New Issue
Block a user