From dc1cb25da0516ea917b2bf6e96f5f5143c3c1dbb Mon Sep 17 00:00:00 2001 From: Thomas Stallinger Date: Thu, 6 Aug 2026 08:45:04 +0200 Subject: [PATCH] feat: LibreOffice-Rolle als weitere Office-Suite MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Neben OnlyOffice als zusätzliche Katalog-Option, distro-unabhängig über Flatpak (org.libreoffice.LibreOffice), gleiches present/absent- Muster wie die onlyoffice-Rolle. Co-Authored-By: Claude Sonnet 5 --- roles/libreoffice/defaults/main.yml | 1 + roles/libreoffice/tasks/main.yml | 41 +++++++++++++++++++++++++++++ site.yml | 9 +++++++ 3 files changed, 51 insertions(+) create mode 100644 roles/libreoffice/defaults/main.yml create mode 100644 roles/libreoffice/tasks/main.yml diff --git a/roles/libreoffice/defaults/main.yml b/roles/libreoffice/defaults/main.yml new file mode 100644 index 0000000..94c225a --- /dev/null +++ b/roles/libreoffice/defaults/main.yml @@ -0,0 +1 @@ +tuxflotte_state: present diff --git a/roles/libreoffice/tasks/main.yml b/roles/libreoffice/tasks/main.yml new file mode 100644 index 0000000..d078b4d --- /dev/null +++ b/roles/libreoffice/tasks/main.yml @@ -0,0 +1,41 @@ +- 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 LibreOffice via Flatpak + community.general.flatpak: + name: org.libreoffice.LibreOffice + remote: flathub + state: present + method: system + when: tuxflotte_state == "present" + +- name: Record that the libreoffice role ran + ansible.builtin.copy: + dest: /run/tuxflotte/agent/applied/libreoffice.marker + content: "{{ ansible_date_time.iso8601 }}\n" + mode: "0644" + when: tuxflotte_state == "present" + +- name: Remove LibreOffice Flatpak (Auftrag abgewählt) + community.general.flatpak: + name: org.libreoffice.LibreOffice + state: absent + method: system + when: tuxflotte_state == "absent" + +- name: Remove libreoffice marker (Auftrag abgewählt) + ansible.builtin.file: + path: /run/tuxflotte/agent/applied/libreoffice.marker + state: absent + when: tuxflotte_state == "absent" diff --git a/site.yml b/site.yml index 1511828..84acff8 100644 --- a/site.yml +++ b/site.yml @@ -38,3 +38,12 @@ tuxflotte_state: "{{ tuxflotte_auftrag_states.get('onlyoffice', 'present') }}" tuxflotte_optionen: "{{ tuxflotte_auftrag_optionen.get('onlyoffice', {}) }}" tags: onlyoffice + + - include_role: + name: libreoffice + apply: + tags: libreoffice + vars: + tuxflotte_state: "{{ tuxflotte_auftrag_states.get('libreoffice', 'present') }}" + tuxflotte_optionen: "{{ tuxflotte_auftrag_optionen.get('libreoffice', {}) }}" + tags: libreoffice