Skip to content

Instantly share code, notes, and snippets.

@sergkondr
Last active February 28, 2020 08:58
Show Gist options
  • Save sergkondr/928cec9932e901ac40e24fc3660815cc to your computer and use it in GitHub Desktop.
Save sergkondr/928cec9932e901ac40e24fc3660815cc to your computer and use it in GitHub Desktop.
# -*- mode: ruby -*-
# vi: set ft=ruby :
os = "ubuntu/bionic64"
domain = "my.lab"
additional_disk = false
hosts = {
"server01" => "192.168.33.10",
# "server02" => "192.168.33.11",
# "server03" => "192.168.33.12",
# "client01" => "192.168.33.13",
# "client02" => "192.168.33.14"
}
Vagrant.configure("2") do |config|
hosts.each do |name, ip|
config.vm.define name do |machine|
machine.vm.box = os
machine.vm.hostname = "%s.%s" % [name, domain]
machine.vm.network :private_network, ip: ip
machine.vm.provider "virtualbox" do |v|
v.name = name
v.customize ["modifyvm", :id, "--memory", 512]
if additional_disk
disk = './disk_%s.vdi' % name
if not File.exist?(disk)
v.customize ['createhd', '--filename', disk, '--size', 2 * 1024, '--format', 'VDI']
end
v.customize ['storageattach', :id, '--storagectl', 'SCSI', '--port', 3, '--device', 0, '--type', 'hdd', '--medium', disk]
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment