Book Image

Creating Development Environments with Vagrant

By : MICHAEL KEITH PEACOCK
Book Image

Creating Development Environments with Vagrant

By: MICHAEL KEITH PEACOCK

Overview of this book

Table of Contents (17 chapters)
Creating Development Environments with Vagrant Second Edition
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Provisioning with Puppet on Vagrant


Vagrant supports two methods of using Puppet:

  • Puppet in standalone mode using the puppet apply command on the VM

  • Puppet in client/server mode, whereby the VM (using the Puppet agent) will be configured from a central server

Let's take a look at how to configure Vagrant with Puppet using these two different methods.

Using Puppet in standalone mode

Puppet standalone is the simplest way to use Puppet with Vagrant. We simply tell Vagrant where we have put our Puppet manifests and modules, and what manifest should be run. The smallest amount of configuration we need within our Vagrant file in order to use Puppet is this:

config.vm.provision "puppet" do |puppet|
end

This should go within the Vagrant.configure("2") do |config| … end block of code within the Vagrant file.

Along with this configuration, we will need a Puppet manifest called default.pp in the manifests folder of our project root. Vagrant will then use this to provision the machine.

This will instruct Vagrant...