Commit 750bd22e authored by Visay Keo's avatar Visay Keo

[TASK] Add support for Mac

parent be2bdf67
/config/master/*
/ansible/hosts.ini
.DS_Store
CHANGELOG
=========
3.0.4
- [TASK] Add support for Mac
3.0.3
-----
- [BUGFIX] Remove suggest attribute in composer
3.0.2
-----
......
......@@ -4,8 +4,16 @@
ROOT_DIR=`pwd`
DIR_NAME=$(dirname "$0")
FILE_NAME=$(basename "$0")
BINARY=`readlink -f ${ROOT_DIR}/${DIR_NAME}/${FILE_NAME}`
BINARY=`readlink ${ROOT_DIR}/${DIR_NAME}/${FILE_NAME} -f`
BIN_PATH=${BINARY%/*}
if [ "${BIN_PATH}" == "../*" ]; then
# This is a workaround for mac user to resolve correct link
cd ${ROOT_DIR}/${DIR_NAME}/${BIN_PATH}
BIN_PATH=`pwd`
cd ${ROOT_DIR}
fi
PACKAGE_DIR=${BIN_PATH%/*}
# Colors
......@@ -220,8 +228,7 @@ fi
# Create dynamic inventory file
rm -f ${PACKAGE_DIR}/ansible/hosts.ini
cp ${PACKAGE_DIR}/ansible/hosts.ini.template ${PACKAGE_DIR}/ansible/hosts.ini
sed -i "s/{{ HOST }}/${REMOTE_HOST}/g" ${PACKAGE_DIR}/ansible/hosts.ini
sed "s/{{ HOST }}/${REMOTE_HOST}/g" ${PACKAGE_DIR}/ansible/hosts.ini.template > ${PACKAGE_DIR}/ansible/hosts.ini
# Prepare all parameters for ansible
ANSIBLE_PARAMS="-i ${PACKAGE_DIR}/ansible/hosts.ini ${PACKAGE_DIR}/ansible/playbook.yml"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment