Skip to content

Commit

Permalink
working but ugly version
Browse files Browse the repository at this point in the history
  • Loading branch information
andreygubarev committed May 30, 2023
1 parent 6be41f4 commit 0cecbd0
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions molecule_qemu/playbooks/create.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"name": "{{ item.name }}",

"image": "{{ item.image }}",
"image_checksum": "{{ item.image_checksum | default(omit) }}",
"image_arch": "{{ item.image_arch | default(qemu_vm_image_arch) }}",
"image_format": "{{ item.image_format | default(qemu_vm_image_format) }}",

Expand Down Expand Up @@ -116,17 +117,18 @@

- name: Fetch images
ansible.builtin.get_url:
url: "{{ item }}"
dest: "{{ molecule_driver_directory }}/images/"
url: "{{ item[0] }}"
checksum: "{{ item[1] }}"
dest: "{{ molecule_driver_directory }}/images/{{ item[0] | basename }}"
mode: "0644"
loop: "{{ molecule_instances | map(attribute='image') | list | unique }}"
loop: "{{ molecule_instances | map(attribute='image') | zip(molecule_instances | map(attribute='image_checksum')) | list | unique }}"
loop_control:
label: "{{ item | basename }}"
label: "{{ item[0] | basename }}"
register: images

- name: Get images
ansible.builtin.set_fact:
images: "{{ images.results | map(attribute='item') | list | zip(images.results | map(attribute='dest') | list) }}"
images: "{{ 0 | extract(images.results | map(attribute='item')) | list | zip(images.results | map(attribute='dest') | list) }}"
images_cache: {}

- name: Set images cache
Expand Down

0 comments on commit 0cecbd0

Please sign in to comment.