diff --git a/leap-upgrades/lib/functions.sh b/leap-upgrades/lib/functions.sh index d4e07eb3..eeab4153 100644 --- a/leap-upgrades/lib/functions.sh +++ b/leap-upgrades/lib/functions.sh @@ -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 diff --git a/leap-upgrades/lib/vars.sh b/leap-upgrades/lib/vars.sh index 51850d8b..add340d4 100644 --- a/leap-upgrades/lib/vars.sh +++ b/leap-upgrades/lib/vars.sh @@ -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" diff --git a/leap-upgrades/prep.sh b/leap-upgrades/prep.sh index 5e9abd54..8abc7c95 100755 --- a/leap-upgrades/prep.sh +++ b/leap-upgrades/prep.sh @@ -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