forked from openminds/sneakers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
50 lines (46 loc) · 1.67 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
require 'yaml'
begin
boxes_configuration = YAML.load_file('config.yml')
rescue Errno::ENOENT
abort "No config.yml found. Copy config.yml.example to get started."
end
Vagrant::Config.run do |config|
boxes_configuration.each do |box_config|
name = box_config[0]
box = box_config[1]
config.vm.define name do |node|
node.vm.host_name = name
node.vm.forward_port box['http_port'], box['http_port']
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "#{box['memory']}"]
end
end
node.vm.box = "debian-6.0.7-amd64-ruby1.9.3.box"
node.vm.box_url = 'http://mirror.openminds.be/vagrant-boxes/debian-6.0.7-amd64-ruby1.9.3.box'
node.vm.share_folder "apps", "/home/vagrant/apps/default", box['app_directory']
node.vm.provision :chef_solo do |chef|
chef.cookbooks_path = "chef/cookbooks"
chef.roles_path = "chef/roles"
chef.add_recipe "base"
chef.json.merge!(:base => {:name => name, :app_settings => box})
chef.add_recipe "apache"
chef.add_recipe "nginx"
chef.add_recipe "mysql"
chef.add_recipe "phpmyadmin"
case box['type']
when /^php5[3|4]$/
chef.add_recipe "apache::php"
chef.json.merge!(:php => {:version => box['type'] })
when "ruby193"
chef.add_recipe "apache::passenger"
else
raise "Unknown type of server. Needs to be php53, ruby193, ... Please RTFM."
end
## Enable for Chef development:
# chef.add_recipe "chef_handler"
# chef.add_recipe "minitest-handler"
end
end
end
end