IMAGE_NAME = "bento/ubuntu-22.04" CONTROLPLANE_IP = "192.168.56.11" NODES = 1 Vagrant.configure("2") do |config| config.ssh.insert_key = false config.vm.provider "virtualbox" do |v| v.memory = 2048 v.cpus = 2 end config.vm.define "controlplane" do |master| master.vm.box = IMAGE_NAME master.vm.network "private_network", ip: CONTROLPLANE_IP master.vm.hostname = "controlplane" master.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yaml" ansible.extra_vars = { cluster_name: "gerar", node_ip: CONTROLPLANE_IP, is_controlplane: true, } end end (1..NODES).each do |i| config.vm.define "node-#{i}" do |node| node.vm.box = IMAGE_NAME node.vm.network "private_network", ip: "192.168.56.#{20 + i}" node.vm.hostname = "node-#{i}" node.vm.provision "ansible" do |ansible| ansible.playbook = "playbook.yaml" ansible.extra_vars = { cluster_name: "gerar", node_ip: "192.168.56.#{20 + i}", controlplane_ip: CONTROLPLANE_IP, is_controlplane: false, } end end end end