aboutsummaryrefslogtreecommitdiff
path: root/roles/kolla-build-deps/tasks/main.yml
blob: ebb5f00fa9b6008ce14e6468ab366df9078e22b2 (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: Dump host info to logs
  ansible.builtin.command: "{{ ansible_user_dir }}/{{ zuul.project.src_dir }}/tools/dump_info.sh"
  args:
    chdir: "{{ kolla_logs_dir }}"
  changed_when: true

- 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: "{{ 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: "{{ 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