Move keyring to share while also modifying playbook to only do Debian steps when PPA does not already exist.

This commit is contained in:
Hyperling 2025-03-07 08:46:53 -07:00
parent 048d4d16c1
commit a447389af2

View File

@ -2,7 +2,21 @@
# Lutris for running Windows games not in Steam. # Lutris for running Windows games not in Steam.
# https://lutris.net/downloads # https://lutris.net/downloads
## Facts ## # Paths
- name: Workstation | Linux | Software | Lutris | Facts
set_fact:
lutris_source_list: "/etc/apt/sources.list.d/lutris.list"
lutris_keyfile: "/usr/share/keyrings/lutris.gpg"
when: ansible_pkg_mgr == "apt"
# Checks
- name: Workstation | Linux | Software | Lutris | Check PPA
stat:
path: "{{ lutris_source_list }}"
register: lutris_source_exists
when: ansible_pkg_mgr == "apt"
## Install Repo ## ## Install Repo ##
@ -17,11 +31,13 @@
- name: Workstation | Linux | Software | Lutris | Add PPA (Debian) - name: Workstation | Linux | Software | Lutris | Add PPA (Debian)
shell: "{{ item }}" shell: "{{ item }}"
loop: loop:
- echo "deb [signed-by=/etc/apt/keyrings/lutris.gpg] https://download.opensuse.org/repositories/home:/strycore/Debian_12/ ./" | sudo tee /etc/apt/sources.list.d/lutris.list > /dev/null - "wget -q -O- https://download.opensuse.org/repositories/home:/strycore/Debian_12/Release.key \
- wget -q -O- https://download.opensuse.org/repositories/home:/strycore/Debian_12/Release.key | gpg --dearmor | sudo tee /etc/apt/keyrings/lutris.gpg > /dev/null | gpg --dearmor \
- sudo apt update | sudo tee {{ lutris_keyfile }} > /dev/null"
when: ansible_distribution in ("Debian") and gaming == true - "echo 'deb [signed-by={{ lutris_keyfile }}] https://download.opensuse.org/repositories/home:/strycore/Debian_12/ ./' \
ignore_errors: yes | sudo tee {{ lutris_source_list }} > /dev/null"
- "sudo apt update"
when: ansible_distribution in ("Debian") and gaming == true and not lutris_source_exists.stat.exists
## Install Package ## ## Install Package ##
@ -31,7 +47,6 @@
- lutris - lutris
state: present state: present
when: ansible_architecture != "aarch64" and gaming == true when: ansible_architecture != "aarch64" and gaming == true
ignore_errors: yes
## Uninstall Package ## ## Uninstall Package ##
@ -40,8 +55,7 @@
name: name:
- lutris - lutris
state: absent state: absent
when: ansible_architecture != "aarch64" and gaming is not defined when: ansible_architecture != "aarch64" and gaming != true
ignore_errors: yes
## Uninstall Repo ## ## Uninstall Repo ##
@ -50,14 +64,13 @@
repo: ppa:lutris-team/lutris repo: ppa:lutris-team/lutris
update_cache: yes update_cache: yes
state: absent state: absent
when: ansible_distribution in ("Ubuntu") and gaming is not defined when: ansible_distribution in ("Ubuntu") and gaming != true
ignore_errors: yes ignore_errors: yes
- name: Workstation | Linux | Software | Lutris | Remove PPA (Debian) - name: Workstation | Linux | Software | Lutris | Remove PPA (Debian)
shell: "{{ item }}" shell: "{{ item }}"
loop: loop:
- mv /etc/apt/sources.list.d/lutris.list* ~/TRASH/ - "mv {{ lutris_source_list }} ~/TRASH/"
- mv /etc/apt/keyrings/lutris.gpg ~/TRASH/ - "mv {{ lutris_keyfile }} ~/TRASH/"
- sudo apt update - "sudo apt update"
when: ansible_distribution in ("Debian") and gaming is not defined when: ansible_distribution in ("Debian") and gaming != true and lutris_source_exists.stat.exists
ignore_errors: yes