Skip to content

Instantly share code, notes, and snippets.

@dmitry-lyutenko
Created July 12, 2019 06:45
Show Gist options
  • Select an option

  • Save dmitry-lyutenko/532aea3b29e5ca9b7b5cc2011ae96faa to your computer and use it in GitHub Desktop.

Select an option

Save dmitry-lyutenko/532aea3b29e5ca9b7b5cc2011ae96faa to your computer and use it in GitHub Desktop.
INTENT_TYPE="internal-net"
MACHINES = {
:"gl1" => {
:box_name => "centos/7",
:net => [
{ip: '10.10.10.11', adapter: 2, netmask: "255.255.255.0"},
{ip: '10.12.12.1', adapter: 3, netmask: "255.255.255.0", virtualbox__intnet: INTENT_TYPE},
],
:cpus => 1,
:memory => 256,
:default_gw => "10.10.10.1"
},
:"gl2" => {
:box_name => "centos/7",
:net => [
{ip: '10.10.10.12', adapter: 2, netmask: "255.255.255.0"},
{ip: '10.12.12.2', adapter: 3, netmask: "255.255.255.0", virtualbox__intnet: INTENT_TYPE},
],
:cpus => 1,
:memory => 256,
:default_gw => "10.10.10.1"
},
}
Vagrant.configure("2") do |config|
MACHINES.each do |boxname, boxconfig|
config.vm.define boxname do |box|
box.vm.box = boxconfig[:box_name]
box.vm.host_name = boxname.to_s
boxconfig[:net].each do |ipconf|
box.vm.network "private_network", ipconf
end
box.vm.provider "virtualbox" do |v|
v.memory = boxconfig[:memory]
v.cpus = boxconfig[:cpus]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment