forked from hugoShaka/ansible-mailserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
55 lines (49 loc) · 1.57 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- mode: ruby -*-
# vi: set ft=ruby :
#
ansible_groups = {
"dev:children" => ["dev-mail", "dev-test"],
"dev-mail:children" => ["mta", "mda", "db" ],
"dev-test" => ["tester"],
"mta" => ["north", "south"],
"mda" => ["north", "south"],
"db" => ["north"],
}
ansible_host_vars = {
"north" => {"ispmail_dovecot_replication_peer" => "south.mail.local"},
"south" => {"ispmail_dovecot_replication_peer" => "north.mail.local"}
}
Vagrant.configure(2) do |config|
config.vm.box = "debian/stretch64"
config.vm.define "north" do |subconfig|
subconfig.vm.hostname = "mailserver-north"
subconfig.vm.provider "virtualbox" do |vb|
subconfig.vm.network "private_network", ip: "10.0.0.100"
end
end
config.vm.define "south" do |subconfig|
subconfig.vm.hostname = "mailserver-south"
subconfig.vm.provider "virtualbox" do |vb|
subconfig.vm.network "private_network", ip: "10.0.0.101"
end
subconfig.vm.provision "ansible" do |ansible|
ansible.playbook = "test/mailserver-vagrant.yml"
ansible.limit = "dev-mail"
ansible.groups = ansible_groups
ansible.host_vars = ansible_host_vars
ansible.become = true
end
end
config.vm.define "tester" do |subconfig|
subconfig.vm.hostname = "tester"
subconfig.vm.provision "ansible" do |ansible|
ansible.limit = "all"
ansible.playbook = "test/tester-vagrant.yml"
ansible.become = true
ansible.groups = ansible_groups
end
subconfig.vm.provider "virtualbox" do |vb|
subconfig.vm.network "private_network", ip: "10.0.0.50"
end
end
end