If you want to provision from an Amazon EC2 instance instead of using your local machine, here are the instructions to install Vagrant and Ansible.
Before doing any of the following, update your packages listing:
sudo apt-get update
# Install git
sudo apt-get install git
# Clone this repository
git clone https://github.com/newslynx/automation
These instructions come in part from Digital Ocean's guide.
Note: The Digital Ocean Guide also covers installing via VirtualBox but this install guide is for deploying from one EC2 to another so we won't install any of the VirtualBox requirements.
# Install dpkg, which will help us install Vagrant
sudo apt-get install dpkg-dev
At the time of this writing (Aug 2015), the latest Vagrant version is 1.7.4. To check the latest, go to the Vagrant downloads page. If an updated version exists, right-click on the "64-bit" link for "Linux (DEB)" and copy the download URL. Replace it with the one below in the next command.
# Download the Vagrant installer. Must be at least version 1.7.0
wget https://dl.bintray.com/mitchellh/vagrant/vagrant_1.7.4_x86_64.deb
# Install it
# NOTE: If you're using an updated version, replace the name of the .deb file with the one you just downloaded
# An easy way to do this is to type `dpkg -i v` and then hit the `tab` key to autocomplete.
dpkg -i vagrant_1.7.4_x86_64.deb
# Install Kernel headers
sudo apt-get install linux-headers-$(uname -r)
And you're done!
Ansible has their own instructions for installing via apt-get
on Ubuntu that are available here. At the time of this writing (Aug 2015), they are the following:
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
Hurray!
As a part of this process, you need to put your Amazon .pem
file onto the AWS machine you're deploying from. This is the file whose path you set in servers.yaml
. Importantly, only the super user can have read permissions to this file. To do this, run the following command on that file
chmod 400 <name-of-pem-file>