Commit 9bc2ad4b authored by Mattia Rizzolo's avatar Mattia Rizzolo

fix some warnings from shellcheck

Signed-off-by: Mattia Rizzolo's avatarMattia Rizzolo <mapreri@ubuntu.com>
parent d980571a
...@@ -8,7 +8,7 @@ DIR_ENVIRONMENTS="envs" ...@@ -8,7 +8,7 @@ DIR_ENVIRONMENTS="envs"
DIR_ROLES="roles" DIR_ROLES="roles"
DIR_GROUP_VARS="group_vars" DIR_GROUP_VARS="group_vars"
FILE_VAULT_PASSWORD="vault-password" #FILE_VAULT_PASSWORD="vault-password"
BIN_ANSIBLE_PLAYBOOK="ansible-playbook" BIN_ANSIBLE_PLAYBOOK="ansible-playbook"
...@@ -40,7 +40,7 @@ if [[ ! -d "${env}" ]]; then ...@@ -40,7 +40,7 @@ if [[ ! -d "${env}" ]]; then
echo echo
echo "available environments:" echo "available environments:"
for available in `ls -1 "${DIR_ENVIRONMENTS}"`; do for available in $(ls -1 "${DIR_ENVIRONMENTS}"); do
echo " - ${available}" echo " - ${available}"
done done
exit 1 exit 1
...@@ -50,8 +50,8 @@ if [[ ! -f "${playbook_file}" ]]; then ...@@ -50,8 +50,8 @@ if [[ ! -f "${playbook_file}" ]]; then
echo echo
echo "available playbooks:" echo "available playbooks:"
for available in `ls -1 "${DIR_PLAYBOOKS}"`; do for available in $(ls -1 "${DIR_PLAYBOOKS}"); do
echo " - `echo "${available}" | sed 's/\.yml$//'`" echo " - ${available%.yml}"
done done
exit 1 exit 1
fi fi
...@@ -62,13 +62,13 @@ function cleanup () { rm -rf "$DIR_TEMP"; } ...@@ -62,13 +62,13 @@ function cleanup () { rm -rf "$DIR_TEMP"; }
mkdir -p "$DIR_TEMP/play" mkdir -p "$DIR_TEMP/play"
trap cleanup EXIT trap cleanup EXIT
ln -s "`readlink -e "${DIR_ROLES}"`" "${DIR_TEMP}/play/roles" ln -s "$(readlink -e "${DIR_ROLES}")" "${DIR_TEMP}/play/roles"
ln -s "`readlink -e "${DIR_GROUP_VARS}"`" "${DIR_TEMP}/play/group_vars" ln -s "$(readlink -e "${DIR_GROUP_VARS}")" "${DIR_TEMP}/play/group_vars"
ln -s "`readlink -e "${playbook_file}"`" "${DIR_TEMP}/play/playbook.yml" ln -s "$(readlink -e "${playbook_file}")" "${DIR_TEMP}/play/playbook.yml"
ln -s "`readlink -e "${env}"`" "${DIR_TEMP}/env" ln -s "$(readlink -e "${env}")" "${DIR_TEMP}/env"
# Finally execute the playbook against the server # Finally execute the playbook against the server
"${BIN_ANSIBLE_PLAYBOOK}" -i "${DIR_TEMP}/env/hosts" \ "${BIN_ANSIBLE_PLAYBOOK}" -i "${DIR_TEMP}/env/hosts" \
"${DIR_TEMP}/play/playbook.yml" \ "${DIR_TEMP}/play/playbook.yml" \
-vv --diff \ -vv --diff \
$@ "${@}"
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