Provisioners
Vagrant supports provisioning a project’s VM through the use of provisioners, since spinning up a blank virtual machine is not very useful! The provisioners supported out-of-the-box with a Vagrant installation are: Chef Solo, Chef Server, Puppet stand-alone, and Puppet Server.
These provisioners allow you to easily setup your virtual machine with everything it needs to run as a proper server (whether it be a web server, database server, utility server, or all those things combined).
By default, Vagrant disables provisioning. Provisioning can be enabled by selecting the provisioner using the config.vm.provision configuration method. Calling this method tells Vagrant to use some built-in provisioner or a custom provisioner which inherits from Vagrant::Provisioners::Base.
Which Provisioner Should I Use?
Ah, with the freedom of choice comes the complication of choosing what is right for you.
- Chef Solo - Chef solo is most ideal if you’re just getting started with chef or a chef server is simply too heavy for your situation. Chef solo allows you to embed all your cookbooks within your project as well, which is nice for projects which want to keep track of their cookbooks within the same repository. Chef solo runs standalone – it requires no chef server or any other server to talk to; it simply runs by itself on the VM.
- Chef Server - Chef server is useful for companies or individuals which manage many projects, since it allows you to share cookbooks across multiple projects. The cookbooks themselves are stored on the server, and the client downloads the cookbooks upon running.
- Puppet - The Puppet provisioner runs stand-alone Puppet manifests that are stored on the server and downloaded to the client VM when it is created. The provisioner does not require a Puppet server and runs on the VM itself.
- Puppet Server - The Puppet Server provisioner connects to a Puppet server and configures your client VM using node configuration on that server.
- Other tools, shell scripts, etc. - Do you use something other than that which is built into Vagrant? Provisioners are simply subclasses of
Vagrant::Provisioners::Base, meaning you can easily build your own, should the need arise.