Use block/rescue for image pre-stage
Move to usage of block/rescue for image pre-stage step. Change-Id: I4ec91f541e6d2d4cca4d899f4c7d519b169e2f50 Co-Authored-By: Jesse Pretorius <jesse@odyssey4.me>
This commit is contained in:
parent
d22a541395
commit
b393915874
@ -23,26 +23,25 @@
|
||||
when:
|
||||
- lxc_image_cache_refresh | bool
|
||||
|
||||
- name: Ensure image has been pre-staged
|
||||
async_status:
|
||||
jid: "{{ prestage_image.ansible_job_id }}"
|
||||
register: job_result
|
||||
until: job_result.finished
|
||||
ignore_errors: true
|
||||
retries: 60
|
||||
|
||||
- name: Trying to download image with alternate method
|
||||
get_url:
|
||||
url: "{{ lxc_hosts_container_image_url }}"
|
||||
dest: "/tmp/{{ cache_basename }}"
|
||||
validate_certs: "{{ (lxc_hosts_validate_certs | bool) | lower }}"
|
||||
force: true
|
||||
timeout: 15
|
||||
register: image_download
|
||||
until: image_download is success
|
||||
retries: 3
|
||||
delay: 2
|
||||
when: job_result.failed
|
||||
- block:
|
||||
- name: Ensure image has been pre-staged
|
||||
async_status:
|
||||
jid: "{{ prestage_image.ansible_job_id }}"
|
||||
register: job_result
|
||||
until: job_result.finished
|
||||
retries: 60
|
||||
rescue:
|
||||
- name: Trying to download image with alternate method
|
||||
get_url:
|
||||
url: "{{ lxc_hosts_container_image_url }}"
|
||||
dest: "/tmp/{{ cache_basename }}"
|
||||
validate_certs: "{{ (lxc_hosts_validate_certs | bool) | lower }}"
|
||||
force: true
|
||||
timeout: 15
|
||||
register: image_download
|
||||
until: image_download is success
|
||||
retries: 3
|
||||
delay: 2
|
||||
|
||||
- name: Ensure systemd-importd is enabled
|
||||
systemd:
|
||||
|
@ -32,26 +32,25 @@
|
||||
when:
|
||||
- lxc_image_cache_refresh | bool
|
||||
|
||||
- name: Ensure image has been pre-staged
|
||||
async_status:
|
||||
jid: "{{ prestage_image.ansible_job_id }}"
|
||||
register: job_result
|
||||
until: job_result.finished
|
||||
ignore_errors: true
|
||||
retries: 60
|
||||
|
||||
- name: Trying to download image with alternate method
|
||||
get_url:
|
||||
url: "{{ lxc_hosts_container_image_url }}"
|
||||
dest: "/tmp/{{ cache_basename }}"
|
||||
validate_certs: "{{ (lxc_hosts_validate_certs | bool) | lower }}"
|
||||
force: true
|
||||
timeout: 15
|
||||
register: image_download
|
||||
until: image_download is success
|
||||
retries: 3
|
||||
delay: 2
|
||||
when: job_result.failed
|
||||
- block:
|
||||
- name: Ensure image has been pre-staged
|
||||
async_status:
|
||||
jid: "{{ prestage_image.ansible_job_id }}"
|
||||
register: job_result
|
||||
until: job_result.finished
|
||||
retries: 60
|
||||
rescue:
|
||||
- name: Trying to download image with alternate method
|
||||
get_url:
|
||||
url: "{{ lxc_hosts_container_image_url }}"
|
||||
dest: "/tmp/{{ cache_basename }}"
|
||||
validate_certs: "{{ (lxc_hosts_validate_certs | bool) | lower }}"
|
||||
force: true
|
||||
timeout: 15
|
||||
register: image_download
|
||||
until: image_download is success
|
||||
retries: 3
|
||||
delay: 2
|
||||
|
||||
- name: Place container rootfs
|
||||
unarchive:
|
||||
|
Loading…
x
Reference in New Issue
Block a user