• Infrastructure
    • terraform
    • packer
  • Networking
    • consul
  • Security
    • vault
    • boundary
  • Applications
    • nomad
    • waypoint
    • vagrant
  • HashiCorp Cloud Platform

    A fully managed platform to automate infrastructure on any cloud with HashiCorp products.

    • consul
    • terraform
    • vault
    • packerbeta
    Visit cloud.hashicorp.com
  • Intro
  • Docs
  • Community
GitHub—Stars on GitHub
Download
    • v2.2.19 (latest)
    • v2.2.18
    • v2.2.17
    • v2.2.16
    • v2.2.15
    • v2.2.14
    • v2.2.13
    • v2.2.12
    • v2.2.11
    • v2.2.10
  • Overview
    • Overview
    • Backwards Compatibility
    • Upgrading
    • Upgrading from 1.0.x
    • From Source
    • Uninstallation
    • Overview
    • box
    • cloud
    • connect
    • destroy
    • global-status
    • halt
    • init
    • login
    • package
    • plugin
    • port
    • powershell
    • provision
    • rdp
    • reload
    • resume
    • share
    • snapshot
    • ssh
    • ssh-config
    • status
    • suspend
    • up
    • upload
    • validate
    • version
    • More Commands
    • Aliases
    • Machine Readable Output
    • rsync
    • rsync-auto
    • winrm
    • winrm_config
    • Overview
    • HTTP Sharing
    • SSH Sharing
    • Connect
    • Security
    • Custom Provider
    • Overview
    • Configuration Version
    • Minimum Vagrant Version
    • Tips & Tricks
    • config.vm
    • config.ssh
    • config.winrm
    • config.winssh
    • config.vagrant
    • Overview
    • Box Versioning
    • Creating a Base Box
    • Box File Format
    • Box Info Format
    • Overview
    • Basic Usage
    • File
    • Shell
    • Ansible Intro
    • Ansible
    • Ansible Local
    • Common Ansible Options
    • CFEngine
    • Chef Common Configuration
    • Chef Solo
    • Chef Zero
    • Chef Client
    • Chef Apply
    • Docker
    • Podman
    • Puppet Apply
    • Puppet Agent
    • Salt
    • Overview
    • Basic Usage
    • Forwarded Ports
    • Private Network
    • Public Network
    • Overview
    • Basic Usage
    • NFS
    • RSync
    • SMB
    • VirtualBox
    • Overview
    • Configuration
    • Usage
    • Overview
    • Configuration
    • Usage
      • Overview
      • Usage
      • Common Issues
      • Overview
      • Usage
      • Common Issues
      • Overview
      • Usage
      • Common Issues
  • Multi-Machine
    • Overview
    • Installation
    • Basic Usage
    • Configuration
    • Default Provider
      • Overview
      • Usage
      • Creating a Base Box
      • Configuration
      • Networking
      • Common Issues
      • Overview
      • Installation
      • VMware Utility
      • Usage
      • Boxes
      • Configuration
      • Known Issues
      • FAQ
      • Overview
      • Basic Usage
      • Commands
      • Boxes
      • Configuration
      • Networking
      • Overview
      • Usage
      • Creating a Base Box
      • Configuration
      • Limitations
    • Custom Provider
    • Overview
    • Usage
    • Plugin Development Basics
    • Action Hooks
    • Commands
    • Configuration
    • Guests
    • Guest Capabilities
    • Hosts
    • Host Capabilities
    • Providers
    • Provisioners
    • Packaging & Distribution
    • Overview
    • FTP / SFTP
    • Heroku
    • Local Exec
    • Overview
    • Configuration
    • Usage
  • Experimental
    • Overview
    • Debugging
    • Environmental Variables
    • WSL
    • macOS Catalina

  • Vagrant Cloud
Type '/' to Search

Chef Zero Provisioner

Provisioner name: chef_zero

The Vagrant 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 are not familiar with Chef and Vagrant already, we recommend starting with the shell provisioner. However, if you are comfortable with Vagrant already, Vagrant is the best way to learn Chef.

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.

  • cookbooks_path (string or array) - A list of paths to where cookbooks are stored. By default this is "cookbooks", expecting a cookbooks folder relative to the Vagrantfile location.

  • data_bags_path (string or array) - A path where data bags are stored. By default, no data bag path is set. Chef 12 or higher is required to use the array option. Chef 11 and lower only accept a string value.

  • environments_path (string) - A path where environment definitions are located. By default, no environments folder is set.

  • nodes_path (string or array) - A list of paths where node objects (in JSON format) are stored. By default, no nodes path is set. This value is required.

  • environment (string) - The environment you want the Chef run to be a part of. This requires Chef 11.6.0 or later, and that environments_path is set.

  • roles_path (string or array) - A list of paths where roles are defined. By default this is empty. Multiple role directories are only supported by Chef 11.8.0 and later.

  • synced_folder_type (string) - The type of synced folders to use when sharing the data required for the provisioner to work properly. By default this will use the default synced folder type. For example, you can set this to "nfs" to use NFS synced folders.

In addition to all the options listed above, the Chef Zero provisioner supports the common options for all Chef provisioners.

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.data_bags_path = "data_bags"
    chef.nodes_path = "nodes"
    chef.roles_path = "roles"

    # Add a recipe
    chef.add_recipe "apache"

    # Or maybe a role
    chef.add_role "web"
  end
end
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.data_bags_path = "data_bags"
    chef.nodes_path = "nodes"
    chef.roles_path = "roles"
 
    # Add a recipe
    chef.add_recipe "apache"
 
    # Or maybe a role
    chef.add_role "web"
  end
end
github logoEdit this page
IntroDocsBookVMwarePrivacySecurityPress KitConsent Manager