-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
116 lines (96 loc) · 3.56 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
VAGRANT_OS = "https://cloud-images.ubuntu.com/vagrant/trusty/current/trusty-server-cloudimg-amd64-vagrant-disk1.box"
VAGRANT_SYNC_FOLDER = "../"
VAGRANT_HOSTNAME = "sandbox"
VAGRANT_MEMORY = "2048"
PHP_IP = "192.168.56.200"
JAVA_IP = "192.168.56.201"
NODEJS_IP = "192.168.56.202"
PYTHON_IP = "192.168.56.203"
RUBY_IP = "192.168.56.204"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu64-trusty"
config.vm.box_url = VAGRANT_OS
config.vm.synced_folder VAGRANT_SYNC_FOLDER, "/home/vagrant/workspace/"
config.vm.hostname = VAGRANT_HOSTNAME
config.vbguest.no_remote = false
config.vm.provider :virtualbox do |vb|
vb.name = "Sandbox"
vb.gui = false
vb.customize ["modifyvm", :id, "--memory", VAGRANT_MEMORY]
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
config.vm.define "php" do |php|
php.vm.box = "php"
php.vm.network :private_network, ip: PHP_IP
php.vm.provider :virtualbox do |vb|
vb.name = "Sandbox-PHP"
end
php.vm.provision "ansible" do |ansible|
ansible.verbose = "v"
ansible.playbook = "provisioning/playbook-php.yml"
ansible.inventory_path = "vagrant-inventory"
ansible.host_key_checking = false
ansible.limit = "php"
end
end
config.vm.define "nodejs" do |nodejs|
nodejs.vm.box = "nodejs"
nodejs.vm.network :private_network, ip: PHP_IP
nodejs.vm.provider :virtualbox do |vb|
vb.name = "Sandbox-NodeJS"
end
nodejs.vm.provision "ansible" do |ansible|
ansible.verbose = "v"
ansible.playbook = "provisioning/playbook-nodejs.yml"
ansible.inventory_path = "vagrant-inventory"
ansible.host_key_checking = false
ansible.limit = "nodejs"
end
end
config.vm.define "java" do |java|
java.vm.box = "java"
java.vm.network :private_network, ip: JAVA_IP
java.vm.provider :virtualbox do |vb|
vb.name = "Sandbox-Java"
end
java.vm.provision "ansible" do |ansible|
ansible.verbose = "v"
ansible.playbook = "provisioning/playbook-java.yml"
ansible.inventory_path = "vagrant-inventory"
ansible.host_key_checking = false
ansible.limit = "java"
end
end
config.vm.define "python" do |python|
python.vm.box = "python"
python.vm.network :private_network, ip: PYTHON_IP
python.vm.provider :virtualbox do |vb|
vb.name = "Sandbox-Python"
end
python.vm.provision "ansible" do |ansible|
ansible.verbose = "v"
ansible.playbook = "provisioning/playbook-python.yml"
ansible.inventory_path = "vagrant-inventory"
ansible.host_key_checking = false
ansible.limit = "python"
end
end
config.vm.define "ruby" do |ruby|
ruby.vm.box = "python"
ruby.vm.network :private_network, ip: PYTHON_IP
ruby.vm.provider :virtualbox do |vb|
vb.name = "Sandbox-Ruby"
end
ruby.vm.provision "ansible" do |ansible|
ansible.verbose = "v"
ansible.playbook = "provisioning/playbook-ruby.yml"
ansible.inventory_path = "vagrant-inventory"
ansible.host_key_checking = false
ansible.limit = "ruby"
end
end
end