From e3a1d1fcb97f95810e925eaad61ff3bc3ddcff29 Mon Sep 17 00:00:00 2001 From: Antony Messerli Date: Wed, 13 Dec 2017 16:23:55 -0600 Subject: [PATCH] Allows for the VMs preseed mirror to be overridden In the case the upstream mirror might be down or there might be a faster mirror available, this allows you to specify the desired Ubuntu mirror and base directory. Change-Id: I49c33b9e4e107990f2abb418b859fd280ba91107 --- multi-node-aio/README.rst | 5 +++++ multi-node-aio/build.sh | 2 ++ multi-node-aio/playbooks/pxe/debian/compute.preseed.j2 | 6 +++--- multi-node-aio/playbooks/pxe/debian/infra.preseed.j2 | 6 +++--- multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 | 6 +++--- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/multi-node-aio/README.rst b/multi-node-aio/README.rst index 3e9de5ae..93155fd7 100644 --- a/multi-node-aio/README.rst +++ b/multi-node-aio/README.rst @@ -146,6 +146,11 @@ Instruct the system to configure iptables prerouting rules for connecting to VMs from outside the host: ``CONFIG_PREROUTING=${CONFIG_PREROUTING:-true}`` +Insrtuct the system to use a different Ubuntu mirror: + ``DEFAULT_MIRROR_HOSTNAME=${DEFAULT_MIRROR_HOSTNAME:-archive.ubuntu.com}`` + +Instruct the system to use a different Ubuntu mirror base directory: + ``DEFAULT_MIRROR_DIR=${DEFAULT_MIRROR_DIR:-/ubuntu}`` Re-kicking VM(s) ---------------- diff --git a/multi-node-aio/build.sh b/multi-node-aio/build.sh index 76624f8d..af0ada3c 100755 --- a/multi-node-aio/build.sh +++ b/multi-node-aio/build.sh @@ -41,5 +41,7 @@ ansible-playbook -vv \ -e configure_openstack=${CONFIGURE_OPENSTACK:-"true"} \ -e config_prerouting=${CONFIG_PREROUTING:-"false"} \ -e default_ubuntu_kernel=${DEFAULT_KERNEL:-"linux-image-generic"} \ + -e default_ubuntu_mirror_hostname=${DEFAULT_MIRROR_HOSTNAME:-"archive.ubuntu.com"} \ + -e default_ubuntu_mirror_directory=${DEFAULT_MIRROR_DIR:-"/ubuntu"} \ --force-handlers \ playbooks/site.yml diff --git a/multi-node-aio/playbooks/pxe/debian/compute.preseed.j2 b/multi-node-aio/playbooks/pxe/debian/compute.preseed.j2 index 6d8314f4..a43b58c8 100644 --- a/multi-node-aio/playbooks/pxe/debian/compute.preseed.j2 +++ b/multi-node-aio/playbooks/pxe/debian/compute.preseed.j2 @@ -61,9 +61,9 @@ d-i keyboard-configuration/layoutcode string us # Mirror d-i mirror/country string manual -d-i mirror/http/proxy string -d-i mirror/http/hostname string archive.ubuntu.com -d-i mirror/http/directory string /ubuntu +d-i mirror/http/proxy string {{ default_ubuntu_mirror_proxy }} +d-i mirror/http/hostname string {{ default_ubuntu_mirror_hostname }} +d-i mirror/http/directory string {{ default_ubuntu_mirror_directory }} # Clock and Time Zone diff --git a/multi-node-aio/playbooks/pxe/debian/infra.preseed.j2 b/multi-node-aio/playbooks/pxe/debian/infra.preseed.j2 index a509c917..03bb8641 100644 --- a/multi-node-aio/playbooks/pxe/debian/infra.preseed.j2 +++ b/multi-node-aio/playbooks/pxe/debian/infra.preseed.j2 @@ -61,9 +61,9 @@ d-i keyboard-configuration/layoutcode string us # Mirror d-i mirror/country string manual -d-i mirror/http/proxy string -d-i mirror/http/hostname string archive.ubuntu.com -d-i mirror/http/directory string /ubuntu +d-i mirror/http/proxy string {{ default_ubuntu_mirror_proxy }} +d-i mirror/http/hostname string {{ default_ubuntu_mirror_hostname }} +d-i mirror/http/directory string {{ default_ubuntu_mirror_directory }} # Clock and Time Zone diff --git a/multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 b/multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 index 3a08eb1f..33b97ab1 100644 --- a/multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 +++ b/multi-node-aio/playbooks/pxe/debian/mnaio.preseed.j2 @@ -61,9 +61,9 @@ d-i keyboard-configuration/layoutcode string us # Mirror d-i mirror/country string manual -d-i mirror/http/proxy string -d-i mirror/http/hostname string archive.ubuntu.com -d-i mirror/http/directory string /ubuntu +d-i mirror/http/proxy string {{ default_ubuntu_mirror_proxy }} +d-i mirror/http/hostname string {{ default_ubuntu_mirror_hostname }} +d-i mirror/http/directory string {{ default_ubuntu_mirror_directory }} # Clock and Time Zone