-
Notifications
You must be signed in to change notification settings - Fork 18
/
Vagrantfile-prebuilt
60 lines (50 loc) · 2.26 KB
/
Vagrantfile-prebuilt
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
# -*- mode: ruby -*-
# vi: set ft=ruby :
CALTHORPE_UID = 209
CALTHORPE_GID = 209
VAGRANT_COMMAND = ARGV[0]
# Allow user to override amount of memory allocated
# to VM via environment variable.
VM_MEMORY = ENV['UF_VM_MEMORY'] || 4096
VM_CPUS = ENV['UF_VM_CPUS'] || 2
VM_PROXY = ENV['VAGRANT_PROXY'] || false
Vagrant.configure(2) do |config|
############################################################################
# GLOBAL SETTINGS
############################################################################
config.vm.box = "urbanfootprint/urbanfootprint"
config.vm.network "forwarded_port", guest: 80, host: 3333, host_ip: "localhost"
config.vm.network "forwarded_port", guest: 5432, host: 5555, host_ip: "localhost"
if VAGRANT_COMMAND == "ssh"
config.ssh.username = "calthorpe"
end
config.vm.provider "virtualbox" do |vb|
vb.memory = VM_MEMORY
vb.cpus = VM_CPUS
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--ioapic", "on"]
end
############################################################################
############################################################################
# VIRTUALBOX
############################################################################
config.vm.define "urbanfootprint" do |subvm|
subvm.vm.hostname = "urbanfootprint"
# Copy the vagrant user's list of authorized_keys to the calthorpe
# user so we can easily ssh in as calthorpe user.
config.vm.provision "shell", inline:
"mkdir -p /home/calthorpe/.ssh && \
cp /home/vagrant/.ssh/authorized_keys /home/calthorpe/.ssh/authorized_keys && \
chown #{CALTHORPE_UID}:#{CALTHORPE_GID} /home/calthorpe/.ssh/authorized_keys"
end
############################################################################
############################################################################
# PROXY SETTINGS
############################################################################
if Vagrant.has_plugin?("vagrant-proxyconf")
config.proxy.http = VM_PROXY
config.proxy.https = VM_PROXY
config.proxy.no_proxy = VM_PROXY && "localhost,127.0.0.1,.example.com"
end
############################################################################
end