d2e8ebe7f2
kolla-publish-centos8 jobs (non-stream8) have been failing on stable/victoria with the following error: 'base_tag' is undefined. This is because the base_tag variable is only defined for centos8s jobs in .zuul.d/centos.yaml. Fix by checking if base_tag is defined. Change-Id: Iad118c9885b2134a7d071a6629a2f3e3ae3d101e
59 lines
2.0 KiB
YAML
59 lines
2.0 KiB
YAML
---
|
|
- hosts: all
|
|
vars_files:
|
|
- ../vars/zuul.yml
|
|
vars:
|
|
arch_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}"
|
|
tag_suffix: "{{ '-centos8s' if ansible_distribution | lower == 'centos' and base_tag is defined and base_tag == 'stream8' else '' }}"
|
|
kolla_build_config:
|
|
DEFAULT:
|
|
debug: true
|
|
logs_dir: "{{ kolla_build_logs_dir }}"
|
|
base: "{{ base_distro }}"
|
|
install_type: "{{ install_type }}"
|
|
template_override: /etc/kolla/template_overrides.j2
|
|
# NOTE(yoctozepto): to avoid issues with IPv6 not enabled in the docker daemon
|
|
# and since we don't need isolated networks here, use host networking
|
|
network_mode: host
|
|
tasks:
|
|
- name: Ensure /etc/kolla exists
|
|
file:
|
|
path: /etc/kolla
|
|
state: directory
|
|
mode: 0777
|
|
become: true
|
|
|
|
- name: Add base_image and base_tag config
|
|
vars:
|
|
kolla_base_image_config:
|
|
DEFAULT:
|
|
base_image: "{{ base_image }}"
|
|
base_tag: "{{ base_tag }}"
|
|
set_fact:
|
|
kolla_build_config: "{{ kolla_build_config | combine(kolla_base_image_config, recursive=True) }}"
|
|
when:
|
|
- base_tag is defined
|
|
- base_image is defined
|
|
|
|
- name: Add publisher config
|
|
vars:
|
|
kolla_publisher_config:
|
|
DEFAULT:
|
|
namespace: "{{ kolla_namespace }}"
|
|
tag: "{{ (zuul.tag if zuul.pipeline == 'release' else zuul.branch | basename) ~ arch_suffix ~ tag_suffix }}"
|
|
set_fact:
|
|
kolla_build_config: "{{ kolla_build_config | combine(kolla_publisher_config, recursive=True) }}"
|
|
when:
|
|
- publisher
|
|
|
|
- import_role:
|
|
name: kolla-build-config
|
|
|
|
- name: Template template_overrides.j2
|
|
template:
|
|
src: "{{ zuul.executor.work_root }}/{{ zuul.project.src_dir }}/tests/templates/template_overrides.j2"
|
|
dest: /etc/kolla/template_overrides.j2
|
|
|
|
- name: Run kolla-build
|
|
command: "{{ virtualenv_path }}/bin/kolla-build"
|