Do not fail add-compute.sh script if exit code is 4

Right now exit code 4 stands for hosts being unreachable [1], that might
take place in envoronments at the moment of adding new computes

So instead of failing the script and asking for user to re-run commands
manually we silently proceed when anything fails with unreachable hosts.

[1] 74f6e6a134/lib/ansible/executor/task_queue_manager.py (L128C5-L128C26)

Change-Id: Ib422f181256a67cbde4b485c1f1e9079d0400faf
This commit is contained in:
Dmitriy Rabotyagov 2023-10-18 12:28:31 +02:00
parent 2519b88572
commit 49b268634a
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ function run_tasks {
for item in ${!RUN_TASKS[@]}; do
eval "openstack-ansible ${RUN_TASKS[$item]}"
playbook_status="$?"
if [[ ${playbook_status} -gt 0 ]]; then
if [[ ${playbook_status} -ne 0 && ${playbook_status} -ne 4 ]]; then
echo "*********************** failure ************************"
echo "The compute deployment script has encountered a failure."
echo "Failed on task \"${RUN_TASKS[$item]}\" with status $playbook_status"