From 0d7b20c387267add8eb918cfe50f9ab66ccb9ed3 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Fri, 14 Oct 2016 12:05:01 +0100 Subject: [PATCH] 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 --- scripts/bootstrap-ansible.sh | 8 ++++---- scripts/openstack-ansible.rc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/bootstrap-ansible.sh b/scripts/bootstrap-ansible.sh index 2af7f4f068..0ba23f289a 100755 --- a/scripts/bootstrap-ansible.sh +++ b/scripts/bootstrap-ansible.sh @@ -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 <