-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
30 lines (26 loc) · 825 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
# -*- mode: ruby -*-
Vagrant.configure("2") do |config|
config.vm.define "balancer" do |bal|
bal.vm.box = "geerlingguy/debian10"
bal.vm.network "private_network", ip: "192.168.56.17"
bal.vm.provision "ansible" do |ansible|
ansible.limit = "balancer"
ansible.playbook = "playbook-balancer.yaml"
end
end
# If you change N>2 then add more entries to the inventory file.
N = 2
(1..2).each do |id|
config.vm.define "backend#{id}" do |be|
be.vm.box = "geerlingguy/debian10"
be.vm.network "private_network", ip: "192.168.56.#{id + 17}"
if id == N
be.vm.provision "ansible" do |ansible|
ansible.inventory_path = "./inventory"
ansible.limit = "all"
ansible.playbook = "playbook-backend.yaml"
end
end
end
end
end