Add full path to inventory

Bootstrap ansible now generates the proper .rc with the full path
to openstack-ansible inventory. This can still be overriden by
a variable.

Change-Id: Ic6272d2f59e21cadf94c521791018ea2f70b5c33
Partial-Bug: 1633411
This commit is contained in:
Jean-Philippe Evrard 2016-10-14 12:05:01 +01:00 committed by Jesse Pretorius (odyssey4me)
parent ff4f10fae9
commit 0d7b20c387
2 changed files with 5 additions and 5 deletions

View File

@ -43,6 +43,7 @@ info_block "Bootstrapping System with Ansible"
# Set the variable to the role file to be the absolute path # Set the variable to the role file to be the absolute path
ANSIBLE_ROLE_FILE="$(readlink -f "${ANSIBLE_ROLE_FILE}")" ANSIBLE_ROLE_FILE="$(readlink -f "${ANSIBLE_ROLE_FILE}")"
OSA_INVENTORY_PATH="$(readlink -f playbooks/inventory)"
# Create the ssh dir if needed # Create the ssh dir if needed
ssh_key_create ssh_key_create
@ -132,10 +133,9 @@ if [ -f "${ANSIBLE_ROLE_FILE}" ]; then
fi fi
fi fi
# Copy the OSA Ansible rc file into place # Write the OSA Ansible rc file
if [[ ! -f "/usr/local/bin/openstack-ansible.rc" ]]; then sed "s|OSA_INVENTORY_PATH|${OSA_INVENTORY_PATH}|g" scripts/openstack-ansible.rc > /usr/local/bin/openstack-ansible.rc
cp scripts/openstack-ansible.rc /usr/local/bin/openstack-ansible.rc
fi
# Create openstack ansible wrapper tool # Create openstack ansible wrapper tool
cat > /usr/local/bin/openstack-ansible <<EOF cat > /usr/local/bin/openstack-ansible <<EOF

View File

@ -14,7 +14,7 @@
export ANSIBLE_RETRY_FILES_ENABLED="${ANSIBLE_RETRY_FILES_ENABLED:-False}" export ANSIBLE_RETRY_FILES_ENABLED="${ANSIBLE_RETRY_FILES_ENABLED:-False}"
export ANSIBLE_INVENTORY="${ANSIBLE_INVENTORY:-inventory}" export ANSIBLE_INVENTORY="${ANSIBLE_INVENTORY:-OSA_INVENTORY_PATH}"
export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_PATH:-/openstack/log/ansible-logging/ansible.log}" export ANSIBLE_LOG_PATH="${ANSIBLE_LOG_PATH:-/openstack/log/ansible-logging/ansible.log}"
mkdir -p "$(dirname ${ANSIBLE_LOG_PATH})" || unset ANSIBLE_LOG_PATH mkdir -p "$(dirname ${ANSIBLE_LOG_PATH})" || unset ANSIBLE_LOG_PATH