From a1ea2cc753856bed0ae760ae3d02392c8c2b1d92 Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Fri, 31 Aug 2018 09:11:29 +0100 Subject: [PATCH] Add monasca to image regex list Without this monasca images are not built unless explicitly requested. Monasca images only support the kolla source type, not binary. Also fixes image builds if the list of regular expressions for an image build set is empty, kolla will build all images. In our case we actually want to build none, since it means that no services are enabled for that image set. The main example of where this could happen is when monasca is disabled, the list of source-only images will be empty. Change-Id: I395e73a06b690d4b443af7c5eb8827514f56d03d TrivialFix --- ansible/container-image-build.yml | 1 + ansible/group_vars/all/kolla | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/ansible/container-image-build.yml b/ansible/container-image-build.yml index 3eac3d55e..664a0a65d 100644 --- a/ansible/container-image-build.yml +++ b/ansible/container-image-build.yml @@ -53,3 +53,4 @@ {% if push_images | bool %}--push{% endif %} \ {{ item.regexes }} 2>&1 | tee --append {{ kolla_build_log_path }} with_items: "{{ container_image_sets }}" + when: item.regexes != '' diff --git a/ansible/group_vars/all/kolla b/ansible/group_vars/all/kolla index 4a282fb61..e23ad1338 100644 --- a/ansible/group_vars/all/kolla +++ b/ansible/group_vars/all/kolla @@ -204,10 +204,24 @@ overcloud_container_image_regex_map: # overcloud hosts. overcloud_container_image_regexes: "{{ overcloud_container_image_regex_map | selectattr('enabled') | map(attribute='regex') | list }}" +# List of regular expressions matching names of container images to build for +# overcloud hosts. These images only support source builds. +overcloud_container_image_regex_map_source: + - regex: monasca + enabled: "{{ kolla_enable_monasca | bool }}" + +# List of regular expressions matching names of container images to build for +# overcloud hosts. These images onlt support source builds. +overcloud_container_image_regexes_source: "{{ overcloud_container_image_regex_map_source | selectattr('enabled') | map(attribute='regex') | list }}" + # List of container image sets for overcloud hosts. This is used when building # container images to determine which images to build. overcloud_container_image_sets: + # Default image type. - regexes: "{{ overcloud_container_image_regexes | join(' ') }}" + # Source-only images. + - regexes: "{{ overcloud_container_image_regexes_source | join(' ') }}" + type: source # Dict mapping Jinja2 block names in kolla's Docker images to their contents. kolla_build_blocks: {}