# -*- 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 # 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| kea1.vm.hostname = "kea1" kea1.vm.network :private_network, ip: "192.168.56.2" kea1.vm.provider :virtualbox do |v| v.customize ["modifyvm", :id, "--memory", 512] end kea1.vm.provision "shell", inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget" kea1.vm.provision "ansible" do |ansible| ansible.extra_vars = { srv_name: "kea1", srv_ip: "192.168.56.2", } ansible.playbook = "provision/setup-kea.yml" end end # Kea DHCP server 2. config.vm.define "kea2" do |kea2| kea2.vm.hostname = "kea2" kea2.vm.network :private_network, ip: "192.168.56.3" kea2.vm.provider :virtualbox do |v| v.customize ["modifyvm", :id, "--memory", 512] end kea2.vm.provision "shell", inline: "sudo apt-get update ; sudo apt-get install -y vim curl wget" kea2.vm.provision "ansible" do |ansible| ansible.extra_vars = { srv_name: "kea2", srv_ip: "192.168.56.3", } ansible.playbook = "provision/setup-kea.yml" end end # client DHCP . config.vm.define "cli" do |cli| cli.vm.hostname = "cli" #cli.vm.network :private_network, ip: "192.168.56.3" cli.vm.network :private_network, type: "dhcp" 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" end end