From ab4b015ceaefb189e89beb4422ce41fe6c3fc76d Mon Sep 17 00:00:00 2001 From: Sagi Shnaidman Date: Tue, 21 May 2019 14:22:47 +0300 Subject: [PATCH] Download and define base image if configured When we build the image we need a base image to be defined. For CentOS it's done automatically in client, but if we need to build something else we need to download it and define it explicitly. base_image_url - URL of base image base_image_path - path to save it on host Change-Id: I10bd9868fcfd3a4d5992fc7d7b6200e908e75e25 --- roles/build-images/README.md | 2 ++ roles/build-images/templates/overcloud-image-build.sh.j2 | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/roles/build-images/README.md b/roles/build-images/README.md index 41ef8c7c3..4d3c4107b 100644 --- a/roles/build-images/README.md +++ b/roles/build-images/README.md @@ -50,6 +50,8 @@ Role Variables * `skip_build_images` -- skip building images if there present or cached (default: true), setting it to false will add '--no-skip' option to openstack image build command. +* `base_image_url` -- URL of base image +* `base_image_path` -- path to save base image on host Example Usage ------------- diff --git a/roles/build-images/templates/overcloud-image-build.sh.j2 b/roles/build-images/templates/overcloud-image-build.sh.j2 index 768f92789..f1cf3d351 100644 --- a/roles/build-images/templates/overcloud-image-build.sh.j2 +++ b/roles/build-images/templates/overcloud-image-build.sh.j2 @@ -25,7 +25,10 @@ export DIB_YUM_REPO_CONF="" {% for repo_path in overcloud_repo_paths %} export DIB_YUM_REPO_CONF="$DIB_YUM_REPO_CONF {{ repo_path }}" {% endfor %} - +{% if base_image_url is defined and base_image_path is defined %} +wget -nv {{ base_image_url }} -O {{ base_image_path }} +export DIB_LOCAL_IMAGE={{ base_image_path }} +{% endif %} {# note(trown): there was not support in tripleoclient for YAML config images in Newton #} {% if release == 'newton'-%} tripleo-build-images \