forked from EthACKdotOrg/fogmail
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
50 lines (43 loc) · 1.38 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
$puppet = <<SCRIPT
sudo su -c " \
cd /vagrant/puppet
export FACTER_vagrant=true
puppet apply --hiera_config ./vagrant-hiera.yaml --modulepath=./modules $1.pp --verbose --show_diff
"
SCRIPT
# vagrant box add vagrant-box-metadata.json
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "fogmail/basebox"
config.vm.box_check_update = true
config.vm.provision "shell" do |s|
s.inline = $puppet
# create introducer
config.vm.define "introducer" do |node|
node.vm.hostname = 'introducer'
node.vm.network "private_network", ip: "192.168.50.2"
node.vm.network :forwarded_port, guest: 22, host: 8222
s.args = "introducer"
end
# create some storages
(1..4).each do |i|
config.vm.define "storage-#{i}" do |node|
node.vm.hostname = "storage-#{i}"
node.vm.network "private_network", ip: "192.168.50.2#{i}"
node.vm.network :forwarded_port, guest: 22, host: "823#{i}"
s.args = "storage"
end
end
# create some clients
(1..2).each do |i|
config.vm.define "mailserver-#{i}" do |node|
node.vm.hostname = "mailserver-#{i}"
node.vm.network "private_network", ip: "192.168.50.3#{i}"
node.vm.network :forwarded_port, guest: 22, host: "824#{i}"
s.args = "mailserver"
end
end
end
end