-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVagrantfile
More file actions
61 lines (55 loc) · 2.25 KB
/
Copy pathVagrantfile
File metadata and controls
61 lines (55 loc) · 2.25 KB
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
ram=ENV['DOCKER_RAM']||1024
cpus=ENV['DOCKER_CPUS']||2
basehostname=ENV['HOSTNAME']||1
hostname='docker-node-'+basehostname.to_s
nodes = [
{ :hostname => hostname+"-1", :ram => ram , :cpus => cpus }
]
Vagrant.configure("2") do |config|
## Provision nodes
nodes.each do |node|
config.vm.define node[:hostname] do |nodeconfig|
nodeconfig.vm.box ="ebruno/ansible-docker"
nodeconfig.vm.hostname = node[:hostname] + ".box"
# nodeconfig.vm.network :private_network, ip: node[:ip]
memory = node[:ram] ? node[:ram] : 512;
cpus = node[:cpus] ? node[:cpus] : 1;
nodeconfig.vm.provider :virtualbox do |vb|
vb.customize [
"modifyvm", :id,
"--memory", memory.to_s,
"--cpus", cpus.to_s
]
end
end
## Create a forwarded port mapping which allows access to a specific port
## within the machine from a port on the host machine and only allow access
## via 127.0.0.1 to disable public access
config.vm.define hostname+"-1" do |masterconfig|
# masterconfig.vm.network "forwarded_port", guest: 80, host: 80,
# auto_correct: true #, host_ip: "127.0.0.1"
# masterconfig.vm.network "forwarded_port", guest: 443, host: 443,
# auto_correct: true #, host_ip: "127.0.0.1"
masterconfig.vm.network "forwarded_port", guest: 8080, host: 8080,
auto_correct: true , host_ip: "127.0.0.1"
masterconfig.vm.network "forwarded_port", guest: 4443, host: 4443,
auto_correct: true , host_ip: "127.0.0.1"
# H2 Database
masterconfig.vm.network "forwarded_port", guest: 1521, host: 1521,
auto_correct: true , host_ip: "127.0.0.1"
#Postgres Database
masterconfig.vm.network "forwarded_port", guest: 5432, host: 5432,
auto_correct: true , host_ip: "127.0.0.1"
#MySQL Database
masterconfig.vm.network "forwarded_port", guest: 3306, host: 3306,
auto_correct: true , host_ip: "127.0.0.1"
# Share an additional folder to the guest VM. The first argument is
# the path on the host to the actual folder. The second argument is
# the path on the guest to mount the folder. And the optional third
# argument is a set of non-required options.
masterconfig.vm.synced_folder "~/", "/vagrant_data"
end
end
end