openstack-ansible-ops/multi-node-aio/playbooks/openstack-image-setup.yml
alexandrebassel 0fd99e4423 fix intermittent failures when deploying base glance images
CI testing is experiencing intermittent failures when deploying base glance
images as part of the openstack-image-setup.yml playbook which is kicked of
as part of the openstack-service-setup.yml playbook in openstack-ansible-ops.
Since the deployment of these resources rely on external URI endpoints, this
type of failure is something that can occur during a customer deployment.

Change-Id: Ieea0f11482646ea152920a1ff1009a2b03705f1c
2018-08-16 17:02:45 -04:00

31 lines
764 B
YAML

---
# These tasks are included in openstack-service-setup.yml playbook and
# are repeated for each required image file.
- name: Download system image file
get_url:
url: "{{ item.url }}"
dest: "/tmp/os_image_{{ item.name }}"
timeout: 600 # big files might take a while to download
register: download_result
until: download_result|succeeded
retries: 10
delay: 15
failed_when: download_result is failure
- name: Install system image
os_image:
endpoint_type: internal
cloud: default
state: present
is_public: true
name: "{{ item.name }}"
filename: "/tmp/os_image_{{ item.name }}"
disk_format: "{{ item.format }}"
- name: Clean up temp file
file:
path: "/tmp/os_image_{{ item.name }}"
state: absent