forked from opengovfoundation/madison
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Vagrantfile
96 lines (78 loc) · 3.72 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Usage: ENV=staging vagrant up
VAGRANTFILE_API_VERSION = "2"
require 'json'
localConf = JSON.parse(File.read('VagrantConfig.json'))
environment = "development"
if ENV["ENV"] && ENV["ENV"] != ''
environment = ENV["ENV"].downcase
end
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.provision :shell, :path => "puppet_bootstrap.sh"
if environment == 'development'
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/precise64.box"
config.vm.network :forwarded_port, guest: 80, host: 10080 # apache http
config.vm.network :forwarded_port, guest: 3306, host: 3306 # mysql
config.vm.network :forwarded_port, guest: 10081, host: 10081 # zend http
config.vm.network :forwarded_port, guest: 10082, host: 10082 # zend https
config.vm.network :private_network, ip: localConf['ipAddress']
config.vm.provider :virtualbox do |vb, override|
vb.gui = false
vb.customize ["modifyvm", :id, "--memory", localConf['vmMemory']]
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant-root", "1"]
config.vm.synced_folder ".", "/vagrant", :group => "www-data", :mount_options => [ "dmode=775", "fmode=775" ]
end
config.vm.provision :puppet do |puppet|
puppet.options = "--verbose --debug"
puppet.manifests_path = "puppet/manifests"
puppet.module_path = "puppet/modules"
puppet.manifest_file = "site.pp"
puppet.facter = {
"vagrant" => true,
"environment" => environment,
"site_domain" => localConf['siteDomain'],
"role" => "local",
"awsAccessKey" => localConf['aws']['accessKey'],
"awsSecretKey" => localConf['aws']['secretKey'],
"php_version" => localConf['phpVersion']
}
end
end
if environment == 'ec2'
config.vm.provision :shell, :path => "aws_bootstrap.sh"
config.vm.box = "dummy"
config.vm.provider :aws do |aws, override|
aws.access_key_id = localConf['aws']['accessKey']
aws.secret_access_key = localConf['aws']['secretKey']
aws.instance_type = localConf['aws']['instanceType']
aws.region = localConf['aws']['region']
aws.security_groups = localConf['aws']['securityGroups']
aws.tags = {
"environment" => environment,
"elastic_ip" => localConf['aws']['elasticIP'],
"Name" => localConf['aws']['name']
}
aws.region_config localConf['aws']['region'] do |region|
region.ami = localConf['aws']['ami']
region.keypair_name = localConf['aws']['keyPair']
end
override.ssh.username = "ubuntu"
override.ssh.private_key_path = "~/.ssh/appdemos.pem"
end
config.vm.provision :puppet do |puppet|
puppet.options = "--verbose --debug"
puppet.manifests_path = "puppet/manifests"
puppet.module_path = "puppet/modules"
puppet.manifest_file = "site.pp"
puppet.facter = {
"site_domain" => localConf['siteDomain'],
"environment" => environment,
"aws_access_key" => localConf['aws']['accessKey'],
"aws_secret_key" => localConf['aws']['secretKey'],
"php_version" => localConf['phpVersion']
}
end
end
end