Skip to content

Instantly share code, notes, and snippets.

@sahas-
Created May 10, 2016 02:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sahas-/b64b199d3b7ca2284b1d24f8e3c50fb1 to your computer and use it in GitHub Desktop.
Save sahas-/b64b199d3b7ca2284b1d24f8e3c50fb1 to your computer and use it in GitHub Desktop.
BRIDGE_NET = "192.168.1."
INTERNAL_NET="192.168.100."
DOMAIN ="test.com"
RAM=524
CPU=1
servers=[
{
:hostname => "app1." + DOMAIN,
:box => "ubuntu/trusty64",
:ip => INTERNAL_NET + "10",
:ram => RAM,
:cpu => CPU
},
{
:hostname => "app2." + DOMAIN,
:box => "ubuntu/trusty64",
:ip => INTERNAL_NET + "11",
:ram => RAM,
:cpu => CPU
}
]
Vagrant.configure(2) do |config|
config.vm.synced_folder ".", "/vagrant", disabled: true
servers.each do |machine|
config.vm.define machine[:hostname] do |node|
node.vm.box = machine[:box]
node.vm.hostname = machine[:hostname]
node.vm.usable_port_range = (2200..2250)
node.vm.network "private_network", ip: machine[:ip]
node.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", machine[:ram]]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment