-
Notifications
You must be signed in to change notification settings - Fork 2
/
Vagrantfile
45 lines (36 loc) · 1.23 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
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant Debian Proxy VM
# Sets up a simple VM with a Squid proxy/cache to speed up local package installs for Debian/Ubuntu
# Brian Cantoni
# ref: http://www.garron.me/en/blog/ubuntu-deb-proxy-cache.html
# Adjustable settings
CFG_MEMSIZE = "2000" # max memory for each VM
CFG_TZ = "US/Pacific" # timezone, like US/Pacific, US/Eastern, UTC, Europe/Warsaw, etc.
CFG_IP = "10.211.54.100" # private IP address
node_script = <<SCRIPT
#!/bin/bash
# set timezone
echo "#{CFG_TZ}" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata
# install a few base packages
apt-get update
apt-get install vim curl python-pip squid-deb-proxy squid-deb-proxy-client -y
SCRIPT
# VM configurations
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.define :debcache do |x|
x.vm.box = "hashicorp/precise64"
x.vm.provider "vmware_fusion" do |v|
v.vmx["memsize"] = CFG_MEMSIZE
end
x.vm.provider :virtualbox do |v|
v.name = "debcache"
v.customize ["modifyvm", :id, "--memory", CFG_MEMSIZE]
end
x.vm.network :private_network, ip: CFG_IP
x.vm.hostname = "debcache"
x.vm.provision :shell, :inline => node_script
end
end