Skip to content

Commit

Permalink
provision.sh: locate terraform-inventory using which
Browse files Browse the repository at this point in the history
GOBIN might not be defined in the user system. The important thing is for
terraform-inventory to be in the search PATH.

Co-authored-by: Martin Evgeniev <[email protected]>
  • Loading branch information
2 people authored and iknite committed Feb 19, 2019
1 parent cd97e81 commit d699e9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy/aws/provision.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

export TF_STATE=/tmp/terraform.tfstate

if [ ! -f $GOBIN/terraform-inventory ];
if ! which terraform-inventory
then
echo -e "Please install terraform-inventory in your GOBIN \ngo get github.com/adammck/terraform-inventory"
exit 1
Expand All @@ -27,7 +27,7 @@ cd provision

if [ -z "$@" ];
then
ansible-playbook --inventory-file=$GOBIN/terraform-inventory --private-key ~/.ssh/id_rsa_free main.yml -f 10
ansible-playbook --inventory-file=$(which terraform-inventory) --private-key ~/.ssh/id_rsa_free main.yml -f 10
else
echo "Using custom Ansible Playbook command."
ansible-playbook "$@"
Expand Down

0 comments on commit d699e9e

Please sign in to comment.