Skip to content

Instantly share code, notes, and snippets.

@zemm
Last active August 29, 2015 14:13
Show Gist options
  • Save zemm/8c5eba0cd5a42a436197 to your computer and use it in GitHub Desktop.
Save zemm/8c5eba0cd5a42a436197 to your computer and use it in GitHub Desktop.
barebones multi-machine vagrant config
# -*- mode: ruby -*-
# vi: set ft=ruby :
hosts = {
"ctrl" => "192.168.101.11",
"db-1" => "192.168.101.12",
"cache-1" => "192.168.101.13",
"cache-2" => "192.168.101.14",
"web-1" => "192.168.101.15",
"web-2" => "192.168.101.16"
}
Vagrant.configure("2") do |config|
hosts.each do |hostname, ip|
config.vm.define hostname do |machine|
machine.vm.box = "ubuntu/trusty64"
machine.vm.hostname = "%s.example.com" % hostname
machine.vm.network :private_network, ip: ip
machine.vm.network :public_network
machine.vm.provider "virtualbox" do |v|
v.name = hostname
v.customize ["modifyvm", :id, "--memory", 200]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment