-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathVagrantfile
71 lines (57 loc) · 2.12 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
VBOXNAME = "alerts-dev"
VBOXRAM = 2048
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.ssh.forward_agent = true
config.vm.box = "ubuntu/xenial64"
#XXX vagrant-vbguest has incompatibilities with vagrant-cachier /apt/list/...
if Vagrant.has_plugin?("vagrant-vbguest")
config.vbguest.auto_update = true
config.vbguest.installer = VagrantVbguest::Installers::Ubuntu
end
config.vm.define "virtualbox" do |virtualbox|
virtualbox.vm.network :private_network, ip: "10.1.1.2"
if ENV['USER'] == 'runyaga'
virtualbox.vm.network :public_network, ip: "172.16.1.3", bridge: 'en0: Wi-Fi (AirPort)'
else
virtualbox.vm.network :public_network, ip: "172.16.1.3"
end
virtualbox.vm.network "forwarded_port", guest: 8080, host: 8080
virtualbox.vm.provision :shell,
:inline => "(grep -q -E '^mesg n$' /root/.profile && " \
"sed -i 's/^mesg n$/tty -s \\&\\& mesg n/g' /root/.profile && " \
"echo 'Ignore the previous error about stdin not being a tty. Fixing it now...') || exit 0;"
virtualbox.vm.provision :shell, :path => "provision.sh", :args=>VBOXNAME
config.vm.synced_folder ".", "/vagrant"
if ENV['USER'] == 'frapell'
if Vagrant.has_plugin?("vagrant-cachier")
config.cache.scope = :box
config.cache.enable :apt_lists
config.cache.enable :apt
config.cache.enable :npm
end
end
end
config.vm.provider "virtualbox" do |vb|
if ENV['USER'] == 'frapell'
# Intentionally left blank
else
vb.memory = VBOXRAM
end
end
if Vagrant.has_plugin?("vagrant-triggers")
if ENV['USER'] == 'frapell'
# Intentionally left blank
else
config.trigger.after :destroy do
# delete virtualenv leftovers
run "rm -rf bin lib include"
# delete buildout leftovrs
run "rm -rf parts var eggs develop-eggs cache .mr.developer.cfg .installed.cfg local"
end
end
end
end