diff --git a/roles/google-earth/defaults/main.yml b/roles/google-earth/defaults/main.yml new file mode 100644 index 0000000..94c225a --- /dev/null +++ b/roles/google-earth/defaults/main.yml @@ -0,0 +1 @@ +tuxflotte_state: present diff --git a/roles/google-earth/tasks/main.yml b/roles/google-earth/tasks/main.yml new file mode 100644 index 0000000..e8aedc5 --- /dev/null +++ b/roles/google-earth/tasks/main.yml @@ -0,0 +1,47 @@ +- name: Ensure marker directory exists + ansible.builtin.file: + path: /run/tuxflotte/agent/applied + state: directory + mode: "0755" + +# Google Earth Pro gibt es nicht als Flatpak - Google vertreibt nur eigene +# .deb/.rpm-Pakete direkt. Beide Backends (fedora, mint) nutzen denselben +# Rollennamen "google-earth" (siehe blueprints-Seed, gleiches Muster wie bei +# guest-session), die Rolle installiert je nach os_family das passende Paket. + +- name: Install Google Earth Pro (Debian/Mint) + ansible.builtin.apt: + deb: https://dl.google.com/dl/earth/client/current/google-earth-pro-stable_current_amd64.deb + update_cache: true + when: tuxflotte_state == "present" and ansible_facts['os_family'] == 'Debian' + +- name: Install Google Earth Pro (Fedora) + ansible.builtin.dnf: + name: https://dl.google.com/dl/earth/client/current/google-earth-pro-stable_current_x86_64.rpm + state: present + when: tuxflotte_state == "present" and ansible_facts['os_family'] == 'RedHat' + +- name: Record that the google-earth role ran + ansible.builtin.copy: + dest: /run/tuxflotte/agent/applied/google-earth.marker + content: "{{ ansible_date_time.iso8601 }}\n" + mode: "0644" + when: tuxflotte_state == "present" + +- name: Remove Google Earth Pro (Debian/Mint, Auftrag abgewählt) + ansible.builtin.apt: + name: google-earth-pro-stable + state: absent + when: tuxflotte_state == "absent" and ansible_facts['os_family'] == 'Debian' + +- name: Remove Google Earth Pro (Fedora, Auftrag abgewählt) + ansible.builtin.dnf: + name: google-earth-pro-stable + state: absent + when: tuxflotte_state == "absent" and ansible_facts['os_family'] == 'RedHat' + +- name: Remove google-earth marker (Auftrag abgewählt) + ansible.builtin.file: + path: /run/tuxflotte/agent/applied/google-earth.marker + state: absent + when: tuxflotte_state == "absent" diff --git a/site.yml b/site.yml index 84acff8..28c86e3 100644 --- a/site.yml +++ b/site.yml @@ -47,3 +47,12 @@ tuxflotte_state: "{{ tuxflotte_auftrag_states.get('libreoffice', 'present') }}" tuxflotte_optionen: "{{ tuxflotte_auftrag_optionen.get('libreoffice', {}) }}" tags: libreoffice + + - include_role: + name: google-earth + apply: + tags: google-earth + vars: + tuxflotte_state: "{{ tuxflotte_auftrag_states.get('google-earth', 'present') }}" + tuxflotte_optionen: "{{ tuxflotte_auftrag_optionen.get('google-earth', {}) }}" + tags: google-earth