-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
66 lines (59 loc) · 1.98 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "debian/wheezy64"
# Vagrant 1.7+ automatically inserts a different
# insecure keypair for each new VM created. The easiest way
# to use the same keypair for all the machines is to disable
# this feature and rely on the legacy insecure key.
#
# Note:
# As of Vagrant 1.7.3, it is no longer necessary to disable
# the keypair creation when using the auto-generated inventory.
config.ssh.insert_key = false
config.vm.define "web", primary: true do |web|
web.vm.provider :virtualbox do |vb|
vb.customize [
"modifyvm", :id,
"--name", "coast_web",
"--memory", "1024"
]
end
web.vm.network :forwarded_port, guest: 80, host: 8080
web.vm.network :private_network, ip: "192.168.10.2" # for NFS
web.vm.synced_folder "docroot", "/var/www", :nfs => true
web.vm.synced_folder "log", "/var/log/drupal7",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]
end
config.vm.define "db" do |db|
db.vm.provider :virtualbox do |vb|
vb.customize [
"modifyvm", :id,
"--name", "coast_db",
"--memory", "1024"
]
end
db.vm.network :private_network, ip: "192.168.10.3"
db.vm.network :forwarded_port, guest: 3306, host: 3306
db.vm.network :forwarded_port, guest: 5432, host: 5432
db.vm.network :forwarded_port, guest: 11211, host: 11211
db.vm.synced_folder "log", "/var/log/drupal7",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=664"]
db.vm.provision :ansible do |ansible|
# provision in parallel
ansible.limit = "all"
ansible.playbook = "playbook.yml"
ansible.groups = {
"webservers" => ["web"],
"dbservers" => ["db"],
"all:children" => ["web", "db"]
}
ansible.host_key_checking = false
end
end
end