summaryrefslogtreecommitdiff
path: root/tests/playbooks/run.yml
blob: 7e0b4869562888c7787241921240a5e61c365f85 (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
---
- hosts: all
  vars_files:
    - ../vars/zuul.yml
  vars:
    tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}"
    kolla_build_config:
      DEFAULT:
        debug: true
        logs_dir: "{{ kolla_build_logs_dir }}"
        quiet: true
        base: "{{ base_distro }}"
        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 publisher config
      vars:
        kolla_publisher_config:
          DEFAULT:
            namespace: "{{ kolla_namespace }}"
            tag: "{{ zuul.branch | basename }}-{{ base_distro }}-{{ base_distro_version }}{{ 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 to template out dockerfiles
      command: "{{ virtualenv_path }}/bin/kolla-build --template-only --work-dir {{ kolla_build_logs_dir }}/work_dir"

    - name: Run kolla-build
      command: "{{ virtualenv_path }}/bin/kolla-build"