Merge "Update ARA installation and loading"

This commit is contained in:
Zuul 2019-05-13 23:43:49 +00:00 committed by Gerrit Code Review
commit e6bb8532a2
6 changed files with 18 additions and 10 deletions

View File

@ -120,6 +120,11 @@ if [[ -z "${SKIP_OSA_RUNTIME_VENV_BUILD+defined}" ]]; then
build_ansible_runtime_venv
fi
# Install and export the ARA callback plugin
if [ "${SETUP_ARA}" == "true" ]; then
setup_ara
fi
# Get current code version (this runs at the root of OSA clone)
CURRENT_OSA_VERSION=$(cd ${OSA_CLONE_DIR}; /opt/ansible-runtime/bin/python setup.py --version)
@ -192,9 +197,4 @@ if [ -f "${ANSIBLE_ROLE_FILE}" ] && [[ -z "${SKIP_OSA_ROLE_CLONE+defined}" ]]; t
unset ANSIBLE_CONFIG
fi
# Install and export the ARA callback plugin
if [ "${SETUP_ARA}" == "true" ]; then
setup_ara
fi
echo "System is bootstrapped and ready for use."

View File

@ -55,7 +55,7 @@ export INSTALL_METHOD=${3:-"source"}
export UPGRADE_SOURCE_BRANCH=${UPGRADE_SOURCE_BRANCH:-'stable/rocky'}
# enable the ARA callback plugin
export SETUP_ARA=true
export SETUP_ARA=${SETUP_ARA:-true}
## Change branch for Upgrades ------------------------------------------------
# If the action is to upgrade, then store the current SHA,

View File

@ -40,6 +40,14 @@ if [[ "${PWD}" == *"${OSA_CLONE_ROOT}"* ]] || [ "${RUN_CMD}" == "openstack-ansib
# Source the Ansible configuration.
. /usr/local/bin/openstack-ansible.rc
# Load ARA into callback plugins if it is installed
# Dynamically retrieve the location of the ARA callback so we are able to find
# it on both py2 and py3
ara_location=$(python -c "import os,ara; print(os.path.dirname(ara.__file__))" 2>/dev/null || true)
if [[ -n "$ara_location" ]]; then
export ANSIBLE_CALLBACK_PLUGINS="${ANSIBLE_CALLBACK_PLUGINS}:${ara_location}/plugins/callbacks"
fi
# Load userspace group vars
if [[ -d ${OSA_CONFIG_DIR}/group_vars || -d ${OSA_CONFIG_DIR}/host_vars ]]; then
if [[ ! -f ${OSA_CONFIG_DIR}/inventory.ini ]]; then

View File

@ -203,10 +203,6 @@ function setup_ara {
# PIP_OPTS contains the whole set of constraints that need to be applied.
${PIP_COMMAND} install --isolated ${PIP_OPTS} ara "${ANSIBLE_PACKAGE:-ansible}"
fi
# Dynamically retrieve the location of the ARA callback so we are able to find
# it on both py2 and py3
ara_location=$(/opt/ansible-runtime/bin/python -c "import os,ara; print(os.path.dirname(ara.__file__))")
export ANSIBLE_CALLBACK_PLUGINS="/etc/ansible/roles/plugins/callback:${ara_location}/plugins/callbacks"
}
function run_dstat {

View File

@ -30,6 +30,7 @@
# where the CI provided git sources were cloned.
ZUUL_SRC_PATH: "{{ ansible_user_dir }}/src"
ANSIBLE_PACKAGE: "{{ ansible_package | default('') }}"
SETUP_ARA: 'true'
- name: Run bootstrap-aio script
become: yes
become_user: root

View File

@ -14,6 +14,9 @@
chdir: "src/opendev.org/openstack/openstack-ansible"
executable: /bin/bash
environment:
# NOTE(logan): ARA is already installed in the gate environment by the
# pre-osa-aio pre-run playbook
SETUP_ARA: false
# NOTE(logan): The project is bootstrapped in the pre playbook so the
# bootstrapping can be skipped here
SKIP_OSA_RUNTIME_VENV_BUILD: 1