Skip to content

Commit c306122

Browse files
author
Christian Iuga
committed
Add a option to use checksum on get_url of tasks Ensure remote images are downloaded
via volumes[].checksum optional field
1 parent 8d8c78c commit c306122

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tasks/volumes.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
---
22
- name: Ensure remote images are downloaded
33
get_url:
4-
url: "{{ item }}"
5-
dest: "{{ libvirt_vm_image_cache_path }}/{{ item | basename }}"
6-
with_items: "{{ volumes | selectattr('image', 'defined') | map(attribute='image') | list }}"
7-
when: "'http' in item"
4+
url: "{{ item.image }}"
5+
dest: "{{ libvirt_vm_image_cache_path }}/{{ item.image | basename }}"
6+
checksum: "{{ item.checksum | default(omit) }}"
7+
with_items: "{{ volumes | selectattr('image', 'defined') | list }}"
8+
when: "'http' in item.image"
89

910
- name: Ensure local images are copied
1011
copy:

0 commit comments

Comments
 (0)