Vagrant and Puppet

Post on 16-Apr-2015

64 views 3 download

Transcript of Vagrant and Puppet

Vagrant and PuppetAutomate all the things!

The Problem

Drupal development tends to blur the line between development and system administration.

Why configure services on your personal computer?

Tools like MAMP greatly simplify this process, but often mysteriously misbehave.

More considerations

Discrepancies between server environments lead to random bugs between collaborators."It works for me locally."

Running multiple versions of services on the same box isn't an ideal setup.

Scale. Think of 100 devs collaborating on a complex environment using Nginx, Varnish, separate web/db servers, etc.

Virtualization to the Rescue!

Tools like VMWare and VirtualBox can remove the need run services on the computer by providing guest Virtual Machines to a physical host.

These tools work well for things like setting up Virtual Machines running Windows for IE testing, or playing around with a new Linux distro.

"Virtualized development made easy."

Configure Virtual Machines through a Vagrantfile instead of clicking through a GUI.

Greatly reduces the time it takesto configure a Virtual Machine.

So... What's Vagrant?

Installation

First, install VirtualBox. There are packages available for Linux/Mac/Windows.

Next, install Vagrant. There are packages available for Linux/Mac/Windows.

Open a terminal and type:

So Now What?

Configure the Virtual Machine like you would any environment:

Download and install Apache, PHP, MySQL. Configure your users, groups, your MTA, Install libraries and dependencies, install other packages like Git, the most recent version of Vim, configure ZSH, terminal colors, your MOTD, etc

Or, Use Puppet!

Puppet is a configuration management tool.

Written in Ruby, Free Open Source Software.

Can be run in a standalone or client/server mode.

Puppet Terminology

Puppet Master and Agents

Resources

Facter

Resource abstraction layer.

Manifests

Puppet Master

Using Puppet in standalone mode is great for use with Vagrant.

However, this method of use doesn't scale well, and thus limits Puppet's utility.

Using the client/server (agent/master) model is better.

More about Puppet Master

RESTful communication over HTTP.

Communications secured through SSL.

Agent runs as daemon, pulls from Master periodically to check for changes in configuration.

Agent identifies itself as a specific Node, pulls respective configuration.

The Communication Model

Master

"Web" Node

"DB" Node "Mail" Node

Other Node

How Puppet Master Fits in With Vagrant

Two cool things you can do with Vagrant:

1) Configure multiple VMs in a single Vagrantfile

2) Identify each VM as a Puppet Node, each VM is provisioned automatically.

From Virtual to Physical

If one uses Puppet Master, provisioning a physical server is as easy as provisioning the VM. Install puppet on the server, identify your server as a node, and start the puppet agent daemon.

This allows for seamless transitions between servers, or for seamless spin up of cloud instances.

Summary

Time = Money.

Vagrant and Puppet Save Time.

This saves money.