Vagrant and Puppet

16
Vagrant and Puppet Automate all the things!

Transcript of Vagrant and Puppet

Page 1: Vagrant and Puppet

Vagrant and PuppetAutomate all the things!

Page 2: Vagrant and Puppet

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.

Page 3: Vagrant and Puppet

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.

Page 4: Vagrant and Puppet

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.

Page 5: Vagrant and Puppet

"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?

Page 6: Vagrant and Puppet

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:

Page 7: Vagrant and Puppet

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

Page 8: Vagrant and Puppet
Page 9: Vagrant and Puppet

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.

Page 10: Vagrant and Puppet

Puppet Terminology

Puppet Master and Agents

Resources

Facter

Resource abstraction layer.

Manifests

Page 11: Vagrant and Puppet

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.

Page 12: Vagrant and Puppet

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.

Page 13: Vagrant and Puppet

The Communication Model

Master

"Web" Node

"DB" Node "Mail" Node

Other Node

Page 14: Vagrant and Puppet

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.

Page 15: Vagrant and Puppet

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.

Page 16: Vagrant and Puppet

Summary

Time = Money.

Vagrant and Puppet Save Time.

This saves money.