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:
parent
ff4f10fae9
commit
0d7b20c387
@ -43,6 +43,7 @@ info_block "Bootstrapping System with Ansible"
|
||||
|
||||
# Set the variable to the role file to be the absolute path
|
||||
ANSIBLE_ROLE_FILE="$(readlink -f "${ANSIBLE_ROLE_FILE}")"
|
||||
OSA_INVENTORY_PATH="$(readlink -f playbooks/inventory)"
|
||||
|
||||
# Create the ssh dir if needed
|
||||
ssh_key_create
|
||||
@ -132,10 +133,9 @@ if [ -f "${ANSIBLE_ROLE_FILE}" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# Copy the OSA Ansible rc file into place
|
||||
if [[ ! -f "/usr/local/bin/openstack-ansible.rc" ]]; then
|
||||
cp scripts/openstack-ansible.rc /usr/local/bin/openstack-ansible.rc
|
||||
fi
|
||||
# Write the OSA Ansible rc file
|
||||
sed "s|OSA_INVENTORY_PATH|${OSA_INVENTORY_PATH}|g" scripts/openstack-ansible.rc > /usr/local/bin/openstack-ansible.rc
|
||||
|
||||
|
||||
# Create openstack ansible wrapper tool
|
||||
cat > /usr/local/bin/openstack-ansible <<EOF
|
||||
|
@ -14,7 +14,7 @@
|
||||
|
||||
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}"
|
||||
mkdir -p "$(dirname ${ANSIBLE_LOG_PATH})" || unset ANSIBLE_LOG_PATH
|
||||
|
Loading…
Reference in New Issue
Block a user