-
Notifications
You must be signed in to change notification settings - Fork 1
/
Vagrantfile
31 lines (27 loc) · 905 Bytes
/
Vagrantfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Vagrant.configure("2") do |config|
config.vm.box = "debian/bullseye64"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
vb.cpus = 3
end
config.vm.provision "shell", path: "provision_upgrade.sh"
config.vm.provision "shell", path: "provision_ansible.sh"
config.vm.provision "ansible_local" do |ansible|
ansible.playbook = "playbook.createcluster.yml"
ansible.groups = {
"cp" => ["controlplane"],
"workers" => ["worker-1", "worker-2"],
"all:vars" => { "ansible_python_interpreter" => "/usr/bin/python3" }
}
end
config.vm.define "controlplane" do |cp|
cp.vm.hostname = "controlplane"
cp.vm.network "private_network", ip: "192.168.111.11"
end
(1..2).each do |i|
config.vm.define "worker-#{i}" do |w|
w.vm.hostname = "worker-#{i}"
w.vm.network "private_network", ip: "192.168.111.1#{i + 1}"
end
end
end