summaryrefslogtreecommitdiffstats
path: root/vagrant/definitions
diff options
context:
space:
mode:
authorTails developers <amnesia@boum.org>2012-05-13 09:15:13 +0200
committerTails developers <amnesia@boum.org>2012-05-16 12:53:16 +0200
commitaa541fd824c8f73417d07f472f0514bce296e284 (patch)
treee86a3d2092403e729fcc2ef2cd73e2b312225fd6 /vagrant/definitions
parent703e118c80a355b8c43e927b83b6ef785f96d7ef (diff)
vagrant: Add task to create our squeeze basebox
As we use Veewee to automate the creation of the basebox, we are forced to back up on the "do not execute Vagrant manually" stance. This is due to the fact that Veewee is quite hackish and itself calls `vagrant` directly. So we move our monkey-patching from the Rakefile to the Vagrantfile itself. In order to support an HTTP proxy, the `preseed.cfg` file that Veewee need is created beforehands in another Rake task. Proxies bound to localhost will result in a failure and an explicit error messages. Note: it is unfortunately not possible to use `definitions.rb` to add `mirror/http/proxy` to the installer command-line. As the defined proxy is set by network-preesed, it will prevent the installer from retrieving the preseed file provided by Veewee on a local interface.
Diffstat (limited to 'vagrant/definitions')
-rw-r--r--vagrant/definitions/squeeze/postinstall.sh3
-rw-r--r--vagrant/definitions/squeeze/preseed.cfg.erb (renamed from vagrant/definitions/squeeze/preseed.cfg)2
2 files changed, 4 insertions, 1 deletions
diff --git a/vagrant/definitions/squeeze/postinstall.sh b/vagrant/definitions/squeeze/postinstall.sh
index d9149f3..e9b8a5a 100644
--- a/vagrant/definitions/squeeze/postinstall.sh
+++ b/vagrant/definitions/squeeze/postinstall.sh
@@ -38,6 +38,9 @@ echo "pre-up sleep 5" >> /etc/network/interfaces
# Clean downloaded APT packages
apt-get clean
+# Remove HTTP proxy configuration
+sed -e '/http::Proxy/d' -i /etc/apt/apt.conf
+
# Zero out the free space to save space in the final image:
dd if=/dev/zero of=/EMPTY bs=1M
rm -f /EMPTY
diff --git a/vagrant/definitions/squeeze/preseed.cfg b/vagrant/definitions/squeeze/preseed.cfg.erb
index 417a56c..47f0c2b 100644
--- a/vagrant/definitions/squeeze/preseed.cfg
+++ b/vagrant/definitions/squeeze/preseed.cfg.erb
@@ -10,7 +10,7 @@ d-i netcfg/get_domain string vagrantup.com
d-i mirror/country string manual
d-i mirror/http/hostname string cdn.debian.net
d-i mirror/http/directory string /debian
-d-i mirror/http/proxy string
+d-i mirror/http/proxy string <%= ENV['http_proxy'] %>
# Set clock to UTC
d-i clock-setup/utc boolean true