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 ANSIBLE_INVENTORY="/opt/leap42/openstack-ansible-${RELEASE}/playbooks/inventory"
|
||||||
export CONFIG_DIR="/etc/openstack_deploy"
|
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
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,33 +268,36 @@ function pre_flight {
|
|||||||
exit 99
|
exit 99
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Don't run this over and over again if the variables above are not set!
|
if [[ ! -f /opt/leap42/rebootstrap-ansible ]]; then
|
||||||
pushd /opt/leap42
|
# Don't run this over and over again if the variables above are not set!
|
||||||
# Using this lookup plugin because it allows us to compile exact service releaes and build a complete venv from it
|
pushd /opt/leap42
|
||||||
wget https://raw.githubusercontent.com/openstack/openstack-ansible-plugins/e069d558b3d6ae8fc505d406b13a3fb66201a9c7/lookup/py_pkgs.py -O py_pkgs.py
|
# Using this lookup plugin because it allows us to compile exact service releaes and build a complete venv from it
|
||||||
chmod +x py_pkgs.py
|
wget https://raw.githubusercontent.com/openstack/openstack-ansible-plugins/e069d558b3d6ae8fc505d406b13a3fb66201a9c7/lookup/py_pkgs.py -O py_pkgs.py
|
||||||
popd
|
chmod +x py_pkgs.py
|
||||||
|
popd
|
||||||
|
|
||||||
apt-get update > /dev/null
|
apt-get update > /dev/null
|
||||||
apt-get -y install liberasurecode-dev > /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
|
# 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.
|
# re-install all of the remaining requirements as needed.
|
||||||
if dpkg --compare-versions "$(pip --version | awk '{print $2}')" "lt" "9.0.1"; then
|
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
|
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}*
|
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
|
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
|
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
|
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 {
|
function run_items {
|
||||||
|
@ -27,7 +27,7 @@ export NEWTON_RELEASE="${NEWTON_RELEASE:-14.2.3}" # commit used due to packagin
|
|||||||
|
|
||||||
## Environment Vars ------------------------------------------------------------------
|
## Environment Vars ------------------------------------------------------------------
|
||||||
export MAIN_PATH="${MAIN_PATH:-/opt/openstack-ansible}"
|
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}"
|
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
|
# 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"
|
touch "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}-prep.leap"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
RUN_TASKS=()
|
|
||||||
|
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/cinder-volume-container-lvm-check.yml")
|
if [[ ! -f "/opt/leap42/openstack-ansible-prep-finalsteps.leap" ]]; then
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/db-backup.yml")
|
RUN_TASKS=()
|
||||||
|
|
||||||
# temp upgrade ansible is used to ensure 1.9.x compat.
|
RUN_TASKS+=("${UPGRADE_UTILS}/cinder-volume-container-lvm-check.yml")
|
||||||
PS1="\\u@\h \\W]\\$" . "/opt/ansible-runtime/bin/activate"
|
RUN_TASKS+=("${UPGRADE_UTILS}/db-backup.yml")
|
||||||
run_items "/opt/leap42/openstack-ansible-${RELEASE}"
|
|
||||||
deactivate
|
|
||||||
unset ANSIBLE_INVENTORY
|
|
||||||
|
|
||||||
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
# temp upgrade ansible is used to ensure 1.9.x compat.
|
||||||
system_bootstrap "/opt/openstack-ansible"
|
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
|
fi
|
||||||
|
|
||||||
### Run host upgrade
|
### Run host upgrade
|
||||||
notice 'Running host upgrade'
|
if [[ ! -f "/opt/leap42/openstack-ansible-upgrade-hostupgrade.leap" ]]; then
|
||||||
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
notice 'Running host upgrade'
|
||||||
RUN_TASKS=()
|
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
|
||||||
RUN_TASKS+=("${UPGRADE_UTILS}/pip-conf-purge.yml")
|
RUN_TASKS=()
|
||||||
RUN_TASKS+=("openstack-hosts-setup.yml")
|
RUN_TASKS+=("${UPGRADE_UTILS}/pip-conf-purge.yml")
|
||||||
run_items "/opt/openstack-ansible"
|
RUN_TASKS+=("openstack-hosts-setup.yml")
|
||||||
### Run host upgrade
|
run_items "/opt/openstack-ansible"
|
||||||
|
tag_leap_success "upgrade-hostupgrade"
|
||||||
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user