-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
37 lines (33 loc) · 1.06 KB
/
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
32
33
34
35
36
37
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu/xenial64"
config.vm.provider "virtualbox" do |vb|
vb.memory = 3000
vb.cpus = 1
end
N = 5
(1..N).each do |machine_id|
config.vm.define "machine#{machine_id}" do |machine|
machine.vm.hostname = "machine#{machine_id}"
machine.vm.network "private_network", ip: "192.168.77.#{20+machine_id}"
# Only execute once the Ansible provisioner,
# when all the machines are up and ready.
if machine_id == N
machine.vm.provision :ansible do |ansible|
# Disable default limit to connect to all the machines
ansible.raw_arguments = [
"-e ansible_python_interpreter=/usr/bin/python3"
]
ansible.limit = "all"
ansible.groups = {
"postgres" => ["machine1"],
"memcached" => ["machine2"],
"redis" => ["machine3"],
"rabbitmq" => ["machine4"],
"zulip" => ["machine5"],
}
ansible.playbook = "playbook.yml"
end
end
end
end
end