Thomas Stallinger 770c3a6c95 feat: echte Rolleninhalte für guest-session/brave-fedora/onlyoffice-fedora
Ersetzt die reinen Marker-Datei-Platzhalter durch echte Anforderungen des
Schulcomputer-Workspace:

- guest-session: flüchtige Gastsitzung über lokalen gast-User +
  pam_namespace-tmpfs-Polyinstantiation, nopasswdlogin-Login. PAM-Layout
  wird über ansible_facts os_family erkannt (RedHat vs. Debian), da der
  Rollenname für beide Backends geteilt wird.
- brave-fedora: Installation via Flatpak/Flathub, neue optionale
  standardbrowser-Option (tuxflotte_optionen) setzt/entfernt den
  System-Default in /etc/xdg/mimeapps.list, mit Firefox-Fallback.
- onlyoffice-fedora: Installation via Flatpak/Flathub.

site.yml reicht zusätzlich zu tuxflotte_auftrag_states auch
tuxflotte_auftrag_optionen pro Rolle durch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-08-04 15:28:57 +02:00

88 lines
3.0 KiB
YAML

- name: Ensure marker directory exists
ansible.builtin.file:
path: /run/tuxflotte/agent/applied
state: directory
mode: "0755"
- name: Ensure flathub remote is configured
community.general.flatpak_remote:
name: flathub
flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo
state: present
method: system
when: tuxflotte_state == "present"
- name: Install Brave via Flatpak
community.general.flatpak:
name: com.brave.Browser
remote: flathub
state: present
method: system
when: tuxflotte_state == "present"
# Systemweiter Default (nicht pro Benutzer), da ansible-pull als root ohne
# Sitzungskontext läuft. /etc/xdg/mimeapps.list gilt für jeden Benutzer ohne
# eigene ~/.config/mimeapps.list. Jeder Lauf erzwingt deterministisch einen
# der beiden Werte - kein Tracking, ob ein Admin manuell etwas anderes
# gesetzt hat (bekannte Einschränkung, siehe README).
- name: Set Brave as system default browser (standardbrowser-Option aktiv)
community.general.ini_file:
path: /etc/xdg/mimeapps.list
section: Default Applications
option: "{{ item }}"
value: com.brave.Browser.desktop
mode: "0644"
no_extra_spaces: true
loop:
- text/html
- x-scheme-handler/http
- x-scheme-handler/https
when: tuxflotte_state == "present" and (tuxflotte_optionen.standardbrowser | default(false))
# Nur zurücksetzen, wenn Brave aktuell tatsächlich als Default eingetragen
# ist - sonst würde jeder Lauf auf jedem Gerät ohne Brave-Auswahl einen
# eventuell fremd (manuell) gesetzten Standardbrowser überschreiben.
- name: Check whether Brave is currently the configured default browser
ansible.builtin.command:
cmd: grep -q com.brave.Browser.desktop /etc/xdg/mimeapps.list
register: tuxflotte_brave_is_default
changed_when: false
failed_when: false
when: tuxflotte_state == "absent" or not (tuxflotte_optionen.standardbrowser | default(false))
- name: Reset default browser to Firefox (standardbrowser-Option inaktiv oder Auftrag abgewählt)
community.general.ini_file:
path: /etc/xdg/mimeapps.list
section: Default Applications
option: "{{ item }}"
value: firefox.desktop
mode: "0644"
no_extra_spaces: true
loop:
- text/html
- x-scheme-handler/http
- x-scheme-handler/https
when: >
(tuxflotte_state == "absent" or not (tuxflotte_optionen.standardbrowser | default(false)))
and tuxflotte_brave_is_default.rc is defined and tuxflotte_brave_is_default.rc == 0
- name: Record that the brave-fedora role ran
ansible.builtin.copy:
dest: /run/tuxflotte/agent/applied/brave-fedora.marker
content: "{{ ansible_date_time.iso8601 }}\n"
mode: "0644"
when: tuxflotte_state == "present"
- name: Remove Brave Flatpak (Auftrag abgewählt)
community.general.flatpak:
name: com.brave.Browser
state: absent
method: system
when: tuxflotte_state == "absent"
- name: Remove brave-fedora marker (Auftrag abgewählt)
ansible.builtin.file:
path: /run/tuxflotte/agent/applied/brave-fedora.marker
state: absent
when: tuxflotte_state == "absent"