A starter kit for provisioning a development server using Vagrant and Ansible.
The server will feature the following development environment:
The following programs must be install on your machine before you may install.
-
Vagrant 2.0.x
export VAGRANT_RELEASES="https://releases.hashicorp.com/vagrant" export VAGRANT_VERSION="2.0.1" export VAGRANT_DEB="vagrant_${VAGRANT_VERSION}_x86_64.deb" curl -O "${VAGRANT_RELEASES}/${VAGRANT_VERSION}/${VAGRANT_DEB}" sudo dpkg -i ${VAGRANT_DEB} rm ${VAGRANT_DEB}
-
VirtualBox 5.2.x
export VBOX_PATH="http://download.virtualbox.org/virtualbox/debian" wget -q -O- ${VBOX_PATH}/oracle_vbox_2016.asc | sudo apt-key add - echo "deb ${VBOX_PATH} $(lsb_release -cs) contrib" | sudo tee /etc/apt/sources.list.d/virtualbox.list sudo apt-get update sudo apt-get install virtualbox-5.2
-
Ansible 2.4.x
sudo add-apt-repository -y ppa:ansible/ansible sudo apt-get update sudo apt-get install -y ansible
git clone https://github.com/jabes/vagrant-scaffold.git
cd vagrant-scaffold
IMPORTANT: The key below is for the localhost environment only. Make sure that you use a different secret key for production environments.
mkdir -p ~/.ansible-vault
echo "SuperSecretPassword" > ~/.ansible-vault/vagrant-scaffold
You can now view secret info using Ansible vault commands:
cd ansible
ansible-vault view inventories/local/group_vars/secrets.yml
ansible-vault decrypt inventories/local/group_vars/secrets.yml
ansible-vault encrypt inventories/local/group_vars/secrets.yml
cd ansible
ansible-galaxy install -r requirements.yml
NOTE: The boxes are pretty large and provisioning can take a while. This is a good time to take a coffee break.
vagrant plugin install vagrant-vbguest
vagrant plugin install vagrant-hostsupdater
vagrant up
If everything went well..
- web server: http://vagrant-scaffold.dev