This is now in Vagrant core: https://docs.vagrantup.com/v2/provisioning/chef_apply.html
A Vagrant plugin that adds chef-apply as a provider. This is useful when you want to do something that requires more than shell but do not want to write a full cookbook.
This plugin has been verified to work with the following Vagrant providers:
- VirtualBox (part of core)
It may work with other Vagrant providers but is not guaranteed to!
Ensure you have downloaded and installed Vagrant 1.1.x from the Vagrant downloads page.
Installation is performed in the prescribed manner for Vagrant 1.1 plugins.
vagrant plugin install vagrant-chef-apply
or to install from source:
$ git clone https://github.com/bakins/vagrant-chef-apply.git $ cd vagrant-chef-apply $ gem build vagrant-chef-apply.gemspec $ vagrant plugin install vagrant-chef-apply*.gem
The Chef-apply Vagrant plugin automatically hooks into the Vagrant provisioning middleware. You specify the path to your recipe file and have Chef 11 installed in your image. vagrant-omnibus is helpful for installing Chef
Vagrant.configure("2") do |config| config.vm.provision :chef_apply do |chef| chef.path = "recipe.rb" end ... end
See a real world example at lua-resty-riak.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature)
- Commit your changes (
git commit -am 'Add some feature')
- Push to the branch (
git push origin my-new-feature)
- Create new Pull Request
Brian Akins (email@example.com)
Seth Chisamore for the README file - copied from vagrant-omnibus
Vagrant for the code for the shell provider on which this is based.