vagrant/website/docs/source/v2/provisioning/chef_zero.html.md

2.0 KiB

page_title sidebar_current
Chef Zero - Provisioning provisioning-chefzero

Chef Zero Provisioner

Provisioner name: chef_zero

The Chef Zero provisioner allows you to provision the guest using Chef, specifically with Chef Zero/local mode.

This new provisioner is a middle ground between running a full blown Chef Server and using the limited Chef Solo provisioner. It runs a local in-memory Chef Server and fakes the validation and client key registration.

Warning: If you're not familiar with Chef and Vagrant already, I recommend starting with the shell provisioner. However, if you're comfortable with Vagrant already, Vagrant is the best way to learn Chef.

</p>

Options

This section lists the complete set of available options for the Chef Zero provisioner. More detailed examples of how to use the provisioner are available below this section.

Note that only the Chef Zero specific options are shown below, but all Chef Solo options, including the common Chef provisioner options, are also inherited.

  • nodes_path (string) - A path where the Chef nodes are stored. Be default, no node path is set.

Usage

The Chef Zero provisioner is configured basically the same way as the Chef Solo provisioner. See the Chef Solo documentations for more information.

A basic example could look like this:

Vagrant.configure("2") do |config|
  config.vm.provision "chef_zero" do |chef|
    # Specify the local paths where Chef data is stored
    chef.cookbooks_path = "cookbooks"
    chef.roles_path = "roles"
    chef.nodes_path = "nodes"

    # Add a recipe
    chef.add_recipe "apache"

    # Or maybe a role
    chef.add_role "web"
  end
end