-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
copy up the env-setup.fish for main repo usage
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |