Skip to content

Instantly share code, notes, and snippets.

@richo
Created September 12, 2012 01:48
Show Gist options
  • Save richo/3703654 to your computer and use it in GitHub Desktop.
Save richo/3703654 to your computer and use it in GitHub Desktop.
# vi: ft=ruby
def physical_memory
`sysctl hw.memsize`.chomp.split(" ")[1].to_i
end
def wireless_adaptor
case `uname -s`.chomp
when "Darwin"
"en0"
when "Linux"
"wlan0"
end
end
Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.network :hostonly, "192.168.33.10"
# XXX Totally untested
config.vm.network :bridge, wireless_adaptor
config.ssh.forward_agent = true
config.dns.tld = "vm"
config.dns.patterns = [/^.+?\.vm$/]
config.vm.share_folder("vmconfig", "~/vmconfig", ".", :nfs=>true)
config.vm.share_folder("contests", "~/contests", "../contests", :nfs=>true)
config.vm.share_folder("commerce", "~/commerce", "../commerce", :nfs=>true)
config.vm.share_folder("bluesteel", "~/bluesteel", "../bluesteel", :nfs=>true)
config.vm.share_folder("babushka-deps", "~/babushka-deps", "../babushka-deps", :nfs=>true)
['cloudconfig','varnishconfig'].each do |d|
if File.exists? File.expand_path("../#{d}")
config.vm.share_folder(d, "~/#{d}", "../#{d}", :nfs=>true)
end
end
config.vm.customize ["modifyvm", :id, "--memory", physical_memory / 1024**2 / 4]
config.vm.customize ["modifyvm", :id, "--cpus", "4"]
config.vm.provision :shell, :path => "babushka.sh"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment