ansible: add minimal i386 runtime libs on amd64
authorMichael Jeanson <mjeanson@efficios.com>
Tue, 1 Feb 2022 19:03:15 +0000 (14:03 -0500)
committerMichael Jeanson <mjeanson@efficios.com>
Tue, 1 Feb 2022 20:14:33 +0000 (15:14 -0500)
Change-Id: If219b7dba8c7a0abde8f302a3bef90057c3501c0
Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
automation/ansible/node_amd64.yml
automation/ansible/roles/libs-i386/tasks/main.yml [new file with mode: 0644]
automation/ansible/roles/libs-i386/tasks/setup-Debian.yml [new file with mode: 0644]
automation/ansible/roles/libs-i386/vars/Debian.yml [new file with mode: 0644]

index f7ec70b34115ffae112bc72baab06de275edba2c..6ceb1b3ecf27c4ce26792362eca107ef09c21e95 100644 (file)
@@ -10,3 +10,4 @@
     - lttng-tools
     - lttng-modules
     - lttng-analyses
+    - libs-i386
diff --git a/automation/ansible/roles/libs-i386/tasks/main.yml b/automation/ansible/roles/libs-i386/tasks/main.yml
new file mode 100644 (file)
index 0000000..1853b68
--- /dev/null
@@ -0,0 +1,13 @@
+---
+# Include variables and define needed variables.
+- name: Include OS-specific variables.
+  include_vars: "{{ ansible_os_family }}.yml"
+
+- name: Define libs_i386_packages.
+  set_fact:
+    libs_i386_packages: "{{ __libs_i386_packages | list }}"
+  when: libs_i386_packages is not defined
+
+# Setup/install tasks.
+- include: setup-Debian.yml
+  when: ansible_os_family == 'Debian'
diff --git a/automation/ansible/roles/libs-i386/tasks/setup-Debian.yml b/automation/ansible/roles/libs-i386/tasks/setup-Debian.yml
new file mode 100644 (file)
index 0000000..e36836c
--- /dev/null
@@ -0,0 +1,17 @@
+---
+- name: Check if i386 foreign architecture is enabled in dpkg.
+  shell: dpkg --print-foreign-architectures | grep i386
+  register: dpkg_i386_is_enabled
+  changed_when: dpkg_i386_is_enabled.rc == 1
+  failed_when: dpkg_i386_is_enabled.rc > 1
+
+- name: Add i386 foreign architecture to dpkg.
+  command: dpkg --add-architecture i386
+  when: dpkg_i386_is_enabled.rc == 1
+
+- name: Update apt cache.
+  apt: update_cache=yes
+  when: dpkg_i386_is_enabled.rc == 1
+
+- name: Ensure libs-i386 packages are installed.
+  apt: "name={{ libs_i386_packages }} state=present"
diff --git a/automation/ansible/roles/libs-i386/vars/Debian.yml b/automation/ansible/roles/libs-i386/vars/Debian.yml
new file mode 100644 (file)
index 0000000..05d6e8c
--- /dev/null
@@ -0,0 +1,7 @@
+---
+__libs_i386_packages:
+  - liblzma5:i386
+  - libnuma1:i386
+  - libpopt0:i386
+  - libxml2:i386
+  - zlib1g:i386
This page took 0.024181 seconds and 4 git commands to generate.