From: Michael Jeanson Date: Fri, 23 Feb 2024 19:50:00 +0000 (-0500) Subject: ansible: add librseq role X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=3e9e23551484711e5a9916a9bb82d500b8e0764f;p=lttng-ci.git ansible: add librseq role Add the role to install a new optional build dependency 'libseccomp-dev'. Change-Id: I470cdc1478109dd85f0b4f354e6d7fe27e0bd1ec Signed-off-by: Michael Jeanson --- diff --git a/automation/ansible/lava-all.yml b/automation/ansible/lava-all.yml index eef6248..874e615 100644 --- a/automation/ansible/lava-all.yml +++ b/automation/ansible/lava-all.yml @@ -2,6 +2,7 @@ roles: - common - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_all.yml b/automation/ansible/node_all.yml index 836971c..a4a6dea 100644 --- a/automation/ansible/node_all.yml +++ b/automation/ansible/node_all.yml @@ -5,6 +5,7 @@ - cross-compilers - compilers - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_amd64.yml b/automation/ansible/node_amd64.yml index 2e7cc1a..cc394e5 100644 --- a/automation/ansible/node_amd64.yml +++ b/automation/ansible/node_amd64.yml @@ -6,6 +6,7 @@ - compilers - babeltrace - binutils-gdb + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_arm64.yml b/automation/ansible/node_arm64.yml index fd39716..8b56160 100644 --- a/automation/ansible/node_arm64.yml +++ b/automation/ansible/node_arm64.yml @@ -3,6 +3,7 @@ - common - common-node - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_armhf.yml b/automation/ansible/node_armhf.yml index 2ae2ca4..e3c6ad3 100644 --- a/automation/ansible/node_armhf.yml +++ b/automation/ansible/node_armhf.yml @@ -3,6 +3,7 @@ - common - common-node - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_el.yml b/automation/ansible/node_el.yml index 96b5f04..06f8f7b 100644 --- a/automation/ansible/node_el.yml +++ b/automation/ansible/node_el.yml @@ -3,6 +3,7 @@ - common - common-node - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_i386.yml b/automation/ansible/node_i386.yml index 1c68a05..3504a0a 100644 --- a/automation/ansible/node_i386.yml +++ b/automation/ansible/node_i386.yml @@ -3,6 +3,7 @@ - common - common-node - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_ppc64el.yml b/automation/ansible/node_ppc64el.yml index 62dc4d5..8a106e5 100644 --- a/automation/ansible/node_ppc64el.yml +++ b/automation/ansible/node_ppc64el.yml @@ -3,6 +3,7 @@ - common - common-node - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_riscv64.yml b/automation/ansible/node_riscv64.yml index 200fff7..a7c23f9 100644 --- a/automation/ansible/node_riscv64.yml +++ b/automation/ansible/node_riscv64.yml @@ -3,6 +3,7 @@ - common - common-node - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_sles.yml b/automation/ansible/node_sles.yml index 2c75e88..13d0e3e 100644 --- a/automation/ansible/node_sles.yml +++ b/automation/ansible/node_sles.yml @@ -4,6 +4,7 @@ - common-node - compilers - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/node_standalone.yml b/automation/ansible/node_standalone.yml index 017037c..c6af9b6 100644 --- a/automation/ansible/node_standalone.yml +++ b/automation/ansible/node_standalone.yml @@ -4,6 +4,7 @@ - common-node - cross-compilers - babeltrace + - librseq - liburcu - lttng-ust - lttng-tools diff --git a/automation/ansible/roles/librseq/tasks/main.yml b/automation/ansible/roles/librseq/tasks/main.yml new file mode 100644 index 0000000..cd37dff --- /dev/null +++ b/automation/ansible/roles/librseq/tasks/main.yml @@ -0,0 +1,21 @@ +--- +# Include variables and define needed variables. +- name: Include OS-specific variables. + include_vars: "{{ item }}" + with_first_found: + - "{{ ansible_distribution }}-{{ ansible_distribution_major_version }}.yml" + - "{{ ansible_distribution }}.yml" + - "{{ ansible_os_family }}.yml" + +# Setup/install tasks. +- include: setup-RedHat.yml + when: ansible_os_family in ['RedHat', 'Rocky'] + +- include: setup-Debian.yml + when: ansible_os_family == 'Debian' + +- include: setup-Alpine.yml + when: ansible_os_family == 'Alpine' + +- include: setup-Suse.yml + when: ansible_os_family == 'Suse' diff --git a/automation/ansible/roles/librseq/tasks/setup-Alpine.yml b/automation/ansible/roles/librseq/tasks/setup-Alpine.yml new file mode 100644 index 0000000..5a56175 --- /dev/null +++ b/automation/ansible/roles/librseq/tasks/setup-Alpine.yml @@ -0,0 +1,6 @@ +--- +- name: Update apk cache. + apk: update_cache=yes + +- name: Ensure librseq build dependencies are installed. + apk: "name={{ librseq_packages }} state=present" diff --git a/automation/ansible/roles/librseq/tasks/setup-Debian.yml b/automation/ansible/roles/librseq/tasks/setup-Debian.yml new file mode 100644 index 0000000..427b39e --- /dev/null +++ b/automation/ansible/roles/librseq/tasks/setup-Debian.yml @@ -0,0 +1,6 @@ +--- +- name: Update apt cache. + apt: update_cache=yes cache_valid_time=86400 + +- name: Ensure librseq build dependencies are installed. + apt: "name={{ librseq_packages }} state=present" diff --git a/automation/ansible/roles/librseq/tasks/setup-RedHat.yml b/automation/ansible/roles/librseq/tasks/setup-RedHat.yml new file mode 100644 index 0000000..373fb5f --- /dev/null +++ b/automation/ansible/roles/librseq/tasks/setup-RedHat.yml @@ -0,0 +1,5 @@ +--- +- name: Ensure librseq build dependencies are installed. + dnf: + name: "{{ librseq_packages }}" + state: installed diff --git a/automation/ansible/roles/librseq/tasks/setup-Suse.yml b/automation/ansible/roles/librseq/tasks/setup-Suse.yml new file mode 100644 index 0000000..770b578 --- /dev/null +++ b/automation/ansible/roles/librseq/tasks/setup-Suse.yml @@ -0,0 +1,3 @@ +--- +- name: Ensure librseq build dependencies are installed. + zypper: "name={{ librseq_packages }} state=installed update_cache=yes" diff --git a/automation/ansible/roles/librseq/vars/Alpine.yml b/automation/ansible/roles/librseq/vars/Alpine.yml new file mode 100644 index 0000000..4e01b74 --- /dev/null +++ b/automation/ansible/roles/librseq/vars/Alpine.yml @@ -0,0 +1,2 @@ +--- +librseq_packages: [] diff --git a/automation/ansible/roles/librseq/vars/Debian.yml b/automation/ansible/roles/librseq/vars/Debian.yml new file mode 100644 index 0000000..16ee740 --- /dev/null +++ b/automation/ansible/roles/librseq/vars/Debian.yml @@ -0,0 +1,3 @@ +--- +librseq_packages: + - libseccomp-dev diff --git a/automation/ansible/roles/librseq/vars/RedHat.yml b/automation/ansible/roles/librseq/vars/RedHat.yml new file mode 100644 index 0000000..0cd8008 --- /dev/null +++ b/automation/ansible/roles/librseq/vars/RedHat.yml @@ -0,0 +1,3 @@ +--- +librseq_packages: + - libseccomp-devel diff --git a/automation/ansible/roles/librseq/vars/Rocky.yml b/automation/ansible/roles/librseq/vars/Rocky.yml new file mode 120000 index 0000000..f802000 --- /dev/null +++ b/automation/ansible/roles/librseq/vars/Rocky.yml @@ -0,0 +1 @@ +RedHat.yml \ No newline at end of file diff --git a/automation/ansible/roles/librseq/vars/Suse.yml b/automation/ansible/roles/librseq/vars/Suse.yml new file mode 100644 index 0000000..0cd8008 --- /dev/null +++ b/automation/ansible/roles/librseq/vars/Suse.yml @@ -0,0 +1,3 @@ +--- +librseq_packages: + - libseccomp-devel diff --git a/automation/ansible/site.yml b/automation/ansible/site.yml index b113e9a..0647675 100644 --- a/automation/ansible/site.yml +++ b/automation/ansible/site.yml @@ -22,6 +22,7 @@ - compilers - babeltrace - binutils-gdb + - librseq - liburcu - lttng-ust - lttng-tools