Creating Development Environments with Vagrant

Improving your efficiency as a developer, programmer, or coder is the purpose of this book. It takes you through the steps one by one to help you set up and implement virtual development environments with Vagrant.

Creating Development Environments with Vagrant

Starting

Michael PeacockAugust 2013

Improving your efficiency as a developer, programmer, or coder is the purpose of this book. It takes you through the steps one by one to help you set up and implement virtual development environments with Vagrant.

Book Details

About This Book

Provision virtual machines using Puppet and Chef

Replicate multi-server environments locally

Set up a virtual LAMP development server

Who This Book Is For

"Creating Development Environments with Vagrant" is for developers, programmers, and coders who want to maintain multiple projects within their own environment. It is also aimed at companies who are looking to deploy ready-to-go development solutions for new staff or even existing staff moving to new projects, and to enforce a consistent and portable virtual development environment that is easy to create and quick to set up.

Table of Contents

Chapter 1: Getting Started with Vagrant

Requirements for Vagrant

Getting installed

Summary

Chapter 2: Managing Vagrant Boxes and Projects

Creating Vagrant projects

Managing Vagrant boxes

Controlling guest machines

Integration between the host and the guest

Auto-running commands

Summary

Chapter 3: Provisioning with Puppet

Provisioning

About Puppet

Summary

Chapter 4: Provisioning with Chef

Knowing about Chef

Creating cookbooks and recipes with Chef

Summary

Chapter 5: Provisioning with Vagrant using Puppet and Chef

Provisioning within Vagrant

Provisioning with Puppet on Vagrant

Provisioning with Chef on Vagrant

Other built-in provisioners

Using multiple provisioners on a single project

Overriding provisioning via the command line

Summary

Chapter 6: Working with Multiple Machines

Using multiple machines with Vagrant

Connecting to multiple virtual machines over SSH

Destroying a multi-machine project

Summary

Chapter 7: Creating Your Own Box

Getting started

Preparing the VirtualBox machine

VirtualBox Guest Additions

Vagrant authentication

Provisioners

Cleanup

Export

Summary

What You Will Learn

Create Vagrant projects

Sync folders with your virtual development environment

Integrate your own machine with the virtual machine

Manage provisioning the server configuration with Puppet and Chef

Set up multiple virtual machines for a single project

Configure your virtual environment on your network

Build your own base box for Vagrant

Import and manage operating system images in Vagrant

Get to grips with good practices for developing projects on your local machine

Set up a simple LAMP server for a Vagrant project

In Detail

Vagrant is a tool for building complete development environments. With an easy-to-use workflow and focus on automation, Vagrant lowers development environment setup time, increases development/production parity, and makes the "it works on my machine" excuse a thing of the past.

"Creating Development Environments with Vagrant" is a practical, hands-on guide that walks you through the functionality of Vagrant, Puppet, and Chef to create powerful and flexible virtual development environments. Create your own virtualization environments containing configurations for different projects so that you can simulate complicated environments that can be easily shared with colleagues to get your projects up and running quickly and effortlessly.

"Creating Development Environments with Vagrant" starts with an introduction to virtualization and the concepts behind it, why it’s useful, and an overview of the architecture of Vagrant. We will learn to install Vagrant and get to know its prerequisites. Covering provisioning scripts with Puppet and Chef, learning to use them independently as well as with Vagrant to create a powerful combination.

If you want to locally test your projects, juggle multiple projects running on different versions of software, easily share technology requirement changes with colleagues, and, most importantly, want to perform all these tasks efficiently, then this book is for you.

"Creating Development Environments with Vagrant" will take you from a virtualization novice to running all of your projects across your team in robust, isolated virtual development environments.

Authors

Michael Peacock

Michael Peacock is an experienced software developer and team lead from Newcastle, UK, with a degree in software engineering from the University of Durham.

After spending a number of years running his own web agency, and subsequently, working directly for a number of software start-ups, he now runs his own software development agency, working on a range of projects for an array of different clients.

He is the author of Creating Development Environments with Vagrant, PHP 5 Social Networking, PHP 5 E-Commerce Development, Drupal 7 Social Networking, and Selling online with Drupal e-Commerce and Building Websites with TYPO3, all by Packt Publishing. The other publications Michael has been involved in include Advanced API Security, Mobile Web Development, Jenkins Continuous Integration Cookbook, and Drupal for Education and E-Learning; for these he acted as a technical reviewer.

Michael has also presented at a number of user groups and technical conferences, including PHP UK Conference, Dutch PHP Conference, ConFoo, PHPNE, PHPNW, and Could Connect Santa Clara.

You can follow Michael on Twitter (@michaelpeacock), or find out more about him through his website (www.michaelpeacock.co.uk).

Alerts & Offers

Series & Level

We understand your time is important. Uniquely amongst the major publishers, we seek to develop and publish the broadest range of learning and information products on each technology. Every Packt product delivers a specific learning pathway, broadly defined by the Series type. This structured approach enables you to select the pathway which best suits your knowledge level, learning style and task objectives.

Learning

As a new user, these step-by-step tutorial guides will give you all the practical skills necessary to become competent and efficient.

Beginner's Guide

Friendly, informal tutorials that provide a practical introduction using examples, activities, and challenges.

Essentials

Fast paced, concentrated introductions showing the quickest way to put the tool to work in the real world.

Cookbook

A collection of practical self-contained recipes that all users of the technology will find useful for building more powerful and reliable systems.

Blueprints

Guides you through the most common types of project you'll encounter, giving you end-to-end guidance on how to build your specific solution quickly and reliably.

Mastering

Take your skills to the next level with advanced tutorials that will give you confidence to master the tool's most powerful features.

Starting

Accessible to readers adopting the topic, these titles get you into the tool or technology so that you can become an effective user.

Progressing

Building on core skills you already have, these titles share solutions and expertise so you become a highly productive power user.