summaryrefslogtreecommitdiffstats
path: root/roles/steam/tasks
diff options
context:
space:
mode:
authorAhmed Abdelhalim <[email protected]>2026-02-19 14:33:05 +0100
committerAhmed Abdelhalim <[email protected]>2026-02-19 16:21:10 +0100
commit221ca9d12199dfe6ed73ce8724d31833a63675dd (patch)
tree809c28c6c2369eeb69a174ab7d87a18acfb08ca3 /roles/steam/tasks
parent664604376476fa686265b0e60069e8e127467183 (diff)
Refactor steam to install on ubuntu as well
Diffstat (limited to 'roles/steam/tasks')
-rw-r--r--roles/steam/tasks/install-archlinux.yml6
-rw-r--r--roles/steam/tasks/install-ubuntu.yml23
-rw-r--r--roles/steam/tasks/main.yml7
3 files changed, 31 insertions, 5 deletions
diff --git a/roles/steam/tasks/install-archlinux.yml b/roles/steam/tasks/install-archlinux.yml
new file mode 100644
index 00000000..e8f57c7c
--- /dev/null
+++ b/roles/steam/tasks/install-archlinux.yml
@@ -0,0 +1,6 @@
+---
+- name: "Ensure steam is installed"
+ become: true
+ ansible.builtin.package:
+ name: "{{ steam_pkg }}"
+ state: "present"
diff --git a/roles/steam/tasks/install-ubuntu.yml b/roles/steam/tasks/install-ubuntu.yml
new file mode 100644
index 00000000..cdc743e9
--- /dev/null
+++ b/roles/steam/tasks/install-ubuntu.yml
@@ -0,0 +1,23 @@
+---
+- name: "Check enabled architectures"
+ ansible.builtin.command: dpkg --print-foreign-architectures
+ changed_when: false
+ register: "steam_dpkg_architectures"
+
+- name: "Enable i386 architecture"
+ become: true
+ ansible.builtin.command: dpkg --add-architecture i386
+ changed_when: true
+ when: "'i386' not in steam_dpkg_architectures.stdout_lines"
+
+- name: "Update apt cache"
+ become: true
+ ansible.builtin.apt:
+ update_cache: true
+ when: "'i386' not in steam_dpkg_architectures.stdout_lines"
+
+- name: "Ensure steam is installed"
+ become: true
+ ansible.builtin.package:
+ name: "{{ steam_pkg }}"
+ state: "present"
diff --git a/roles/steam/tasks/main.yml b/roles/steam/tasks/main.yml
index fc2b1f67..d05c0b18 100644
--- a/roles/steam/tasks/main.yml
+++ b/roles/steam/tasks/main.yml
@@ -2,8 +2,5 @@
- name: "Include OS-specific variables"
ansible.builtin.include_vars: "{{ ansible_facts['os_family'] | lower }}.yml"
-- name: "Ensure steam is installed"
- become: true
- ansible.builtin.package:
- name: "{{ steam_pkg }}"
- state: "present"
+- name: "Include OS-specific tasks"
+ ansible.builtin.include_tasks: "install-{{ ansible_facts['distribution'] | lower }}.yml"