blob: 90cbaec98e25347154f52ed58c79e0dd2b3f6830 [file] [log] [blame]
Zack Williamsc989f262017-05-11 13:02:59 -07001---
2# glance-images/tasks/main.yml
3
4- name: Make images directory
5 when: use_openstack
6 become: yes
7 file:
8 path: "{{ image_dir }}"
9 state: directory
10 mode: 0755
11 owner: "{{ ansible_user_id }}"
12 group: "{{ ansible_user_gid }}"
13
14- name: Download Glance VM images
15 when: use_openstack
16 get_url:
17 url: "{{ item.url }}"
18 checksum: "{{ item.checksum }}"
19 dest: "{{ image_dir }}/{{ item.name }}.qcow2"
20 with_items: "{{ xos_images }}"
21 register: glance_vm_result
22 until: glance_vm_result|success
23 retries: 5
24 delay: 10
25
26- name: Copy Glance VM images to profile directory
27 when: use_openstack
28 copy:
29 remote_src: yes
30 src: "{{ image_dir }}/{{ item.name }}.qcow2"
31 dest: "/opt/cord_profile/images/{{ item.name }}.qcow2"
32 with_items: "{{ xos_images }}"
33