aboutsummaryrefslogtreecommitdiff
path: root/roles/kolla-build-deps/tasks/main.yml
blob: 261368967f26aa3ab97856ca3512f08496590c5d (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
---
- name: Create dir for kolla logs
  ansible.builtin.file:
    path: "{{ kolla_logs_dir }}"
    state: directory
    mode: "0755"
    owner: zuul
    group: zuul

- name: Create dir for kolla build logs
  ansible.builtin.file:
    path: "{{ kolla_build_logs_dir }}"
    state: directory
    mode: "0755"
    owner: zuul
    group: zuul

- name: Install Python3 pip and setuptools
  ansible.builtin.package:
    name:
      - python3-pip
      - python3-setuptools
  become: true

# NOTE(hrw): On RedHat systems venv is part of python3-libs
- name: Install Python3 venv on Debian systems
  ansible.builtin.package:
    name:
      - python3-venv
  become: true
  when: ansible_facts.os_family == "Debian"

- name: Install kolla in a venv
  ansible.builtin.pip:
    name:
      - "pip"
      - "."
    state: latest
    virtualenv: "{{ virtualenv_path }}"
    virtualenv_command: "python3.{{ ansible_facts.python.version.minor }} -m venv"
    chdir: "{{ zuul.project.src_dir }}"

- name: Configure container engine
  ansible.builtin.include_role:
    name: "openstack.kolla.{{ container_engine }}"

- name: Install podman/docker_sdk in a venv
  vars:
    virtualenv: "{{ virtualenv_path }}"
    docker_sdk_virtualenv_owner: "{{ lookup('env', 'USER') }}"
  ansible.builtin.include_role:
    name: "openstack.kolla.{{ container_engine }}_sdk"

- name: Ensure container engine socket is world-writable
  ansible.builtin.file:
    path: "{{ '/run/docker.sock' if container_engine == 'docker' else '/run/podman/podman.sock' }}"
    mode: "0666"
  become: true

- name: Run multiarch/qemu-user-static image to support cross-arch build
  ansible.builtin.command:
    cmd: "{{ container_engine }} run --rm --privileged multiarch/qemu-user-static --reset -p yes"
  become: true
  when: ansible_facts.architecture != (base_arch | default('x86_64'))