Improve suspend/resume of leapfrog
While we could do better by using other mechanisms than shell scripts, this commit sticks to the current method of doing (having marker files), to mark steps that were missing a marker. On top of it, you couldn't resume from a leapfrog that's started from a shell script, because the readlink failed. Change-Id: I73f09bb8214741772545c73fac5e5fdb5698c52e
This commit is contained in:
parent
9d282388ac
commit
6178be497b
@ -204,6 +204,12 @@ function set_upgrade_vars {
|
||||
export ANSIBLE_INVENTORY="/opt/leap42/openstack-ansible-${RELEASE}/playbooks/inventory"
|
||||
export CONFIG_DIR="/etc/openstack_deploy"
|
||||
;;
|
||||
NEWTON)
|
||||
export RELEASE="${NEWTON_RELEASE}"
|
||||
export UPGRADES_TO_TODOLIST=""
|
||||
export ANSIBLE_INVENTORY="/opt/leap42/openstack-ansible-${RELEASE}/playbooks/inventory"
|
||||
export CONFIG_DIR="/etc/openstack_deploy"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
@ -262,33 +268,36 @@ function pre_flight {
|
||||
exit 99
|
||||
fi
|
||||
|
||||
# Don't run this over and over again if the variables above are not set!
|
||||
pushd /opt/leap42
|
||||
# Using this lookup plugin because it allows us to compile exact service releaes and build a complete venv from it
|
||||
wget https://raw.githubusercontent.com/openstack/openstack-ansible-plugins/e069d558b3d6ae8fc505d406b13a3fb66201a9c7/lookup/py_pkgs.py -O py_pkgs.py
|
||||
chmod +x py_pkgs.py
|
||||
popd
|
||||
if [[ ! -f /opt/leap42/rebootstrap-ansible ]]; then
|
||||
# Don't run this over and over again if the variables above are not set!
|
||||
pushd /opt/leap42
|
||||
# Using this lookup plugin because it allows us to compile exact service releaes and build a complete venv from it
|
||||
wget https://raw.githubusercontent.com/openstack/openstack-ansible-plugins/e069d558b3d6ae8fc505d406b13a3fb66201a9c7/lookup/py_pkgs.py -O py_pkgs.py
|
||||
chmod +x py_pkgs.py
|
||||
popd
|
||||
|
||||
apt-get update > /dev/null
|
||||
apt-get -y install liberasurecode-dev > /dev/null
|
||||
apt-get update > /dev/null
|
||||
apt-get -y install liberasurecode-dev > /dev/null
|
||||
|
||||
# Upgrade pip if it's needed. This will re-install pip using the constraints and then
|
||||
# re-install all of the remaining requirements as needed.
|
||||
if dpkg --compare-versions "$(pip --version | awk '{print $2}')" "lt" "9.0.1"; then
|
||||
wget https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py -O /opt/get-pip.py
|
||||
rm -rf /usr/local/lib/python2.7/dist-packages/{setuptools,wheel,pip,distutils,packaging}*
|
||||
python /opt/get-pip.py --constraint "${SYSTEM_PATH}/lib/upgrade-requirements.txt" --force-reinstall --upgrade --isolated
|
||||
pip install --requirement "${SYSTEM_PATH}/lib/upgrade-requirements.txt" --upgrade --isolated
|
||||
# Upgrade pip if it's needed. This will re-install pip using the constraints and then
|
||||
# re-install all of the remaining requirements as needed.
|
||||
if dpkg --compare-versions "$(pip --version | awk '{print $2}')" "lt" "9.0.1"; then
|
||||
wget https://raw.githubusercontent.com/pypa/get-pip/430ba37776ae2ad89f794c7a43b90dc23bac334c/get-pip.py -O /opt/get-pip.py
|
||||
rm -rf /usr/local/lib/python2.7/dist-packages/{setuptools,wheel,pip,distutils,packaging}*
|
||||
python /opt/get-pip.py --constraint "${SYSTEM_PATH}/lib/upgrade-requirements.txt" --force-reinstall --upgrade --isolated
|
||||
pip install --requirement "${SYSTEM_PATH}/lib/upgrade-requirements.txt" --upgrade --isolated
|
||||
fi
|
||||
|
||||
if [[ -d "/opt/ansible-runtime" ]]; then
|
||||
rm -rf "/opt/ansible-runtime"
|
||||
fi
|
||||
|
||||
virtualenv /opt/ansible-runtime
|
||||
PS1="\\u@\h \\W]\\$" . "/opt/ansible-runtime/bin/activate"
|
||||
pip install "ansible==1.9.3" "netaddr>=0.7.12,<=0.7.13" --force-reinstall --upgrade --isolated
|
||||
deactivate
|
||||
touch /opt/leap42/rebootstrap-ansible
|
||||
fi
|
||||
|
||||
if [[ -d "/opt/ansible-runtime" ]]; then
|
||||
rm -rf "/opt/ansible-runtime"
|
||||
fi
|
||||
|
||||
virtualenv /opt/ansible-runtime
|
||||
PS1="\\u@\h \\W]\\$" . "/opt/ansible-runtime/bin/activate"
|
||||
pip install "ansible==1.9.3" "netaddr>=0.7.12,<=0.7.13" --force-reinstall --upgrade --isolated
|
||||
deactivate
|
||||
}
|
||||
|
||||
function run_items {
|
||||
|
@ -27,7 +27,7 @@ export NEWTON_RELEASE="${NEWTON_RELEASE:-14.2.3}" # commit used due to packagin
|
||||
|
||||
## Environment Vars ------------------------------------------------------------------
|
||||
export MAIN_PATH="${MAIN_PATH:-/opt/openstack-ansible}"
|
||||
export SYSTEM_PATH="$(dirname $(readlink -f $0))"
|
||||
export SYSTEM_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../ && pwd )"
|
||||
export UPGRADE_UTILS="${UPGRADE_UTILS:-${SYSTEM_PATH}/upgrade-utilities}"
|
||||
|
||||
# If the the OpenStack-Ansible system venvs have already been built elsewhere and can be downloaded
|
||||
|
@ -59,16 +59,20 @@ if [[ ! -f "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}-prep.leap" ]]; then
|
||||
touch "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}-prep.leap"
|
||||
fi
|
||||
|
||||
RUN_TASKS=()
|
||||
|
||||
RUN_TASKS+=("${UPGRADE_UTILS}/cinder-volume-container-lvm-check.yml")
|
||||
RUN_TASKS+=("${UPGRADE_UTILS}/db-backup.yml")
|
||||
if [[ ! -f "/opt/leap42/openstack-ansible-prep-finalsteps.leap" ]]; then
|
||||
RUN_TASKS=()
|
||||
|
||||
# temp upgrade ansible is used to ensure 1.9.x compat.
|
||||
PS1="\\u@\h \\W]\\$" . "/opt/ansible-runtime/bin/activate"
|
||||
run_items "/opt/leap42/openstack-ansible-${RELEASE}"
|
||||
deactivate
|
||||
unset ANSIBLE_INVENTORY
|
||||
RUN_TASKS+=("${UPGRADE_UTILS}/cinder-volume-container-lvm-check.yml")
|
||||
RUN_TASKS+=("${UPGRADE_UTILS}/db-backup.yml")
|
||||
|
||||
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
||||
system_bootstrap "/opt/openstack-ansible"
|
||||
# temp upgrade ansible is used to ensure 1.9.x compat.
|
||||
PS1="\\u@\h \\W]\\$" . "/opt/ansible-runtime/bin/activate"
|
||||
run_items "/opt/leap42/openstack-ansible-${RELEASE}"
|
||||
deactivate
|
||||
unset ANSIBLE_INVENTORY
|
||||
|
||||
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
||||
system_bootstrap "/opt/openstack-ansible"
|
||||
touch "/opt/leap42/openstack-ansible-prep-finalsteps.leap"
|
||||
fi
|
||||
|
@ -124,10 +124,12 @@ if [[ ! -f "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}.leap" ]] && [[ "${UP
|
||||
fi
|
||||
|
||||
### Run host upgrade
|
||||
notice 'Running host upgrade'
|
||||
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
||||
RUN_TASKS=()
|
||||
RUN_TASKS+=("${UPGRADE_UTILS}/pip-conf-purge.yml")
|
||||
RUN_TASKS+=("openstack-hosts-setup.yml")
|
||||
run_items "/opt/openstack-ansible"
|
||||
### Run host upgrade
|
||||
if [[ ! -f "/opt/leap42/openstack-ansible-upgrade-hostupgrade.leap" ]]; then
|
||||
notice 'Running host upgrade'
|
||||
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
||||
RUN_TASKS=()
|
||||
RUN_TASKS+=("${UPGRADE_UTILS}/pip-conf-purge.yml")
|
||||
RUN_TASKS+=("openstack-hosts-setup.yml")
|
||||
run_items "/opt/openstack-ansible"
|
||||
tag_leap_success "upgrade-hostupgrade"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user