# -*- mode: ruby -*- # vi: set ft=ruby : Vagrant.configure("2") do |config| # Base VM OS configuration. config.vm.box = "debian/bookworm64" config.ssh.insert_key = false config.vm.synced_folder '.', '/vagrant', disabled: true # General VirtualBox VM configuration. config.vm.provider :virtualbox do |v| v.memory = 1024 v.cpus = 1 v.linked_clone = true v.customize ["modifyvm", :id, "--natdnshostresolver1", "on"] v.customize ["modifyvm", :id, "--ioapic", "on"] end # lb HAproxy. config.vm.define "lb" do |lb| lb.vm.hostname = "lb.test" lb.vm.network :private_network, ip: "192.168.56.2" lb.vm.provision "shell", inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget" lb.vm.provision "ansible" do |ansible| ansible.playbook = "provision/setup-lb.yml" end end # NFS. config.vm.define "nfs" do |nfs| nfs.vm.hostname = "nfs.test" nfs.vm.network :private_network, ip: "192.168.56.6" nfs.vm.provision "shell", inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget" nfs.vm.provision "ansible" do |ansible| ansible.playbook = "provision/setup-nfs.yml" end end # MySQL. config.vm.define "db" do |db| db.vm.hostname = "db.test" db.vm.network :private_network, ip: "192.168.56.5" db.vm.provision "shell", inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget" db.vm.provision "ansible" do |ansible| ansible.playbook = "provision/setup-db.yml" end end # Kea DHCP server 1. config.vm.define "kea1" do |kea1| web1.vm.hostname = "kea1" web1.vm.network :private_network, ip: "192.168.56.2" web1.vm.provider :virtualbox do |v| v.customize ["modifyvm", :id, "--memory", 512] end web1.vm.provision "shell", inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget" web1.vm.provision "ansible" do |ansible| ansible.extra_vars = { srv_ip: "192.168.56.2", } ansible.playbook = "provision/setup-kea.yml" end end # Kea DHCP server 2. config.vm.define "web2" do |kea2| web2.vm.hostname = "kea2" web2.vm.network :private_network, ip: "192.168.56.3" web2.vm.provider :virtualbox do |v| v.customize ["modifyvm", :id, "--memory", 512] end web2.vm.provision "shell", inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget" web2.vm.provision "ansible" do |ansible| ansible.playbook = "provision/setup-kea.yml" end end end