diff --git a/leap-upgrades/lib/vars.sh b/leap-upgrades/lib/vars.sh index e15d9c71..05e6be42 100644 --- a/leap-upgrades/lib/vars.sh +++ b/leap-upgrades/lib/vars.sh @@ -48,3 +48,8 @@ export ANSIBLE_LOG_PATH="/opt/leap42/ansible-${LEAP_TIMESTAMP}.log" ## Containers List to Destroy in destroy-old-containers.yml export CONTAINERS_TO_DESTROY='"'"${CONTAINERS_TO_DESTROY:-all_containers:!galera_all:!neutron_agent:!ceph_all:!rsyslog_all}"'"' + +# By default don't skip Swift Upgrade, this option is in place for operators who +# who might want to maximize Swift availablity during the upgrade and want to +# manually upgrade swift after the main deploy +export SKIP_SWIFT_UPGRADE="${SKIP_SWIFT_UPGRADE:-no}" diff --git a/leap-upgrades/re-deploy.sh b/leap-upgrades/re-deploy.sh index 84960609..cbf04f42 100755 --- a/leap-upgrades/re-deploy.sh +++ b/leap-upgrades/re-deploy.sh @@ -127,7 +127,10 @@ if grep -rni "^gnocchi_storage_driver" /etc/openstack_deploy/*.{yaml,yml} | grep RUN_TASKS+=("os-gnocchi-install.yml -e gnocchi_identity_only=true") fi -RUN_TASKS+=("os-swift-install.yml") +if [ "${SKIP_SWIFT_UPGRADE}" != "yes" ]; then + RUN_TASKS+=("os-swift-install.yml") +fi + RUN_TASKS+=("os-gnocchi-install.yml") RUN_TASKS+=("os-ironic-install.yml") RUN_TASKS+=("os-magnum-install.yml") diff --git a/leap-upgrades/upgrade-utilities/power-down.yml b/leap-upgrades/upgrade-utilities/power-down.yml index 44ecb207..e45018f8 100644 --- a/leap-upgrades/upgrade-utilities/power-down.yml +++ b/leap-upgrades/upgrade-utilities/power-down.yml @@ -28,7 +28,6 @@ - barbican - magnum - ironic - - swift - gnocchi - designate - aodh @@ -44,3 +43,13 @@ failed_when: false args: executable: /bin/bash + + - name: Stop swift if not skipped + shell: | + for i in $(ls /etc/init /etc/init.d | grep "swift"); do + service ${i%".conf"*} stop || true; + done + failed_when: false + args: + executable: /bin/bash + when: not lookup('env', 'SKIP_SWIFT_UPGRADE') | bool diff --git a/leap-upgrades/upgrade.sh b/leap-upgrades/upgrade.sh index 7fad31b4..2277288f 100755 --- a/leap-upgrades/upgrade.sh +++ b/leap-upgrades/upgrade.sh @@ -63,9 +63,11 @@ if [[ ! -f "/opt/leap42/openstack-ansible-${KILO_RELEASE}.leap" ]] && [[ "${UPGR RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/user-secrets-adjustments-kilo.yml -e 'osa_playbook_dir=/opt/leap42/openstack-ansible-${KILO_RELEASE}'") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/host-adjustments.yml") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/remove-juno-log-rotate.yml || true") - if [ "$(ansible 'swift_hosts' --list-hosts)" != "No hosts matched" ]; then - RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/swift-ring-adjustments.yml") - RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/swift-repo-adjustments.yml") + if [ "${SKIP_SWIFT_UPGRADE}" != "yes" ]; then + if [ "$(ansible 'swift_hosts' --list-hosts)" != "No hosts matched" ]; then + RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/swift-ring-adjustments.yml") + RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/swift-repo-adjustments.yml") + fi fi run_items "/opt/leap42/openstack-ansible-${KILO_RELEASE}" tag_leap_success "${KILO_RELEASE}-prep"