-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
38 lines (34 loc) · 1.13 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
#setting environmental variable for DATABASE_URL
env_var_cmd = ""
if ENV['DATABASE_URL']
value = ENV['DATABASE_URL']
env_var_cmd = <<CMD
echo "export DATABASE_URL=#{value}" | tee -a /home/vagrant/.profile
CMD
end
script = <<SCRIPT
#{env_var_cmd}
SCRIPT
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.network 'forwarded_port', guest: 9292, host: 9292
# guestbook VM
config.vm.define "v1", primary: true do |v1|
config.vm.provision :shell, :inline => script
v1.vm.box = "ubuntu/trusty64"
v1.vm.provision "ansible" do |ansible|
ansible.playbook = 'provisioning/dev.yml'
ansible.verbose = 'vvv'
end
end
# Use vagrant-cachier to cache apt-get, gems and other stuff across machines
# Also consider using vagrant-exec, vagrant-faster and vagrant-omnibus
if Vagrant.has_plugin?('vagrant-cachier')
config.cache.scope = :box
else
puts "Run `vagrant plugin install vagrant-cachier` to reduce caffeine intake when provisioning"
end
end