Allow enabling of a proxy for debootstrap
authorIustin Pop <iustin@google.com>
Mon, 7 Jul 2008 12:59:18 +0000 (12:59 +0000)
committerIustin Pop <iustin@google.com>
Mon, 7 Jul 2008 12:59:18 +0000 (12:59 +0000)
This is valid only for non-cached installs, of course, but it's still a
useful thing.

Reviewed-by: imsnah

README
create.in
defaults

diff --git a/README b/README
index a0b8bad..fec0722 100644 (file)
--- a/README
+++ b/README
@@ -48,6 +48,7 @@ will be ``/etc/default/ganeti-instance-debootstrap``.
 The following settings will be examined in this file (see also the file
 named 'defaults' in the source distribution for more details):
 
+- PROXY: http proxy to use for non-cached installs
 - MIRROR: the mirror to use if not the default one
 - ARCH: either i386 or amd64, otherwise your current architecture will
   be used
index a1e82ff..b168e5c 100755 (executable)
--- a/create.in
+++ b/create.in
@@ -30,6 +30,7 @@ fi
 # only if the user want to specify a mirror in the defaults file we
 # will use it, this declaration is to make sure the variable is set
 : ${MIRROR:=""}
+: ${PROXY:=""}
 : ${SUITE:="lenny"}
 : ${ARCH:=""}
 : ${EXTRA_PKGS:=""}
@@ -94,6 +95,9 @@ fi
 if [ -f "$CACHE_FILE" ]; then
   tar xf "$CACHE_FILE" -C $TMPDIR
 else
+  if [ "$PROXY" ]; then
+    export http_proxy="$PROXY"
+  fi
   # INCLUDE will be empty if EXTRA_PKGS is null/empty, otherwise we
   # build the full parameter format from it
   INCLUDE=${EXTRA_PKGS:+"--include=$EXTRA_PKGS"}
index ff143fe..3e9e128 100644 (file)
--- a/defaults
+++ b/defaults
@@ -4,6 +4,12 @@
 # on the next instance, customize this file before the instance
 # installation
 
+# PROXY: if non-null, use this as an http-proxy in order to speed up
+# non-cached installs; not that if not set, debootstrap might still
+# use a system-wide proxy setting if it is exported in the
+# ganeti-noded daemon environment
+# PROXY="http://proxy.example.com:3128/"
+
 # MIRROR: do not customize MIRROR if you want to be able to install
 # both debian and ubuntu, since they have different defaults; or
 # customize it before each install