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

Using multiple provisioners on a single project

We can use multiple provisioners within a single project if we wish; we simply need to put them in the order we wish for them to be executed within our Vagrant file. The following would first run an SSH command before provisioning with Puppet:

Vagrant.configure("2") do |config| 
  Config.vm.box = "precise64"

  config.vm.provision :shell, :inline => "apt-get update"

  config.vm.provision :puppet do |puppet|
       puppet.manifests_path = "provision/manifests"
       puppet.manifest_file  = "default.pp"
       puppet.module_path = "provision/modules"
  end
  
end

Using multiple provisioners can be useful, especially if one is more suited at specific tasks than another, or if we require some prerequisites. For example, when using Puppet ...

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