public
Created — forked from t9md/Vagrantfile

  • Download Gist
Vagrantfile
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
$hosts_table = {
:dbm => "192.168.86.101",
:app1 => "192.168.86.102",
:app2 => "192.168.86.103",
:lb => "192.168.86.104",
}
 
def bootstrap(config, host)
config.vm.box = "lucid64"
config.vm.network $hosts_table[host]
hostname = host.to_s
config.vm.customize { |v| v.name = hostname ; v.memory_size = 1024 }
config.vm.provision :chef_solo do |chef|
chef.run_list = [ "recipe[vagrant_main]" ]
chef.json = {
:ssh_pubkey => File.read(File.expand_path("~/.ssh/id_rsa.pub")),
:my_hostname => hostname,
:my_fqdn => "#{hostname}.example.com",
:my_gateway => "192.168.86.1"
}
end
end
 
Vagrant::Config.run do |config|
# dbm
config.vm.define(:dbm){ |c| bootstrap(c, :dbm) }
 
# app1 with db migration and load default data
config.vm.define(:app1){ |c| bootstrap(c, :app1) }
 
# app2 with db migration and load default data
config.vm.define(:app2){ |c| bootstrap(c, :app2) }
 
# lb with db migration and load default data
config.vm.define(:lb){ |c| bootstrap(c, :lb) }
end
# vim: ft=ruby

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.