blob: 47cfba4668e075c115acdf349d01690226bfeaf5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
---
- name: Zuul run
hosts: all
vars_files:
- ../vars/zuul.yml
vars:
tag_suffix: "{{ '-aarch64' if base_arch == 'aarch64' else '' }}"
kolla_build_config:
DEFAULT:
debug: true
logs_dir: "{{ kolla_build_logs_dir }}"
quiet: true
base: "{{ base_distro }}"
base_arch: "{{ base_arch }}"
engine: "{{ container_engine }}"
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
ansible.builtin.file:
path: /etc/kolla
state: directory
mode: "0777"
become: true
- name: Use ubuntu/debian base image from mirror
vars:
kolla_mirror_config:
DEFAULT:
base_image: "quay.io/opendevmirror/{{ base_distro }}"
ansible.builtin.set_fact:
kolla_build_config: "{{ kolla_build_config | combine(kolla_mirror_config, recursive=True) }}"
when: base_distro in ['debian', 'ubuntu']
- name: Add publisher config
vars:
kolla_publisher_config:
DEFAULT:
namespace: "{{ kolla_namespace }}"
tag: "{{ zuul.branch | basename }}-{{ base_distro }}-{{ base_distro_version }}{{ tag_suffix }}"
ansible.builtin.set_fact:
kolla_build_config: "{{ kolla_build_config | combine(kolla_publisher_config, recursive=True) }}"
when:
- publisher
- name: Add external docker dir config
vars:
kolla_build_external_docker_config:
DEFAULT:
docker_dir: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tests/templates/docker"
releaser:
type: git
reference: master
location: "https://opendev.org/openstack/releases.git"
releaser-user:
uid: 56000
gid: 56000
ansible.builtin.set_fact:
kolla_build_config: "{{ kolla_build_config | combine(kolla_build_external_docker_config, recursive=True) }}"
when:
- not publisher
- name: Set pip mirror config
vars:
kolla_pip_mirror_config:
DEFAULT:
pip_index_url: "{{ nodepool_pypi_mirror }}"
pip_trusted_host: "{{ nodepool_mirror_host }}"
ansible.builtin.set_fact:
kolla_build_config: "{{ kolla_build_config | combine(kolla_pip_mirror_config, recursive=True) }}"
- name: Set up base repo overrides
vars:
kolla_repos_yaml_config:
DEFAULT:
repos_yaml: /etc/kolla/repos.yaml
ansible.builtin.set_fact:
kolla_build_config: "{{ kolla_build_config | combine(kolla_repos_yaml_config, recursive=True) }}"
kolla_build_repos_yaml_path: "{{ zuul.executor.work_root }}/{{ zuul.projects['opendev.org/openstack/kolla'].src_dir }}/tests/templates/repos.yaml.j2"
when: base_distro in ['debian', 'rocky', 'ubuntu']
- name: Import kolla-build-config role
import_role:
name: kolla-build-config
- name: Import kolla-build role
import_role:
name: kolla-build
|