Skip to content

Instantly share code, notes, and snippets.

@ashrithr
Last active August 29, 2021 16:31
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ashrithr/ac3f7b50aff92626e897 to your computer and use it in GitHub Desktop.
Save ashrithr/ac3f7b50aff92626e897 to your computer and use it in GitHub Desktop.
vagrant multi machine centos
# -*- mode: ruby -*-
# vi: set ft=ruby :
boxes = [
{
name: "server1.local",
eth1: "192.168.0.101",
mem: 1024,
cpu: 1
},
{
name: "server2.local",
eth1: "192.168.0.102",
mem: 1024,
cpu: 1
}
]
Vagrant.configure(2) do |config|
config.vm.box = "nrel/CentOS-6.5-x86_64"
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