From d628f0656fe24ec660109577813ef56c4714eaeb Mon Sep 17 00:00:00 2001 From: Iustin Pop Date: Mon, 7 Jul 2008 12:59:18 +0000 Subject: [PATCH] Allow enabling of a proxy for debootstrap This is valid only for non-cached installs, of course, but it's still a useful thing. Reviewed-by: imsnah --- README | 1 + create.in | 4 ++++ defaults | 6 ++++++ 3 files changed, 11 insertions(+), 0 deletions(-) diff --git a/README b/README index a0b8bad..fec0722 100644 --- 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 diff --git a/create.in b/create.in index a1e82ff..b168e5c 100755 --- 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"} diff --git a/defaults b/defaults index ff143fe..3e9e128 100644 --- 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 -- 1.7.2.5