Merge "Allow for Swift Leap Upgrade to be skipped"

This commit is contained in:
Zuul 2018-08-15 19:12:23 +00:00 committed by Gerrit Code Review
commit cdd9c5e98c
4 changed files with 24 additions and 5 deletions

View File

@ -48,3 +48,8 @@ export ANSIBLE_LOG_PATH="/opt/leap42/ansible-${LEAP_TIMESTAMP}.log"
## Containers List to Destroy in destroy-old-containers.yml ## 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}"'"' 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}"

View File

@ -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") RUN_TASKS+=("os-gnocchi-install.yml -e gnocchi_identity_only=true")
fi fi
if [ "${SKIP_SWIFT_UPGRADE}" != "yes" ]; then
RUN_TASKS+=("os-swift-install.yml") RUN_TASKS+=("os-swift-install.yml")
fi
RUN_TASKS+=("os-gnocchi-install.yml") RUN_TASKS+=("os-gnocchi-install.yml")
RUN_TASKS+=("os-ironic-install.yml") RUN_TASKS+=("os-ironic-install.yml")
RUN_TASKS+=("os-magnum-install.yml") RUN_TASKS+=("os-magnum-install.yml")

View File

@ -28,7 +28,6 @@
- barbican - barbican
- magnum - magnum
- ironic - ironic
- swift
- gnocchi - gnocchi
- designate - designate
- aodh - aodh
@ -44,3 +43,13 @@
failed_when: false failed_when: false
args: args:
executable: /bin/bash 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

View File

@ -63,10 +63,12 @@ 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}/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}/host-adjustments.yml")
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/remove-juno-log-rotate.yml || true") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/remove-juno-log-rotate.yml || true")
if [ "${SKIP_SWIFT_UPGRADE}" != "yes" ]; then
if [ "$(ansible 'swift_hosts' --list-hosts)" != "No hosts matched" ]; then if [ "$(ansible 'swift_hosts' --list-hosts)" != "No hosts matched" ]; then
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/swift-ring-adjustments.yml") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/swift-ring-adjustments.yml")
RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/swift-repo-adjustments.yml") RUN_TASKS+=("${UPGRADE_PLAYBOOKS}/swift-repo-adjustments.yml")
fi fi
fi
run_items "/opt/leap42/openstack-ansible-${KILO_RELEASE}" run_items "/opt/leap42/openstack-ansible-${KILO_RELEASE}"
tag_leap_success "${KILO_RELEASE}-prep" tag_leap_success "${KILO_RELEASE}-prep"
fi fi