Fix reference to undefined variables when heat-config times out

When an async task times out, it doesn't register its result and
the subsequent task which refers to the result can't look up details
like stderr output or return code.

This change defines the default values to fix reference to unefined
variables.

Closes-Bug: #1958471
Change-Id: I5049e88872bfe3aa8072804cb67e8f7178951d9d
(cherry picked from commit 2cd1fbd87b)
(cherry picked from commit 64e0dc7fdf)
(cherry picked from commit f105287f17)
This commit is contained in:
Takashi Kajinami 2022-01-20 10:42:04 +09:00
parent 173edbafab
commit f8e854a673
1 changed files with 3 additions and 3 deletions

View File

@ -193,11 +193,11 @@
- name: "Output for async deployment {{ item }}"
debug:
msg:
- stderr: "{{ deployment_async_result.stderr.split('\n') }}"
- status_code: "{{ deployment_async_result.rc }}"
- stderr: "{{ deployment_async_result.stderr_lines | default(['Timed out']) }}"
- status_code: "{{ deployment_async_result.rc | default(-1) }}"
tags:
- output
failed_when: deployment_async_result.rc != 0
failed_when: deployment_async_result.rc | default(-1) != 0
when: not ansible_check_mode|bool
- name: "Check-mode for Run deployment {{ item }} (changed status indicates deployment would run)"