Skip to content

Commit

Permalink
copy up the env-setup.fish for main repo usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jcftang committed Mar 18, 2014
1 parent 2718043 commit f303ed8
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions hacking/env-setup.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env fish
# usage: . ./hacking/env-setup [-q]
# modifies environment for running Ansible from checkout
set HACKING_DIR (dirname (status -f))
set FULL_PATH (python -c "import os; print(os.path.realpath('$HACKING_DIR'))")
set ANSIBLE_HOME (dirname $FULL_PATH)
set -gx ANSIBLE_HOSTS $ANSIBLE_HOME/hosts.vagrant

if set -q argv
switch $argv
case '-q' '--quiet'
case '*'
echo ""
echo "Setting up Ansible to run out of checkout, hosts.vagrant and to use vagrant private keys..."
echo ""
echo "ANSIBLE_HOME=$ANSIBLE_HOME"
echo "ANSIBLE_HOSTS=$ANSIBLE_HOSTS"
echo ""

echo "Remember, you may wish to specify your host file with -i"
echo ""
echo "Done!"
echo ""
end
end

function ansible -d "ansible wrapper"
/usr/bin/env ansible --user=vagrant --private-key="~/.vagrant.d/insecure_private_key" $argv
end

function ansible-playbook -d "ansible-playbook wrapper"
/usr/bin/env ansible-playbook --user=vagrant --private-key="~/.vagrant.d/insecure_private_key" $argv
end

0 comments on commit f303ed8

Please sign in to comment.