--- /dev/null
+---
+# 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'
--- /dev/null
+---
+- 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"