setup, ensure variables are quoted.
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
DIR="$(dirname -- "${BASH_SOURCE[0]}")"
|
||||||
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
PROG="$(basename -- "${BASH_SOURCE[0]}")"
|
||||||
LOCAL=$DIR/local.yml
|
LOCAL="$DIR/local.yml"
|
||||||
URL="https://git.hyperling.com/me/env-ansible"
|
URL="https://git.hyperling.com/me/env-ansible"
|
||||||
if [[ -z $BRANCH ]]; then
|
if [[ -z $BRANCH ]]; then
|
||||||
export BRANCH="main"
|
export BRANCH="main"
|
||||||
@@ -215,14 +215,14 @@ lock_file=/tmp/ansible-playbook.lock
|
|||||||
if [[ "$ansible_exists" == 0 ]]; then
|
if [[ "$ansible_exists" == 0 ]]; then
|
||||||
echo "Playbook is already being executed. Exiting."
|
echo "Playbook is already being executed. Exiting."
|
||||||
exit 0
|
exit 0
|
||||||
elif [[ -e $lock_file ]]; then
|
elif [[ -e "$lock_file" ]]; then
|
||||||
echo "Playbook not being executed. Removing lock file."
|
echo "Playbook not being executed. Removing lock file."
|
||||||
sudo mv -v "$lock_file" "${lock_file}.diaabled"
|
sudo mv -v "$lock_file" "${lock_file}.disabled"
|
||||||
fi
|
fi
|
||||||
echo "- Verified!"
|
echo "- Verified!"
|
||||||
|
|
||||||
echo "Provisioning Ansible..."
|
echo "Provisioning Ansible..."
|
||||||
if [[ $local == "Y" ]]; then
|
if [[ "$local" == "Y" ]]; then
|
||||||
sudo ansible-playbook $LOCAL
|
sudo ansible-playbook $LOCAL
|
||||||
else
|
else
|
||||||
sudo ansible-pull -U $URL.git --checkout $branch
|
sudo ansible-pull -U $URL.git --checkout $branch
|
||||||
|
|||||||
Reference in New Issue
Block a user