James E. Blair b7fa1115f3 Move dib image output to /opt
In some clouds we don't have enough space on / to store a raw image,
so tell dib to write the image output to /opt.

Change-Id: Ia3d13ed811f705a450030a2046b2cd1ffd5a22b3
2024-11-21 08:48:51 -08:00

57 lines
1.3 KiB
YAML

# Run the checksums in the background while we're uploading
- name: Get sha256 hash
stat:
path: '{{ filename }}'
checksum_algorithm: sha256
async: 600
poll: 0
register: sha256_task
- name: Get md5 hash
stat:
path: '{{ filename }}'
checksum_algorithm: md5
async: 600
poll: 0
register: md5_task
- name: Upload image to swift
no_log: true
image_upload_swift:
cloud: '{{ cloud }}'
container: '{{ container }}'
filename: '{{ filename }}'
name: '{{ name }}'
delete_after: '{{ delete_after }}'
register: upload_results
- name: Wait for sha256
async_status:
jid: "{{ sha256_task.ansible_job_id }}"
register: sha256
until: sha256.finished
retries: 1
delay: 10
- name: Wait for md5
async_status:
jid: "{{ md5_task.ansible_job_id }}"
register: md5
until: md5.finished
retries: 1
delay: 10
- name: Return artifact to Zuul
zuul_return:
data:
zuul:
artifacts:
- name: '{{ upload_image_format }} image'
url: '{{ upload_results.url }}'
metadata:
type: 'zuul_image'
image_name: '{{ build_diskimage_image_name }}'
format: '{{ upload_image_format }}'
sha256: '{{ sha256.stat.checksum }}'
md5sum: '{{ md5.stat.checksum }}'