This repository has been archived by the owner on Oct 23, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
78 lines (62 loc) · 2.88 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
# vi: set ft=ruby
VAGRANTFILE_API_VERSION = "2"
SSH_PORT = 2232
Vagrant.require_version ">= 1.5.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "bento/ubuntu-14.04"
# awkward fix for SSH reassignment issue (re-evaluate w/ Vagrant 1.5.4)
config.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", disabled: true
config.vm.network :forwarded_port, guest: 22, host: SSH_PORT, auto_correct: true
config.vm.define "site" do |site|
site.vm.network "private_network", ip: "10.42.2.100"
site.vm.synced_folder "../opencivicdata.org", "/projects/opencivicdata.org/src/opencivicdata.org"
site.vm.provider "virtualbox" do |v|
v.name = "opencivicdata.org"
end
site.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/site.yml"
ansible.inventory_path = "ansible/hosts.vagrant"
ansible.limit = "all"
# needed for common tasks to avoid EBS & checkout over synced_folders
ansible.extra_vars = { deploy_type: "vagrant" }
# seems to avoid the delay with private IP not being available
ansible.raw_arguments = ["-T 30"]
end
end
config.vm.define "db" do |db|
db.vm.network "private_network", ip: "10.42.2.101"
db.vm.provider "virtualbox" do |v|
v.memory = 1024
v.name = "db.opencivicdata.org"
end
db.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/db.yml"
ansible.inventory_path = "ansible/hosts.vagrant"
ansible.limit = "all"
# needed for common tasks to avoid EBS & checkout over synced_folders
ansible.extra_vars = { deploy_type: "vagrant" }
# seems to avoid the delay with private IP not being available
ansible.raw_arguments = ["-T 30"]
end
end
config.vm.define "api" do |api|
api.vm.network "private_network", ip: "10.42.2.102"
api.vm.synced_folder "../api.opencivicdata.org", "/projects/api.opencivicdata.org/src/api.opencivicdata.org", mount_options: ["dmode=777,fmode=666"]
api.vm.synced_folder "../imago", "/projects/api.opencivicdata.org/src/imago"
api.vm.provider "virtualbox" do |v|
v.name = "api.opencivicdata.org"
end
api.vm.provision "ansible" do |ansible|
ansible.playbook = "ansible/api.yml"
ansible.inventory_path = "ansible/hosts.vagrant"
ansible.limit = "all"
# needed for common tasks to avoid EBS & checkout over synced_folders
ansible.extra_vars = { deploy_type: "vagrant" }
if ENV['USE_GEO']
ansible.extra_vars['use_geo'] = true
end
# seems to avoid the delay with private IP not being available
ansible.raw_arguments = ["-T 30"]
end
end
end