From 49b268634a1aacf6762689f3a829fa668faab4f3 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Wed, 18 Oct 2023 12:28:31 +0200 Subject: [PATCH] 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] https://github.com/ansible/ansible/blob/74f6e6a134fa4fe57a80c6c0748772ac13182f1b/lib/ansible/executor/task_queue_manager.py#L128C5-L128C26 Change-Id: Ib422f181256a67cbde4b485c1f1e9079d0400faf --- scripts/add-compute.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/add-compute.sh b/scripts/add-compute.sh index 4f0061f862..3f4aab36c4 100755 --- a/scripts/add-compute.sh +++ b/scripts/add-compute.sh @@ -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"