aboutsummaryrefslogtreecommitdiff
path: root/tests/playbooks/run.yml
blob: ad3c80075d8ee8f7135f5d5edaa3342bc7ac184f (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
---
- 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: Import kolla-build-config role
      import_role:
        name: kolla-build-config

    - name: Import kolla-build role
      import_role:
        name: kolla-build