From: Michael Jeanson Date: Tue, 23 Apr 2019 21:47:50 +0000 (-0400) Subject: ansible: Add compilers to amd64 nodes X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=687bfe6f33e8a7c35d7713d555871237e84d533b;p=lttng-ci.git ansible: Add compilers to amd64 nodes Signed-off-by: Michael Jeanson --- diff --git a/automation/ansible/node-all.yml b/automation/ansible/node-all.yml index 8b5638b..d511eff 100644 --- a/automation/ansible/node-all.yml +++ b/automation/ansible/node-all.yml @@ -2,6 +2,7 @@ roles: - common - cross-compilers + - compilers - babeltrace - liburcu - lttng-ust diff --git a/automation/ansible/node-amd64.yml b/automation/ansible/node-amd64.yml index c5b6788..509570d 100644 --- a/automation/ansible/node-amd64.yml +++ b/automation/ansible/node-amd64.yml @@ -2,6 +2,7 @@ roles: - common - cross-compilers + - compilers - babeltrace - liburcu - lttng-ust diff --git a/automation/ansible/roles/compilers/tasks/main.yml b/automation/ansible/roles/compilers/tasks/main.yml new file mode 100644 index 0000000..4595c12 --- /dev/null +++ b/automation/ansible/roles/compilers/tasks/main.yml @@ -0,0 +1,19 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ ansible_os_family }}.yml" + +- name: Define compilers_packages. + set_fact: + compilers_packages: "{{ __compilers_packages | list }}" + when: compilers_packages is not defined + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family == 'RedHat' + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' + +- include: setup-Alpine.yml + when: ansible_os_family == 'Alpine' diff --git a/automation/ansible/roles/compilers/tasks/setup-Alpine.yml b/automation/ansible/roles/compilers/tasks/setup-Alpine.yml new file mode 100644 index 0000000..387a52c --- /dev/null +++ b/automation/ansible/roles/compilers/tasks/setup-Alpine.yml @@ -0,0 +1,7 @@ +--- +- name: Update apk cache. + apk: update_cache=yes + +- name: Ensure compilers packages are installed. + apk: "name={{ item }} state=present" + with_items: "{{ compilers_packages }}" diff --git a/automation/ansible/roles/compilers/tasks/setup-Debian.yml b/automation/ansible/roles/compilers/tasks/setup-Debian.yml new file mode 100644 index 0000000..5d150a1 --- /dev/null +++ b/automation/ansible/roles/compilers/tasks/setup-Debian.yml @@ -0,0 +1,7 @@ +--- +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure compilers packages are installed. + apt: "name={{ item }} state=present" + with_items: "{{ compilers_packages }}" diff --git a/automation/ansible/roles/compilers/tasks/setup-RedHat.yml b/automation/ansible/roles/compilers/tasks/setup-RedHat.yml new file mode 100644 index 0000000..c45a5cc --- /dev/null +++ b/automation/ansible/roles/compilers/tasks/setup-RedHat.yml @@ -0,0 +1,6 @@ +--- +- name: Ensure compilers packages are installed. + yum: + name: "{{ item }}" + state: installed + with_items: "{{ compilers_packages }}" diff --git a/automation/ansible/roles/compilers/vars/Alpine.yml b/automation/ansible/roles/compilers/vars/Alpine.yml new file mode 100644 index 0000000..c06b535 --- /dev/null +++ b/automation/ansible/roles/compilers/vars/Alpine.yml @@ -0,0 +1,3 @@ +--- +# TODO +__compilers_packages: [] diff --git a/automation/ansible/roles/compilers/vars/Debian.yml b/automation/ansible/roles/compilers/vars/Debian.yml new file mode 100644 index 0000000..e9168eb --- /dev/null +++ b/automation/ansible/roles/compilers/vars/Debian.yml @@ -0,0 +1,17 @@ +--- +__compilers_packages: + - gcc-4.8 + - gcc-5 + - gcc-6 + - gcc-7 + - gcc-8 + - g++-4.8 + - g++-5 + - g++-6 + - g++-7 + - g++-8 + - clang-3.9 + - clang-4.0 + - clang-5.0 + - clang-6.0 + - clang-7 diff --git a/automation/ansible/roles/compilers/vars/RedHat.yml b/automation/ansible/roles/compilers/vars/RedHat.yml new file mode 100644 index 0000000..bf746e2 --- /dev/null +++ b/automation/ansible/roles/compilers/vars/RedHat.yml @@ -0,0 +1,3 @@ +--- +# TODO +__compilers_packages: diff --git a/automation/ansible/roles/compilers/vars/Suse.yml b/automation/ansible/roles/compilers/vars/Suse.yml new file mode 100644 index 0000000..c06b535 --- /dev/null +++ b/automation/ansible/roles/compilers/vars/Suse.yml @@ -0,0 +1,3 @@ +--- +# TODO +__compilers_packages: []