From 541170e5143c74e3cb4d2e05ebe3e6c6386c2956 Mon Sep 17 00:00:00 2001 From: Jose Luis Franco Arza Date: Mon, 3 Feb 2020 10:32:49 +0100 Subject: [PATCH] Swap tasks to avoid non-existing variable error. The upgrade workflow to Stein has a guard task that checks that the --limit option is being used when running the overcloud upgrade run command, as the upgrade needs to be performed node by node due to the operating system upgrade. However, if the --limit option is not passed, the upgrade tasks fails in the task right before the guard, as that task already references the undefined variable. So, it is needed to invert the order so we fail at will in the guard task. Closes-Bug: #1861663 (cherry picked from commit bca35e611bbc8f103e4893282c9b2c49aa4e1e48) Change-Id: I1def295469875e648ad1c9d1e0de00b241acc3fd --- deployment/cinder/cinder-backup-pacemaker-puppet.yaml | 4 ++-- deployment/cinder/cinder-volume-pacemaker-puppet.yaml | 4 ++-- deployment/manila/manila-share-pacemaker-puppet.yaml | 4 ++-- deployment/ovn/ovn-dbs-pacemaker-puppet.yaml | 6 ++---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml index 06fb2b890b..3b704226bb 100644 --- a/deployment/cinder/cinder-backup-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-backup-pacemaker-puppet.yaml @@ -350,8 +350,6 @@ outputs: - groups['cinder_backup'] | length > 1 - item.split('.')[0] in ansible_limit.split(',') loop: "{{ cinder_backup_node_names }}" - - debug: - msg: "Prepare cinder_backup upgrade for {{ cinder_backup_short_node_names_upgraded }}" - fail: msg: > You can't upgrade cinder_backup without @@ -362,6 +360,8 @@ outputs: cinder_backup_short_node_names_upgraded | length == 0 or cinder_backup_node_names_upgraded is not defined or cinder_backup_node_names_upgraded | length == 0 + - debug: + msg: "Prepare cinder_backup upgrade for {{ cinder_backup_short_node_names_upgraded }}" - name: remove cinder_backup init container on upgrade-scaleup to force re-init shell: | if podman inspect cinder_backup_init_bundle &> /dev/null; then diff --git a/deployment/cinder/cinder-volume-pacemaker-puppet.yaml b/deployment/cinder/cinder-volume-pacemaker-puppet.yaml index 79c5d8f9c0..a5a8f4db10 100644 --- a/deployment/cinder/cinder-volume-pacemaker-puppet.yaml +++ b/deployment/cinder/cinder-volume-pacemaker-puppet.yaml @@ -336,8 +336,6 @@ outputs: - groups['cinder_volume'] | length > 1 - item.split('.')[0] in ansible_limit.split(',') loop: "{{ cinder_volume_node_names }}" - - debug: - msg: "Prepare cinder_volume upgrade for {{ cinder_volume_short_node_names_upgraded }}" - fail: msg: > You can't upgrade cinder_volume without @@ -348,6 +346,8 @@ outputs: cinder_volume_short_node_names_upgraded | length == 0 or cinder_volume_node_names_upgraded is not defined or cinder_volume_node_names_upgraded | length == 0 + - debug: + msg: "Prepare cinder_volume upgrade for {{ cinder_volume_short_node_names_upgraded }}" - name: remove cinder_volume init container on upgrade-scaleup to force re-init shell: | if podman inspect cinder_volume_init_bundle &> /dev/null; then diff --git a/deployment/manila/manila-share-pacemaker-puppet.yaml b/deployment/manila/manila-share-pacemaker-puppet.yaml index d638c353bd..970a4baeec 100644 --- a/deployment/manila/manila-share-pacemaker-puppet.yaml +++ b/deployment/manila/manila-share-pacemaker-puppet.yaml @@ -336,8 +336,6 @@ outputs: - groups['manila_share'] | length > 1 - item.split('.')[0] in ansible_limit.split(',') loop: "{{ manila_share_node_names }}" - - debug: - msg: "Prepare manila_share upgrade for {{ manila_share_short_node_names_upgraded }}" - fail: msg: > You can't upgrade manila_share without @@ -348,6 +346,8 @@ outputs: manila_share_short_node_names_upgraded | length == 0 or manila_share_node_names_upgraded is not defined or manila_share_node_names_upgraded | length == 0 + - debug: + msg: "Prepare manila_share upgrade for {{ manila_share_short_node_names_upgraded }}" - name: remove manila_share init container on upgrade-scaleup to force re-init shell: | if podman inspect manila_share_init_bundle &> /dev/null; then diff --git a/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml b/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml index 11c74c44ec..e93a432ba9 100644 --- a/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml +++ b/deployment/ovn/ovn-dbs-pacemaker-puppet.yaml @@ -375,9 +375,6 @@ outputs: - groups['ovn_dbs'] | length > 1 - item.split('.')[0] in ansible_limit.split(',') loop: "{{ ovn_dbs_short_node_names }}" - - - debug: - msg: "Prepare ovn_dbs upgrade for {{ ovn_dbs_short_node_names_upgraded }}" - fail: msg: > You can't upgrade ovn_dbs without staged @@ -386,7 +383,8 @@ outputs: when: >- ovn_dbs_short_node_names_upgraded is not defined or ovn_dbs_short_node_names_upgraded | length == 0 - + - debug: + msg: "Prepare ovn_dbs upgrade for {{ ovn_dbs_short_node_names_upgraded }}" - name: remove ovn_dbs init container on upgrade-scaleup to force re-init shell: | if podman inspect ovn_dbs_init_bundle &> /dev/null; then