Merge "Avoid keeping re-downloading container caches"
This commit is contained in:
commit
ca676de49b
@ -16,8 +16,9 @@
|
|||||||
- name: Download lxc cache(s)
|
- name: Download lxc cache(s)
|
||||||
get_url:
|
get_url:
|
||||||
url: "{{ item.url }}"
|
url: "{{ item.url }}"
|
||||||
dest: "/var/cache/lxc/{{ item.name }}"
|
dest: "/var/cache/lxc_{{ item.name }}"
|
||||||
mode: "0644"
|
mode: "0644"
|
||||||
|
force: no
|
||||||
register: cache_download
|
register: cache_download
|
||||||
until: cache_download|success
|
until: cache_download|success
|
||||||
with_items: lxc_container_caches
|
with_items: lxc_container_caches
|
||||||
@ -27,19 +28,12 @@
|
|||||||
|
|
||||||
- name: Move lxc cached image into place
|
- name: Move lxc cached image into place
|
||||||
unarchive:
|
unarchive:
|
||||||
src: "/var/cache/lxc/{{ item.name }}"
|
src: "/var/cache/lxc_{{ item.name }}"
|
||||||
dest: "/var/cache/lxc/"
|
dest: "/var/cache/lxc/"
|
||||||
copy: "no"
|
copy: "no"
|
||||||
with_items: lxc_container_caches
|
with_items: lxc_container_caches
|
||||||
|
when: cache_download|changed
|
||||||
tags:
|
tags:
|
||||||
- lxc-cache
|
- lxc-cache
|
||||||
- lxc-cache-unarchive
|
- lxc-cache-unarchive
|
||||||
|
|
||||||
- name: Remove cache tarball
|
|
||||||
file:
|
|
||||||
path: "/var/cache/lxc/{{ item.name }}"
|
|
||||||
state: absent
|
|
||||||
with_items: lxc_container_caches
|
|
||||||
tags:
|
|
||||||
- lxc-cache
|
|
||||||
- lxc-cache-remove
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user