Default cinder_volume_node_names to []

There are cases when cinder_volume_node_names is not defined. It was
fixed for "set cinder_volume upgrade node facts from the limit option"
task in loop but never for non HA task. So, standalone upgrade job
fails with the following message.

"msg": "The task includes an option with an undefined variable. The
error was: 'cinder_volume_node_names' is undefined\n\nThe error appears
to be in
'/home/zuul/standalone-ansible-YpY5Oe/Standalone/upgrade_tasks_step1.yaml':
line 27, column 5, but may\nbe elsewhere in the file depending on the
exact syntax problem.\n\nThe offending line appears to be:\n\n- block:\n
- name: set cinder_volume upgrade node facts in a single-node
environment\n    ^ here\n",

This patch defaults cinder_volume_node_names to [] when
cinder_volume_node_names is not defined in hiera.

Closes-Bug: #1897760
Change-Id: I1145c39e379ac6579662f2bbfcc9a4d2d3e0f059
(cherry picked from commit 0f7ed0b8d5)
This commit is contained in:
Sergii Golovatiuk 2020-09-29 17:17:44 +02:00
parent a1bdd62ce9
commit 1f5218100e
1 changed files with 1 additions and 1 deletions

View File

@ -316,7 +316,7 @@ outputs:
- name: set cinder_volume upgrade node facts in a single-node environment
set_fact:
cinder_volume_short_node_names_upgraded: "{{ cinder_volume_short_node_names }}"
cinder_volume_node_names_upgraded: "{{ cinder_volume_node_names }}"
cinder_volume_node_names_upgraded: "{{ cinder_volume_node_names | default([]) }}"
cacheable: no
when: groups['cinder_volume'] | length <= 1
- name: set cinder_volume upgrade node facts from the limit option