-
-
Save rberger/1117510 to your computer and use it in GitHub Desktop.
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
$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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment