From b77287b87f23b94c07d711fcd776b4731737f381 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Wed, 30 Aug 2017 13:59:30 +0000 Subject: [PATCH] redeploy should be done in the proper folder run_ansible wrapper should work in the latest checkout of OA, which should be in a REDEPLOY folder instead of just a static "/opt/openstack-ansible" Change-Id: I4d20fd7480f2f38e55d3f081c0c0f11726458583 --- leap-upgrades/lib/vars.sh | 3 +++ leap-upgrades/migrations.sh | 7 +++---- leap-upgrades/prep.sh | 3 --- leap-upgrades/re-deploy.sh | 5 +---- leap-upgrades/run-stages.sh | 3 --- leap-upgrades/upgrade.sh | 5 +---- 6 files changed, 8 insertions(+), 18 deletions(-) diff --git a/leap-upgrades/lib/vars.sh b/leap-upgrades/lib/vars.sh index add340d4..1b4dd18a 100644 --- a/leap-upgrades/lib/vars.sh +++ b/leap-upgrades/lib/vars.sh @@ -26,7 +26,10 @@ export MITAKA_RELEASE="${MITAKA_RELEASE:-mitaka-eol}" export NEWTON_RELEASE="${NEWTON_RELEASE:-14.2.7}" ## Environment Vars ------------------------------------------------------------------ +# main path changes with releases leaping export MAIN_PATH="${MAIN_PATH:-/opt/openstack-ansible}" +# this is the final folder for redeploy. +export REDEPLOY_OA_FOLDER="${REDEPLOY_OA_FOLDER:-/opt/openstack-ansible}" export SYSTEM_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )" export UPGRADE_UTILS="${UPGRADE_UTILS:-${SYSTEM_PATH}/upgrade-utilities}" diff --git a/leap-upgrades/migrations.sh b/leap-upgrades/migrations.sh index b2c62cd8..b5df8d96 100755 --- a/leap-upgrades/migrations.sh +++ b/leap-upgrades/migrations.sh @@ -14,9 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# NOTICE: To run this in an automated fashion run the script via -# root@HOSTNAME:/opt/openstack-ansible# echo "YES" | bash scripts/run-upgrade.sh - ## Shell Opts ---------------------------------------------------------------- set -e -u @@ -32,7 +29,9 @@ if [[ ! -f "/opt/leap42/openstack-ansible-poweroff.leap" ]]; then fi RUN_TASKS=() RUN_TASKS+=("${UPGRADE_UTILS}/power-down.yml") - run_items "/opt/openstack-ansible" + # This run_items doesn't care about which folder it runs in, because just + # one task is used, and it's not in the folder + run_items "${REDEPLOY_OA_FOLDER}" tag_leap_success "poweroff" fi diff --git a/leap-upgrades/prep.sh b/leap-upgrades/prep.sh index 8abc7c95..2012196d 100755 --- a/leap-upgrades/prep.sh +++ b/leap-upgrades/prep.sh @@ -14,9 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# NOTICE: To run this in an automated fashion run the script via -# root@HOSTNAME:/opt/openstack-ansible# echo "YES" | bash scripts/run-upgrade.sh - ## Shell Opts ---------------------------------------------------------------- set -e -u diff --git a/leap-upgrades/re-deploy.sh b/leap-upgrades/re-deploy.sh index 9e3d5ece..192a5e06 100755 --- a/leap-upgrades/re-deploy.sh +++ b/leap-upgrades/re-deploy.sh @@ -14,9 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# NOTICE: To run this in an automated fashion run the script via -# root@HOSTNAME:/opt/openstack-ansible# echo "YES" | bash scripts/run-upgrade.sh - ## Shell Opts ---------------------------------------------------------------- set -e -u @@ -142,5 +139,5 @@ if [[ ${REDEPLOY_EXTRA_SCRIPT:-} ]]; then notice "Running extra script before re-deploy" source ${REDEPLOY_EXTRA_SCRIPT} fi -run_items "/opt/openstack-ansible" +run_items "${REDEPLOY_OA_FOLDER}" ### Run the redeploy tasks diff --git a/leap-upgrades/run-stages.sh b/leap-upgrades/run-stages.sh index 67ec75c4..a241dcfd 100755 --- a/leap-upgrades/run-stages.sh +++ b/leap-upgrades/run-stages.sh @@ -14,9 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# NOTICE: To run this in an automated fashion run the script via -# root@HOSTNAME:/opt/openstack-ansible# echo "YES" | bash scripts/run-upgrade.sh - ## Shell Opts ---------------------------------------------------------------- set -e -u diff --git a/leap-upgrades/upgrade.sh b/leap-upgrades/upgrade.sh index 0577b21c..b1175cde 100755 --- a/leap-upgrades/upgrade.sh +++ b/leap-upgrades/upgrade.sh @@ -14,9 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# NOTICE: To run this in an automated fashion run the script via -# root@HOSTNAME:/opt/openstack-ansible# echo "YES" | bash scripts/run-upgrade.sh - ## Shell Opts ---------------------------------------------------------------- set -e -u @@ -130,6 +127,6 @@ if [[ ! -f "/opt/leap42/openstack-ansible-upgrade-hostupgrade.leap" ]]; then RUN_TASKS=() RUN_TASKS+=("${UPGRADE_UTILS}/pip-conf-purge.yml") RUN_TASKS+=("openstack-hosts-setup.yml") - run_items "/opt/openstack-ansible" + run_items "${REDEPLOY_OA_FOLDER}" tag_leap_success "upgrade-hostupgrade" fi