Last active
December 23, 2015 07:09
-
-
Save mlafeldt/6598563 to your computer and use it in GitHub Desktop.
Install Chef 11 with Vagrant's shell provisioner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu-12.04" | |
config.vm.box_url = "http://cloud-images.ubuntu.com/vagrant/precise/current/precise-server-cloudimg-amd64-vagrant-disk1.box" | |
# Install Chef version 11 | |
config.vm.provision :shell, :inline => <<EOS | |
set -e | |
if ! command -V chef-solo >/dev/null 2>/dev/null; then | |
curl -L https://www.opscode.com/chef/install.sh | bash -s -- -v 11.6.0 | |
fi | |
EOS | |
config.vm.provision :chef_solo do |chef| | |
# ... | |
end | |
end |
@gildegoma Thanks! Will give it a try tomorrow.
Just realized that this box doesn't have curl
preinstalled, so the shell bootstrap must be adapted:
sudo apt-get update -qq
sudo apt-get install -qq curl
@gildegoma Pretty sure it has wget then. :)
@gildegoma Btw, I'm now using https://github.com/schisamo/vagrant-omnibus which also runs the install.sh script but is much easier to use. It even takes care of the curl/wget issue you ran into.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you want to setup a "pure" Chef box (without Puppet), you also could use https://opscode-vm-bento.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_provisionerless.box