O'Reilly logo

Creating Development Environments with Vagrant by Michael Peacock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Provisioning with Chef on Vagrant

Vagrant also supports two methods of using Chef:

  • Chef solo
  • Chef in client/server mode with Chef client

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

Using Chef solo

Chef solo is the Chef equivalent of Puppet standalone.

The simplest way to use this within our project is simply to provide a Chef run list to Vagrant, this tells Vagrant which cookbooks should be applied. The following is an example of telling Vagrant to use the PHP cookbook:

config.vm.provision :chef_solo do |chef| 
  chef.add_recipe "php" 
end

This takes the PHP cookbook from the default cookbooks folder and applies it to the virtual machine.

As with Puppet, Vagrant makes some assumptions by default, these are:

  • Cookbooks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required