54 lines
1.6 KiB
Ruby
54 lines
1.6 KiB
Ruby
# -*- mode: ruby -*-
|
|
# vi: set ft=ruby :
|
|
|
|
Vagrant.configure("2") do |config|
|
|
# Base VM OS configuration.
|
|
config.vm.box = "debian/bullseye64"
|
|
config.ssh.insert_key = false
|
|
config.vm.synced_folder '.', '/vagrant', disabled: true
|
|
|
|
# General VirtualBox VM configuration.
|
|
config.vm.provider :virtualbox do |v|
|
|
v.memory = 512
|
|
v.cpus = 1
|
|
v.linked_clone = true
|
|
v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
|
|
v.customize ["modifyvm", :id, "--ioapic", "on"]
|
|
end
|
|
|
|
# srv1 master.
|
|
config.vm.define "srv1" do |srv1|
|
|
srv1.vm.hostname = "srv1"
|
|
srv1.vm.network :private_network, ip: "192.168.56.10"
|
|
srv1.vm.provision "shell",
|
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
|
|
srv1.vm.provision "shell", path: "provision/setup-master.sh"
|
|
end
|
|
|
|
|
|
# srv2 slave.
|
|
config.vm.define "srv2" do |srv2|
|
|
srv2.vm.hostname = "srv2"
|
|
srv2.vm.network :private_network, ip: "192.168.56.11"
|
|
srv2.vm.provision "shell",
|
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
|
|
srv2.vm.provision "shell", path: "provision/setup-slave.sh"
|
|
end
|
|
|
|
# cli.
|
|
config.vm.define "cli" do |cli|
|
|
cli.vm.hostname = "cli"
|
|
cli.vm.network :private_network, ip: "192.168.56.30"
|
|
cli.vm.provider :virtualbox do |v|
|
|
v.customize ["modifyvm", :id, "--memory", 512]
|
|
end
|
|
cli.vm.provision "shell",
|
|
inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget"
|
|
cli.vm.provision "ansible" do |ansible|
|
|
ansible.playbook = "provision/setup-cli.sh"
|
|
end
|
|
end
|
|
|
|
end
|
|
|