forked from xforty/vagrant-drupal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
115 lines (100 loc) · 3.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
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
#
# Name of imported base box. (HINT: Rename this box)
#
config.vm.box = "ubuntu-11.10-server-amd64"
#
# Download url of base box if it has not been previously imported.
# See http://vagrantbox.es/ for more pre-built base boxes or
# build your own using https://github.com/jedi4ever/veewee
#
config.vm.box_url = "http://dl.dropbox.com/u/56687100/ubuntu-11.10-server-amd64.box"
#
# Set the memory size
#
config.vm.customize ["modifyvm", :id, "--memory", "1024"]
#
# Use port-forwarding. Web site will be at http://localhost:4567
# Forwards guest port 80 to host port 4567 and name the mapping "web".
#
config.vm.forward_port(80, 4567, :auto => true)
#
# Use host-only networking. Sets the VM's private IP address.
# Un-comment this line to use. Make sure port-forwarding is
# commented out. Requires you to edit your /etc/hosts file to
# add the line: "172.21.21.21 local.drupal". Do so at your
# own risk. Site will then available at http://local.drupal
#
# config.vm.network :hostonly, "172.21.21.21"
#
# Create /srv if it doesn't exist and share with VM.
# The /srv path is owned by www-data so apache can write to it.
#
srv_path = File.expand_path(File.dirname(__FILE__)) + "/srv"
config.vm.share_folder("srv", "/srv", srv_path, :owner => "vagrant", :group => "www-data", :create => true)
#
# NFS Support. The vboxfs is known to have performance issues
# http://vagrantup.com/docs/nfs.html#performance_benchmarks
#
# If you want to use NFS simple halt your running instance, comment out the
# share_folder above and uncomment the share_folder below.
#
# config.vm.share_folder("srv", "/srv", srv_path, :nfs => true, :create => true);
#
# Provision a new VM using chef-solo. The librarian gem controls
# the "cookbook" folder, do not touch it. If you need to create
# site-specific cookbooks, place them in "site-cookbooks".
#
config.vm.provision :chef_solo do |chef|
chef.log_level = :debug if ENV['vdb']
chef.cookbooks_path = ["cookbooks", "site-cookbooks"]
#
# Uncomment for local caching. This makes drush make run faster on
# subsequent calls.
#
# chef.add_recipe "squid"
chef.add_recipe "xforty"
chef.add_recipe "drupal"
chef.add_recipe "drush::make"
chef.add_recipe "initdb"
# Specify custom JSON node attributes:
chef.json.merge!(
:drupal => {
# If you change the project name you need to alter your /etc/hosts name
# to local.project_name if you are using host-only netowrking. For
# example if you change the project_name to "www.xforty.com" you would
# add local.www.xforty.com to your /etc/hosts file.
:project_name => "drupal",
# Comment out server_name if you are using host-only networking.
:server_name => "localhost"
},
:mysql => {
:server_root_password => "root"
},
:initdb => {
:mysql => {
:connection => {
:username => "root",
:password => "root",
:host => "localhost"
},
:databases => {
"drupal" => {
:action => :create
}
},
:users => {
"dbuser" => {
:action => :grant,
:database_name => "drupal",
:host => "localhost",
:password => "password"
}
}
}
}
)
end
end