Last active
May 29, 2018 15:25
-
-
Save whunter/51746b9af7e855ec879d5fc4cd0312ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
echo "Upgrading ansible installation" | |
brew upgrade ansible | |
echo "" | |
echo "" | |
echo "Copying ldap_search.rb from gist.github.com" | |
curl -L https://gist.githubusercontent.com/whunter/02bc567781b7e3d4c9928b330e8b26b5/raw/43d8ae290b165dd2d98754b51c5c0faac0ab4543/ldap_query.rb > ./ldap_query.rb | |
if [ ! -d ./InstallScripts ]; then | |
echo "" | |
echo "" | |
echo "Pulling InstallScripts repository from Github" | |
echo "" | |
echo "" | |
git clone https://github.com/VTUL/InstallScripts.git | |
else | |
echo "" | |
echo "" | |
echo "It looks like the InstallScripts directory is already present." | |
echo "" | |
echo "" | |
fi | |
cd InstallScripts | |
echo "" | |
echo "" | |
echo "Checking for updates for InstallScripts repository" | |
echo "" | |
echo "" | |
git pull --rebase | |
echo "" | |
echo "" | |
echo "Copying site_secrets.yml from gist.github.com into ansible directory" | |
echo "" | |
echo "" | |
curl -L https://gist.githubusercontent.com/whunter/675ef444eefaa4b3a842353e94a8f199/raw/8ca66f90d9f16c9d682fdfc5f2a768ecf37c48d2/site_secrets.yml > ansible/site_secrets.yml | |
if [ ! -f ./ansible/local_files/user_list.txt ] || [ ! -f ./ansible/local_files/admin_list.txt ] | |
then | |
# Get user's vt email | |
echo "" | |
echo "" | |
read -p "Hi! Please enter your vt email address and hit Return : " email | |
echo "" | |
echo "" | |
echo "Installing net-ldap gem" | |
sudo gem install 'net-ldap' | |
echo "Looking up info for $email from directory.vt.edu" | |
vt_uid=$(ruby ../ldap_query.rb $email) | |
vt_pid=${email%@*} | |
echo "Creating user config local files based on your vt email" | |
echo "$vt_uid $vt_pid" > ansible/local_files/user_list.txt | |
echo $vt_pid > ansible/local_files/admin_list.txt | |
fi | |
echo "Installing vagrant host manager" | |
vagrant plugin install vagrant-hostmanager | |
echo "" | |
echo "" | |
echo "Spinning up virtual machine" | |
echo "" | |
echo "" | |
vagrant up | |
echo "" | |
echo "" | |
echo -e "Your application should be available at \033[0;31mhttps://hyrax2.dld.lib.vt.edu/ \033[0m" | |
echo "You can use your DEV CAS account to login." | |
echo "" | |
echo "" | |
echo 'To shut down your virtual machine when you are done just enter "vagrant halt" (no quotes) in this directory and hit Return.' | |
echo "" | |
echo "" | |
echo "Thanks!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment