aboutsummaryrefslogtreecommitdiffstats
path: root/roles/prepare_ci/tasks/main.yaml
blob: a008fd167f1e4d3309f5706723c0b4c61ba29024 (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
---
- name: load os specific configuration
  include_vars: "{{ ansible_os_family | lower }}.yaml"
  when: ansible_os_family | lower == "debian"

- name: "[Debian] install needed packages"
  include_role:
    name: apt_install
  vars:
    environment: "{{ proxy_env }}"
    packages: "{{ ci_packages }}"
  when: ansible_os_family | lower == "debian"

- name: "[Non Debian] install needed packages"
  ansible.builtin.package:
    name: "{{ item }}"
    state: present
  loop: "{{ ci_packages }}"
  when: ansible_os_family | lower != "debian"

# Workaround
# Conflict between the python3-yaml installed with the package manager
# preventing the one from pip
# Observed on daily/weekly on the 26th of June
# ERROR: Cannot uninstall 'PyYAML'. It is a distutils installed project and
# thus we cannot accurately determine which files belong to it which would lead
# to only a partial uninstall.
# As a workaround, we force the uninstallation of the python3-yaml package
# before starting the installation
- name: "[Debian] remove unexpected packages"
  ansible.builtin.apt:
    name: "{{ item }}"
    state: absent
  loop: "{{ ci_packages_to_be_removed }}"
  when: ansible_os_family | lower == "debian"

- name: "[Non Debian] remove unexpected packages"
  ansible.builtin.package:
    name: "{{ item }}"
    state: absent
  loop: "{{ ci_packages_to_be_removed }}"
  when: ansible_os_family | lower != "debian"
# End of Workaround

- name: "[Python 3] install needed python packages"
  pip:
    name: "{{ item }}"
    state: present
  loop: "{{ ci_python3_packages }}"
  when: ansible_python_version is version('3', '>=')


- name: allow oom_path parent directory to be usable by user
  ansible.builtin.file:
    path: "{{ oom_path.split('/')[0:-1] | join('/') }}"
    state: directory
    mode: 0777