Skip to content

Instantly share code, notes, and snippets.

@robsongomes
Created November 4, 2022 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save robsongomes/fd7f0f8cde5372d89926f1a80ab111c9 to your computer and use it in GitHub Desktop.
Save robsongomes/fd7f0f8cde5372d89926f1a80ab111c9 to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
machines = [
{
:name => "instance01",
:eth1 => "192.168.100.100",
:mem => "2048",
:cpu => "2"
},
{
:name => "instance02",
:eth1 => "192.168.100.200",
:mem => "2048",
:cpu => "2"
},
{
:name => "mysql",
:eth1 => "192.168.100.150",
:mem => "2048",
:cpu => "2"
}
]
Vagrant.configure(2) do |config|
config.vm.box = "generic/ubuntu1804"
machines.each do |opts|
config.vm.define opts[:name] do |config|
config.vm.hostname = opts[:name]
# config.vm.synced_folder "jgroups/", "/jgroups", owner: "vagrant"
config.vm.provider "virtualbox" do |v|
v.customize ["modifyvm", :id, "--name", opts[:name]]
v.customize ["modifyvm", :id, "--memory", opts[:mem]]
v.customize ["modifyvm", :id, "--cpus", opts[:cpu]]
end
config.vm.network :private_network, ip: opts[:eth1]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment