aboutsummaryrefslogtreecommitdiffstats
path: root/roles/prepare_ci
diff options
context:
space:
mode:
Diffstat (limited to 'roles/prepare_ci')
-rw-r--r--roles/prepare_ci/defaults/main.yaml6
-rw-r--r--roles/prepare_ci/tasks/install_DEBIAN.yaml11
-rw-r--r--roles/prepare_ci/tasks/main.yaml57
-rw-r--r--roles/prepare_ci/vars/debian.yaml18
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