Skip to content

Instantly share code, notes, and snippets.

@spy86
Created September 20, 2020 11:04
Show Gist options
  • Save spy86/a37e5abebda9c2554296f2b6e46559b9 to your computer and use it in GitHub Desktop.
Save spy86/a37e5abebda9c2554296f2b6e46559b9 to your computer and use it in GitHub Desktop.
multiple vagrant boxes - Centos 7
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{
name: "master.local",
eth1: "192.168.123.123",
mem: 1024,
cpu: 1
},
{
name: "node1.local",
eth1: "192.168.123.124",
mem: 1024,
cpu: 1
}
]
Vagrant.configure(2) do |config|
config.vm.box = "generic/centos7"
boxes.each do |box|
config.vm.define box[:name] do |srv|
srv.vm.hostname = box[:name]
srv.vm.network :private_network, ip: box[:eth1]
srv.vm.provider :virtualbox do |vb|
vb.memory = box[:mem]
vb.cpus = box[:cpu]
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment