Use a venv with previous ansible version for upgrades

When doing the role upgrade, we run every playbook with current's
branch ansible. This is normal for the infrastructure bits (which
are running on current branch), but not for the installation of
the previous branch's role, which should use previous branch's
environment.

Depends-On: I7ebb045885dd645b820de2b7f75b46c755c015f6
Change-Id: I5fbf34688b8930d47cbb36866fe2436ce143ee00
Related-Bug: #1741471
This commit is contained in:
Jean-Philippe Evrard 2018-02-01 10:42:18 +00:00
parent a6ffd476a5
commit 3a47ee875d
3 changed files with 22 additions and 9 deletions

View File

@ -15,6 +15,9 @@
- include: common/setting-nodepool-variables.yml
# Ensure the repo is setup for previous version
- include: common/previous/test-repo-setup.yml
- name: Make /lib/modules accessible on neutron_agent containers
hosts: neutron_agent
user: root

View File

@ -51,7 +51,8 @@ echo "TEST_IDEMPOTENCE: ${TEST_IDEMPOTENCE}"
function execute_ansible_playbook {
export ANSIBLE_CLI_PARAMETERS="${ANSIBLE_PARAMETERS} -e @${ANSIBLE_OVERRIDES}"
CMD_TO_EXECUTE="ansible-playbook ${TEST_PLAYBOOK} $@ ${ANSIBLE_CLI_PARAMETERS}"
export ANSIBLE_BIN=${ANSIBLE_BIN:-"ansible-playbook"}
CMD_TO_EXECUTE="${ANSIBLE_BIN} ${TEST_PLAYBOOK} $@ ${ANSIBLE_CLI_PARAMETERS}"
echo "Executing: ${CMD_TO_EXECUTE}"
echo "With:"
@ -67,13 +68,28 @@ function execute_ansible_playbook {
# Ensure that the Ansible environment is properly prepared
source "${COMMON_TESTS_PATH}/test-ansible-env-prep.sh"
# Prepare environment for the initial deploy of stable/newton Neutron
# Prepare environment for the initial deploy of (previous and current) Neutron
# No upgrading or testing is done yet.
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-newton-neutron-install.log"
# Execute the setup of Stable/Newton Neutron
# Execute the setup of current infrastructure
execute_ansible_playbook
# Prepare environment for the deploy of previous Nova:
# No upgrading or testing is done yet.
export TEST_PLAYBOOK="${WORKING_DIR}/tests/test-install-previous-neutron.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-previous_neutron-install.log"
export PREVIOUS_VENV="ansible-previous"
export ANSIBLE_BIN="${WORKING_DIR}/.tox/${PREVIOUS_VENV}/bin/ansible-playbook"
source ${COMMON_TESTS_PATH}/test-create-previous-venv.sh
# Execute the setup of previous Neutron
execute_ansible_playbook
# Unset previous branch overrides
unset PREVIOUS_VENV
unset ANSIBLE_BIN
# Prepare environment for the upgrade of Neutron
export TEST_PLAYBOOK="${WORKING_DIR}/tests/benchmark-upgrade.yml"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_DIR}/ansible-execute-newton-upgrade.log"

View File

@ -29,9 +29,3 @@
# Install Keystone
- include: common/test-install-keystone.yml
# Ensure the repo is setup for previous version
- include: common/previous/test-repo-setup.yml
# Install previous Neutron
- include: test-install-previous-neutron.yml