-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
executable file
·43 lines (37 loc) · 1.22 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
IMAGE_1804 = "bento/ubuntu-18.04"
IMAGE_2004 = "bento/ubuntu-20.04"
IMAGE_2204 = "bento/ubuntu-22.04"
ENV['VAGRANT_NO_PARALLEL'] = 'yes'
Vagrant.configure(2) do |config|
config.vm.provision "shell", path: "bootstrap.sh"
NodeType1 = 0
(1..NodeType1).each do |type1_id|
config.vm.define "type1#{type1_id}" do |type1_vm|
type1_vm.vm.box = IMAGE_2204
type1_vm.vm.hostname = "type1#{type1_id}"
type1_vm.vm.network "private_network", ip: "192.168.56.10#{type1_id}"
type1_vm.vm.provider "virtualbox" do |v|
v.name = "type1#{type1_id}"
v.memory = 1024
v.cpus = 1
end
type1_vm.vm.provision "shell", path: "bootstrap_t1.sh"
end
end
NodeType2 = 2
(1..NodeType2).each do |type2_id|
config.vm.define "type2#{type2_id}" do |type2_vm|
type2_vm.vm.box = IMAGE_2204
type2_vm.vm.hostname = "type2#{type2_id}.example.com"
type2_vm.vm.network "private_network", ip: "192.168.56.11#{type2_id}"
type2_vm.vm.provider "virtualbox" do |v|
v.name = "type2#{type2_id}"
v.memory = 1024
v.cpus = 1
end
type2_vm.vm.provision "shell", path: "bootstrap_t2.sh"
end
end
end
#config.vm.provider "virtualbox" do |vb|
# vb.gui = true