forked from poanetwork/deployment-playbooks
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
60 lines (49 loc) · 1.5 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
ENV["LC_ALL"] = "en_US.UTF-8"
Vagrant.configure("2") do |config|
servers = [ "validator", "explorer", "moc", "bootnode", "netstat", "blockscout" ]
platform_os = ENV["poa_platform"]
if platform_os == "ubuntu"
platform = "ubuntu/xenial64"
elsif platform_os == "centos"
platform = "centos/7"
else
platform = "ubuntu/xenial64"
end
plugin_installed = false
unless Vagrant.has_plugin? ("vagrant-disksize")
system "vagrant plugin install vagrant-disksize"
plugin_installed = true
end
# Restart Vagrant when new plugin is installed
if plugin_installed === true
exec "vagrant #{ARGV.join' '}"
end
servers.each do |machine|
config.vm.define machine do |node|
node.vm.box = platform
node.disksize.size = '100GB'
node.vm.hostname = machine
node.vm.provision :ansible do |ansible|
ansible.compatibility_mode = "2.0"
ansible.playbook = "site.yml"
ansible.groups = {
"validator" => ["validator"],
"explorer" => ["explorer"],
"netstat" => ["netstat"],
"moc" => ["moc"],
"bootnode" => ["bootnode"],
"blockscout" => ["blockscout"],
}
ansible.groups[platform_os] = [ "validator", "explorer", "netstat", "moc", "bootnode", "blockscout" ]
end
node.vm.provision :shell do |shell|
shell.path = "./tests/#{machine}.sh"
end
end
end
config.vm.provider "virtualbox" do |vb|
vb.memory = 1024
vb.cpus = 1
vb.linked_clone = true
end
end