diff --git a/config/ansible/tasks/flatpaks.yml b/config/ansible/tasks/flatpaks.yml index 9ccd0bd..b50ca7a 100644 --- a/config/ansible/tasks/flatpaks.yml +++ b/config/ansible/tasks/flatpaks.yml @@ -4,46 +4,61 @@ flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo state: present -- name: Install Flatpak applications +- name: Get list of installed Flatpaks + command: flatpak list --app --columns=application + register: installed_flatpaks + changed_when: false + +- name: Define desired Flatpaks + set_fact: + desired_flatpaks: + - org.fkoehler.KTailctl + - org.mozilla.Thunderbird + - io.github.kukuruzka165.materialgram + - com.spotify.Client + - org.gnome.Extensions + - com.endlessnetwork.aqueducts + - com.tomjwatson.Emote + - io.github.openhv.OpenHV + - net.wz2100.wz2100 + - com.github.k4zmu2a.spacecadetpinball + - com.usebottles.bottles + - io.github.shiftey.Desktop + - org.fedoraproject.MediaWriter + - com.github.tchx84.Flatseal + - de.haeckerfelix.Shortwave + - io.github.thetumultuousunicornofdarkness.cpu-x + - org.gnome.Crosswords + - com.github.wwmm.easyeffects + - dev.bragefuglseth.Keypunch + - org.onlyoffice.desktopeditors + - com.jeffser.Alpaca + - info.beyondallreason.bar + - io.gitlab.adhami3310.Impression + - org.prismlauncher.PrismLauncher + - com.logseq.Logseq + - io.ente.auth + - org.signal.Signal + - com.mardojai.ForgeSparks + - io.github.fastrizwaan.WineZGUI + - net.davidotek.pupgui2 + - tv.plex.PlexDesktop + - com.mastermindzh.tidal-hifi + - io.github.flattool.Warehouse + - net.lutris.Lutris + - com.plexamp.Plexamp + - io.github.nokse22.Exhibit + - net.nokyan.Resources + - dev.zed.Zed + +- name: Install desired Flatpak applications community.general.flatpak: name: "{{ item }}" state: present - loop: - - org.fkoehler.KTailctl - - org.mozilla.Thunderbird - - io.github.kukuruzka165.materialgram - - com.spotify.Client - - org.gnome.Extensions - - com.endlessnetwork.aqueducts - - com.tomjwatson.Emote - - io.github.openhv.OpenHV - - net.wz2100.wz2100 - - com.github.k4zmu2a.spacecadetpinball - - com.usebottles.bottles - - io.github.shiftey.Desktop - - org.fedoraproject.MediaWriter - - com.github.tchx84.Flatseal - - de.haeckerfelix.Shortwave - - io.github.thetumultuousunicornofdarkness.cpu-x - - org.gnome.Crosswords - - com.github.wwmm.easyeffects - - dev.bragefuglseth.Keypunch - - org.onlyoffice.desktopeditors - - com.jeffser.Alpaca - - info.beyondallreason.bar - - io.gitlab.adhami3310.Impression - - org.prismlauncher.PrismLauncher - - com.logseq.Logseq - - io.ente.auth - - org.signal.Signal - - com.mardojai.ForgeSparks - - io.github.fastrizwaan.WineZGUI - - net.davidotek.pupgui2 - - tv.plex.PlexDesktop - - com.mastermindzh.tidal-hifi - - io.github.flattool.Warehouse - - net.lutris.Lutris - - com.plexamp.Plexamp - - io.github.nokse22.Exhibit - - net.nokyan.Resources - - dev.zed.Zed + loop: "{{ desired_flatpaks }}" + +- name: Remove undesired Flatpak applications + community.general.flatpak: + name: "{{ item }}" + state: absent + loop: "{{ installed_flatpaks.stdout_lines | difference(desired_flatpaks) }}"