chidevops / provision

Periodic Table of DevOps (Part 1): Automated Provisioning of Dev Environments

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Automated Provision of Dev Environments

Applications require somewhere to run. Under all the layers of abstraction there is still compute, storage, and networking resources that must be provided. These might be provided directly with bare metal or VMs, or indirectly through a PaaS or Lambda-as-a-Service frameworks. In any case, these resources must be provisioned and configured to the application requirements, updated over time, and finally decommissioned at the end of their utility. Provisioning is usually owned by operations teams and provided to developers.

This is part 1 of a series of workshops that look at the tools and concepts from the periodic table of DevOps. This workshop (5/7/17) covers provisioning environments that can be used in dev and prod through the use of tools like Ansible, Vagrant and Packer to automate and manage the creation of those environments.

Concepts

  • Building an immutable machine image
  • Separating static and dynamic configurations
  • Creating disposable VM's for testing and development
  • Automating all the things
  • "Code as infrastructure" - keep infrastructure configuration under source control for easy deployment

Goals

  • Understand basic Vagrant files and configuring a Vagrantfile
  • Writing Packer configuration to automate Vagrantfile creation
  • Creating Ansible roles to provision images and deploy them using ansible-playbook

Setup

In order to speed along the initial configuration, we need to install VirtualBox and Vagrant in order to follow along and further provision the environment. If you're on OS X, you can use a script written up by Github user rrgrs to install via Brew:

if ! type "brew" > /dev/null; then
  ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)";
fi
brew tap phinze/homebrew-cask && brew install brew-cask;
brew cask install vagrant;
brew cask install virtualbox;
brew install packer;

That script can be located in the repository under brew_install.sh (ensure you make it excecutable via chmod +x brew_install.sh followed by ./brew_install.sh.

If you cannot use brew (windows, etc) you can download VirtualBox here, Vagrant here and Packer here.

The initial pulling of the Ubuntu 14.04 iso image takes a moment, so I recommend pulling this repository cd into vagrant/ and run the initial vagrant up which should (slowly) setup an ubuntu image for Vagrant.

Imgur

About

Periodic Table of DevOps (Part 1): Automated Provisioning of Dev Environments


Languages

Language:Python 82.8%Language:Ruby 11.7%Language:Shell 5.5%