Newer
Older
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
62
63
# -*- mode: ruby -*-
# vi: set ft=ruby :
REQUIRED_PLUGINS = %w(vagrant-cachier vagrant-vbguest)
exit unless REQUIRED_PLUGINS.all? do |plugin|
Vagrant.has_plugin?(plugin) || (
puts "The #{plugin} plugin is required. Please install it with:"
puts "$ vagrant plugin install #{plugin}"
false
)
end
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
HOSTNAME=`hostname -s`
isLocalMode=true
if HOSTNAME.strip.eql? "dbis-w65107"
# puts "Server mode"
isLocalMode=false
else
# puts "Local mode"
isLocalMode=true
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.boot_timeout = 600
# Hardware configuration
# WARNING: Be VERY careful with this settings!!!
# -> giving the client more cores can SLOW DOWN the VM (if there is not enough workload on the guest, two less cores on the host...)
config.vm.provider "virtualbox" do |v|
v.name = (isLocalMode ? "isochrone-local" : "isochrone")
v.gui = false
v.cpus = 1
v.memory = 2048
v.customize ["modifyvm", :id, "--cpuexecutioncap", "100"]
v.customize ["modifyvm", :id, "--ostype", "RedHat_64"]
end
# Enable vagrant-cachier plugin
config.cache.enable :yum
# Information about the box itself (name from vagrantcloud)
config.vm.box = "jayunit100/centos7"
# Setup of shared folders
config.vm.synced_folder "conf", "/setup/conf"
config.vm.synced_folder "img", "/setup/img"
# Setup environment on startup (done using a shell script)
config.vm.provision "shell", path: "bootstrap.sh", args: ["niko", "secretPhdPassword#2014!", (isLocalMode ? "true" : "false")]
# Network configuration
config.vm.network :forwarded_port, guest: 5432, host: 5432, auto_correct: true, id: "postgresql"
config.vm.network :forwarded_port, guest: 7474, host: 7474, auto_correct: true, id: "neo4j"
config.vm.network :forwarded_port, guest: 80, host: 8000, auto_correct: true, id: "httpd"
unless isLocalMode
config.vm.network :forwarded_port, guest: 8080, host: 8080, auto_correct: true, id: "tomcat"
end
# config.vm.network :private_network, :ip => '192.168.4.50'
# config.vm.network :public_network
end