Retry fetching {{ deployment_uuid }}.notify.json file

During a deployment, there is a small chance that right after
55-heat-config run, the {{ deployment_uuid }}.notify.json file doesn't
exist yet on the filesystem.

This patch will retry to fetch the file during 20s and return an error
message if it can't be found.

Change-Id: Ia29944a07900ff36d5d4a5826cdd076d11864962
Closes-Bug: #1887846
(cherry picked from commit e6634751e5)
This commit is contained in:
Emilien Macchi 2020-07-16 14:34:40 -04:00
parent d9433a5af0
commit 258a4af146
1 changed files with 2 additions and 0 deletions

View File

@ -185,6 +185,7 @@
- name: "Run deployment {{ item }}"
shell: |
/usr/libexec/os-refresh-config/configure.d/55-heat-config
timeout 20 bash -c -- 'while [ ! -f /var/lib/heat-config/deployed/{{ deployment_uuid }}.notify.json ]; do sleep 1; done'
exit $(jq .deploy_status_code /var/lib/heat-config/deployed/{{ deployment_uuid }}.notify.json)
become: true
environment:
@ -196,6 +197,7 @@
- name: "Run async deployment {{ item }}"
shell: |
/usr/libexec/os-refresh-config/configure.d/55-heat-config
timeout 20 bash -c -- 'while [ ! -f /var/lib/heat-config/deployed/{{ deployment_uuid }}.notify.json ]; do sleep 1; done'
exit $(jq .deploy_status_code /var/lib/heat-config/deployed/{{ deployment_uuid }}.notify.json)
become: true
environment: