diff --git a/inventory/group_vars/all/all.yml b/inventory/group_vars/all/all.yml index 2e203c9852..cb6a113b33 100644 --- a/inventory/group_vars/all/all.yml +++ b/inventory/group_vars/all/all.yml @@ -128,3 +128,9 @@ is_metal: >- {{ (properties is defined) and (properties.is_metal is defined) and (properties.is_metal | bool) }} + +_global_pins_file_path: >- + {{ (lookup('env', 'OSA_CLONE_ROOT') | default('/opt/openstack-ansible', true)) ~ '/global-requirement-pins.txt' }} + +venv_build_global_constraints: >- + {{ lookup('file', _global_pins_file_path).splitlines() | reject('match','^#.*$') | reject('equalto', '') | list }} diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index 3a8af10fd5..1a0623b441 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -176,8 +176,9 @@ sed -i "s|OSA_PLAYBOOK_PATH|${OSA_PLAYBOOK_PATH}|g" /usr/local/bin/openstack-ans # Create openstack ansible wrapper tool cp -v ${OSA_WRAPPER_BIN} /usr/local/bin/openstack-ansible +# Mark the current OSA git repo clone directory, so we don't need to compute it every time. sed -i "s|OSA_CLONE_DIR|${OSA_CLONE_DIR}|g" /usr/local/bin/openstack-ansible -# Mark the current OSA version in the wrapper, so we don't need to compute it everytime. +# Mark the current OSA version in the wrapper, so we don't need to compute it every time. sed -i "s|CURRENT_OSA_VERSION|${CURRENT_OSA_VERSION}|g" /usr/local/bin/openstack-ansible # Ensure wrapper tool is executable diff --git a/scripts/openstack-ansible.sh b/scripts/openstack-ansible.sh index c368c987a7..9044087b72 100644 --- a/scripts/openstack-ansible.sh +++ b/scripts/openstack-ansible.sh @@ -18,7 +18,10 @@ # OpenStack wrapper tool to ease the use of ansible with multiple variable files. export PATH="/opt/ansible-runtime/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${PATH}" + +# These environment variables are used in group_vars export OSA_VERSION="CURRENT_OSA_VERSION" +export OSA_CLONE_ROOT="OSA_CLONE_DIR" function info { if [ "${ANSIBLE_NOCOLOR:-0}" -eq "1" ]; then @@ -32,7 +35,7 @@ function info { RUN_CMD=$(basename ${0}) # Apply the OpenStack-Ansible configuration selectively. -if [[ "${PWD}" == *"OSA_CLONE_DIR"* ]] || [ "${RUN_CMD}" == "openstack-ansible" ]; then +if [[ "${PWD}" == *"${OSA_CLONE_ROOT}"* ]] || [ "${RUN_CMD}" == "openstack-ansible" ]; then # Source the Ansible configuration. . /usr/local/bin/openstack-ansible.rc