From 7ebad0a8164345ebf6b93b028ae7ef3b56ecabf4 Mon Sep 17 00:00:00 2001 From: Michal Jagiello Date: Wed, 2 Nov 2022 07:24:28 +0000 Subject: Release oom-automatic-installation Issue-ID: INT-2150 Signed-off-by: Michal Jagiello Change-Id: I8992f93e2b79f17c90d8f3c350891e8428ef3dcb --- roles/prepare_ci/tasks/main.yaml | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 roles/prepare_ci/tasks/main.yaml (limited to 'roles/prepare_ci/tasks/main.yaml') diff --git a/roles/prepare_ci/tasks/main.yaml b/roles/prepare_ci/tasks/main.yaml new file mode 100644 index 0000000..a008fd1 --- /dev/null +++ b/roles/prepare_ci/tasks/main.yaml @@ -0,0 +1,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 -- cgit 1.2.3-korg