-
Notifications
You must be signed in to change notification settings - Fork 37
/
Vagrantfile
79 lines (59 loc) · 2.85 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# coding: utf-8
Vagrant.require_version ">= 1.6.0"
CONSUL_BINARY = "consul-enterprise_1.0.7+ent_linux_amd64.zip"
VAULT_BINARY = "vault-enterprise_0.10.1+ent_linux_amd64.zip"
Vagrant.configure("2") do |config|
config.vm.define "statsbox", autostart: true do |statsbox|
statsbox.vm.box = "ubuntu/xenial64"
statsbox.vm.provider "virtualbox" do |vb|
vb.linked_clone = true
vb.memory = "1024"
vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ]
end
statsbox.vm.hostname = "statsbox"
statsbox.vm.network "private_network", ip: "10.13.37.10"
statsbox.vm.network "forwarded_port", guest: 3000, host: 3000 # Graphite UI
statsbox.vm.network "forwarded_port", guest: 8086, host: 8086 # InfluxDB
statsbox.vm.network "forwarded_port", guest: 8888, host: 8888 # Chronograf
statsbox.vm.network "forwarded_port", guest: 9092, host: 9092 # Kapacitor
statsbox.vm.provision "hosts", autoconfigure: true, sync_hosts: true
statsbox.vm.provision "shell", path: "statsbox/statsbox.sh"
end
%w(consul0 consul1 consul2).each_with_index do |nodename, consul_index|
config.vm.define "#{nodename}", autostart: true do |thisnode|
thisnode.vm.box = "ubuntu/xenial64"
thisnode.vm.provider "virtualbox" do |vb|
vb.linked_clone = true
vb.memory = "512"
vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ]
end
ip_address = "10.13.37.#{20 + consul_index}"
thisnode.vm.hostname = "#{nodename}"
thisnode.vm.network "private_network", ip: ip_address
if "#{nodename}".include? "consul0" then
thisnode.vm.network "forwarded_port", guest: 8500, host: 8500 # Consul UI
end
thisnode.vm.provision "hosts", autoconfigure: true, sync_hosts: true
thisnode.vm.provision "shell", path: "consul/consul-server.sh"
end
end
%w(vault0 vault1 vault2).each_with_index do |nodename, vault_index|
config.vm.define "#{nodename}", autostart: true do |thisnode|
thisnode.vm.box = "ubuntu/xenial64"
thisnode.vm.provider "virtualbox" do |vb|
vb.linked_clone = true
vb.memory = "512"
vb.customize [ "guestproperty", "set", :id, "/VirtualBox/GuestAdd/VBoxService/--timesync-set-threshold", 1000 ]
end
thisnode.vm.hostname = "#{nodename}"
ip_address = "10.13.37.#{30 + vault_index}"
if "#{nodename}".include? "vault0" then
thisnode.vm.network "forwarded_port", guest: 8200, host: 8200 # Vault UI
thisnode.vm.provision "shell", path: "vault/databases.sh"
end
thisnode.vm.provision "hosts", autoconfigure: true, sync_hosts: true
thisnode.vm.provision "shell", path: "consul/consul-client.sh"
thisnode.vm.provision "shell", path: "vault/vault-server.sh"
end
end
end