Allow overrides of bootstrap ansible script

Some providers may have a different bootstrapping script,
and probably want to use their own instead of always
bootstrapping the OSA one for the leap.

We should be able to give a script as env var, and use
that script for installing an ansible that works for leapfrog.

Change-Id: I034d3dace52ae092e04d4573c6299b464153084d
This commit is contained in:
Jean-Philippe Evrard 2017-08-30 10:00:57 +00:00
parent 33fb2d2ffa
commit a476a4037f
3 changed files with 14 additions and 3 deletions

View File

@ -97,7 +97,15 @@ function run_lock {
set -e
}
function system_bootstrap {
function bootstrap_recent_ansible {
# This ensures that old ansible will be removed
# and that we have a recent enough Ansible version for:
# - the variable upgrades
# - the db migrations
# - the host upgrade
# - the neutron container forget
# - the re deploy, if there was no hook that
# redeployed ansible
if [[ -d "/opt/ansible-runtime" ]]; then
rm -rf "/opt/ansible-runtime"
else
@ -117,7 +125,7 @@ function system_bootstrap {
notice "Removed System installed Ansible"
done
pushd "$1"
pushd "${BOOTSTRAP_ANSIBLE_FOLDER}"
# Install ansible for system migrations
scripts/bootstrap-ansible.sh
popd

View File

@ -40,6 +40,9 @@ export VALIDATE_UPGRADE_INPUT="${VALIDATE_UPGRADE_INPUT:-TRUE}"
export UPGRADES_TO_TODOLIST="${UPGRADES_TO_TODOLIST:-''}"
export CODE_UPGRADE_FROM=""
# Bootstrap ansible tool, see also bootstrap_recent_ansible
export BOOTSTRAP_ANSIBLE_FOLDER=${BOOTSTRAP_ANSIBLE_FOLDER:-/opt/openstack-ansible/}
## Ansible debugging
export LEAP_TIMESTAMP=$(date +%s)
export ANSIBLE_LOG_PATH="/opt/leap42/ansible-${LEAP_TIMESTAMP}.log"

View File

@ -73,6 +73,6 @@ if [[ ! -f "/opt/leap42/openstack-ansible-prep-finalsteps.leap" ]]; then
unset ANSIBLE_INVENTORY
link_release "/opt/leap42/openstack-ansible-${NEWTON_RELEASE}"
system_bootstrap "/opt/openstack-ansible"
bootstrap_recent_ansible
touch "/opt/leap42/openstack-ansible-prep-finalsteps.leap"
fi