Skip to content

Instantly share code, notes, and snippets.

@saylerb
Last active June 8, 2021 19:16
Show Gist options
  • Save saylerb/9de08e3fdd1254e3b15c946cc3128383 to your computer and use it in GitHub Desktop.
Save saylerb/9de08e3fdd1254e3b15c946cc3128383 to your computer and use it in GitHub Desktop.
A bash script to install ansible dependencies
# !/usr/bin/env bash
# sudo pip install --upgrade -r requirements.txt
# Install Command Line Tools, required for pip to install ansible
touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress;
PROD=$(softwareupdate -l |
grep "\*.*Command Line" |
head -n 1 | awk -F"*" '{print $2}' |
sed -e 's/^ *//' |
tr -d '\n')
softwareupdate -i "$PROD" --verbose;
# End of Command Line Tools Script
if [ ! `which pip`]
then
echo "Installing pip..."
sudo easy_install pip
fi
sudo pip install --upgrade
sudo pip install ansible
# Avoid prompt to continue by redirecting stdin from /dev/null
if [ ! `which brew` ]
then
echo "Installing Homebrew..."
ruby \
-e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" \
</dev/null
fi
# verify that Command Line Tools are correctly installed
# xcode-select -p
# should output /Library/Developer/CommandLineTools
# which pip
# which ansible
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment