diff options
Diffstat (limited to 'roles/steam/tasks')
| -rw-r--r-- | roles/steam/tasks/install-archlinux.yml | 6 | ||||
| -rw-r--r-- | roles/steam/tasks/install-ubuntu.yml | 23 | ||||
| -rw-r--r-- | roles/steam/tasks/main.yml | 7 |
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" |
