diff --git a/defaults/main.yml b/defaults/main.yml index caf6bb6a..ec820a20 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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). diff --git a/tasks/lxc_cache_create.yml b/tasks/lxc_cache_create.yml index a5352185..6f6980e7 100644 --- a/tasks/lxc_cache_create.yml +++ b/tasks/lxc_cache_create.yml @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index 6e42564f..ad0d8e6f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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