Skip to content

Instantly share code, notes, and snippets.

@Afterglow
Created January 7, 2015 13:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Afterglow/aa05b1f198fbe1c643a1 to your computer and use it in GitHub Desktop.
Save Afterglow/aa05b1f198fbe1c643a1 to your computer and use it in GitHub Desktop.
Provisioning a group of machine with chef-provisioning in Vagrant
require 'chef/provisioning'
machine_batch 'app-servers' do
machine 'app-server01' do
run_list [
'recipe[apache2]'
]
end
machine 'app-server02' do
run_list [
'recipe[apache2]'
]
end
end
machine_batch 'load-balancer' do
machine 'load-balancer' do
run_list [
'recipe[haproxy]'
]
end
end
require 'chef/provisioning'
require 'chef/provisioning/vagrant_driver'
with_driver 'vagrant'
vagrant_box 'ubuntu-14.04' do
url 'https://oss-binaries.phusionpassenger.com/vagrant/boxes/latest/ubuntu-14.04-amd64-vbox.box'
end
with_machine_options vagrant_options: {
'vm.box' => 'ubuntu-14.04'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment