-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathVagrantfile
48 lines (40 loc) · 1.87 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
Vagrant.configure("2") do |config|
#override global variables to fit Vagrant setup
ENV['LEADER_NAME']||="leader01"
ENV['LEADER_IP']||="192.168.2.11"
ENV['FOLLOWER_NAME']||="follower01"
ENV['FOLLOWER_IP']||="192.168.2.10"
ENV['CERT_NAME']||="certificate"
ENV['CERT_IP']||="192.168.2.9"
#global config
config.vm.synced_folder ".", "/vagrant"
config.vm.synced_folder ".", "/usr/local/bootstrap"
config.vm.box = "allthingscloud/web-page-counter"
config.vm.provider "virtualbox" do |v|
v.memory = 1024
v.cpus = 1
# Hack below required for linux not MacOS
v.customize ["modifyvm", :id, "--audio", "none"]
end
config.vm.define "cert01" do |cert01|
cert01.vm.hostname = ENV['CERT_NAME']
cert01.vm.network "private_network", ip: ENV['CERT_IP']
cert01.vm.provision "shell", path: "scripts/generate_certificates.sh", run: "always"
end
config.vm.define "leader01" do |leader01|
leader01.vm.hostname = ENV['LEADER_NAME']
leader01.vm.network "private_network", ip: ENV['LEADER_IP']
leader01.vm.provision "shell", path: "scripts/install_consul.sh", run: "always"
leader01.vm.provision "shell", path: "scripts/consul_enable_acls_1.4.sh", run: "always"
leader01.vm.network "forwarded_port", guest: 8500, host: 8500
end
(1..1).each do |i|
config.vm.define "follower0#{i}" do |follower|
follower.vm.hostname = "follower0#{i}"
follower.vm.network "private_network", ip: "192.168.2.#{100+i*10}"
follower.vm.provision "shell", path: "scripts/install_consul.sh", run: "always"
follower.vm.provision "shell", path: "scripts/consul_enable_acls_1.4.sh", run: "always"
follower.vm.provision "shell", path: "scripts/initialise_terraform_consul_backend.sh", run: "always"
end
end
end