diff options
author | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2022-11-02 07:24:28 +0000 |
---|---|---|
committer | Michal Jagiello <michal.jagiello@t-mobile.pl> | 2022-12-05 10:52:49 +0000 |
commit | 7ebad0a8164345ebf6b93b028ae7ef3b56ecabf4 (patch) | |
tree | f285829dabb0fd9bfdece3472373bb9d7de9d3f4 /roles/prepare_ci | |
parent | a43be446c10a58f5a7aea91851b4c74b9ee3d3af (diff) |
Release oom-automatic-installation
Issue-ID: INT-2150
Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl>
Change-Id: I8992f93e2b79f17c90d8f3c350891e8428ef3dcb
Diffstat (limited to 'roles/prepare_ci')
-rw-r--r-- | roles/prepare_ci/defaults/main.yaml | 6 | ||||
-rw-r--r-- | roles/prepare_ci/tasks/install_DEBIAN.yaml | 11 | ||||
-rw-r--r-- | roles/prepare_ci/tasks/main.yaml | 57 | ||||
-rw-r--r-- | roles/prepare_ci/vars/debian.yaml | 18 |
4 files changed, 92 insertions, 0 deletions
diff --git a/roles/prepare_ci/defaults/main.yaml b/roles/prepare_ci/defaults/main.yaml new file mode 100644 index 0000000..34cfc01 --- /dev/null +++ b/roles/prepare_ci/defaults/main.yaml @@ -0,0 +1,6 @@ +--- +ci_packages: [] +ci_packages_to_be_removed: + - python3-yaml +ci_python3_packages: [] +proxy_env: {} diff --git a/roles/prepare_ci/tasks/install_DEBIAN.yaml b/roles/prepare_ci/tasks/install_DEBIAN.yaml new file mode 100644 index 0000000..9537976 --- /dev/null +++ b/roles/prepare_ci/tasks/install_DEBIAN.yaml @@ -0,0 +1,11 @@ +--- +- name: load os specific configuration + include_vars: "debian.yaml" + when: ansible_os_family | lower == "debian" + +- name: "[Debian] install needed packages" + include_role: + name: apt_install + vars: + environment: "{{ proxy_env }}" + packages: "{{ ci_packages }}" 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 diff --git a/roles/prepare_ci/vars/debian.yaml b/roles/prepare_ci/vars/debian.yaml new file mode 100644 index 0000000..5b9029c --- /dev/null +++ b/roles/prepare_ci/vars/debian.yaml @@ -0,0 +1,18 @@ +--- +ci_packages: + - jq + - build-essential + - libffi-dev + - git + - python3-pip + - rsync +ci_python3_packages: + - openshift==0.11.2 + - stevedore==1.32.0 + - dogpile.cache==0.6.5 + - openstacksdk==0.43.0 + - shade==1.33.0 + - os-client-config==2.0.0 + - python-openstackclient==5.2.1 + - python-heatclient==1.18.0 + - jsonschema |