Skip to content

Instantly share code, notes, and snippets.

@micw
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save micw/987af53361c1d7de1369 to your computer and use it in GitHub Desktop.
Save micw/987af53361c1d7de1369 to your computer and use it in GitHub Desktop.
Script to provision a wheezy base box (e.g. a VPS) with ansible.
#!/bin/bash
#
# USAGE:
# [ -f /usr/bin/curl ] || apt-get -y install curl
# curl -sSL https://gist.githubusercontent.com/micw/987af53361c1d7de1369/raw/ | /bin/bash
set -e
if [ ! -f /etc/apt/sources.list.d/wheezy-backports.list ]; then
echo "Adding wheezy backport repository"
echo "deb http://http.debian.net/debian wheezy-backports main contrib" > /etc/apt/sources.list.d/wheezy-backports.list
apt-get update
else
echo "Already added wheezy backport repository"
fi
if [ ! -f /usr/bin/nano ]; then
echo "Installing nano"
apt-get -y install nano
else
echo "Already installed nano"
fi
if [ ! -f /usr/bin/git ]; then
echo "Installing git"
apt-get -y install git
else
echo "Already installed git"
fi
if [ ! -f /usr/bin/ansible-playbook ]; then
echo "Installing ansible"
apt-get -y install ansible
else
echo "Already installed ansible"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment