Skip to content

Instantly share code, notes, and snippets.

@tsabat
Created June 26, 2013 02:45
Show Gist options
  • Save tsabat/5864368 to your computer and use it in GitHub Desktop.
Save tsabat/5864368 to your computer and use it in GitHub Desktop.
require 'json'
Vagrant::Config.run do |config|
config.vm.box = "12_10_chef"
config.vm.box_url = "http://cloud-images.ubuntu.com/raring/current/raring-server-cloudimg-vagrant-amd64-disk1.box"
config.vm.customize ["modifyvm", :id, "--memory", "1500"]
#if not RUBY_PLATFORM.downcase.include?("mswin")
#config.vm.customize ["modifyvm", :id, "--cpus",
#`awk "/^processor/ {++n} END {print n}" /proc/cpuinfo 2> /dev/null || sh -c 'sysctl hw.logicalcpu 2> /dev/null || echo ": 2"' | awk \'{print \$2}\' `.chomp ]
#end
config.vm.customize ["modifyvm", :id, "--cpus", 2]
#add agent forwarding
config.ssh.forward_agent = true
config.vm.network :hostonly, "33.33.33.11"
config.vm.provision :chef_solo do |chef|
chef.cookbooks_path = ["cookbooks"]
chef.roles_path = "roles"
if ENV['CHEF_DEBUG']
chef.log_level = :debug
end
chef.data_bags_path = 'data_bags'
if ENV['CHEF_RUN']
chef.run_list = ['recipe[chef_solo]'] << ENV['CHEF_RUN'].split(',')
else
chef.run_list = 'recipe[chef_solo]'
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment