Define OSA clone dir in the openstack-ansible.sh script

When the openstack-ansible.sh was extracted from bootstrap.sh,
the resolving from the OSA_CLONE_DIR was broken.

Due to this, the OSA_CLONE_DIR value is empty, and the comparison
in the openstack-ansible is always true, which is not what we
want for external use.

Change-Id: I6a05d3b73838fa646a635831d655f7470df3378f
(cherry picked from commit ecdd3822b6)
This commit is contained in:
Jean-Philippe Evrard 2019-01-29 16:12:27 +01:00 committed by Jesse Pretorius
parent ffcde42688
commit f18e56b45e
3 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,12 @@
---
fixes:
- |
In https://review.openstack.org/582633 an adjustment was made to the
``openstack-ansible`` wrapper which mistakenly changed the intended
behaviour. The wrapper is only meant to include the extra-vars and
invoke the inventory if ``ansible-playbook`` was executed from inside
the ``openstack-ansible`` repository clone (typically
``/opt/openstack-ansible``), but the change made the path irrelevant.
This has now been fixed - ``ansible-playbook`` and ``ansible`` will
only invoke the inventory and include extra vars if it is invoked
from inside the git clone path.

View File

@ -177,6 +177,7 @@ 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
sed -i "s|OSA_CLONE_DIR|${OSA_CLONE_DIR}|g" /usr/local/bin/openstack-ansible
# Ensure wrapper tool is executable
chmod +x /usr/local/bin/openstack-ansible

View File

@ -31,7 +31,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_DIR"* ]] || [ "${RUN_CMD}" == "openstack-ansible" ]; then
# Source the Ansible configuration.
. /usr/local/bin/openstack-ansible.rc