forked from discoposse/nomad-vagrant-lab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile.6node
35 lines (32 loc) · 1 KB
/
Vagrantfile.6node
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "bento/ubuntu-16.04" # 16.04 LTS
config.vm.provider "virtualbox" do |vb|
vb.memory = "1516"
end
# 3-node configuration - Region A
(1..3).each do |i|
config.vm.define "nomad-a-#{i}" do |n|
n.vm.provision "shell", path: "node-install-a.sh"
if i == 1
# Expose the nomad ports
n.vm.network "forwarded_port", guest: 4646, host: 4646, auto_correct: true
end
n.vm.hostname = "nomad-a-#{i}"
n.vm.network "private_network", ip: "172.16.1.#{i+100}"
end
end
# 3-node configuration - Region B
(1..3).each do |i|
config.vm.define "nomad-b-#{i}" do |n|
n.vm.provision "shell", path: "node-install-b.sh"
if i == 1
# Expose the nomad ports
n.vm.network "forwarded_port", guest: 4646, host: 4646, auto_correct: true
end
n.vm.hostname = "nomad-b-#{i}"
n.vm.network "private_network", ip: "172.16.1.#{i+200}"
end
end
end