summaryrefslogtreecommitdiff
path: root/roles/ws/flatpak/tasks/main.yml
blob: 904d4ccae97a145bb82b74c3be1990d97ffecd43 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---
- name: install flatpak
  apt:
    name: flatpak
    state: present

- name: add flatpak repositories to systemd-wide flatpak remotes
  loop: "{{ ws_flatpak_repositories | dict2items }}"
  loop_control:
    label: "{{ item.key }}"
  community.general.flatpak_remote:
    name: "{{ item.key }}"
    flatpakrepo_url: "{{ item.value }}"
    state: present

- name: install flatpak apps
  loop: "{{ ws_flatpak_apps }}"
  loop_control:
    label: "{{ item.name }}"
  community.general.flatpak:
    name: "{{ item.name }}"
    remote: "{{ item.remote | default(omit) }}"
    state: present

- name: install simple run script to /usr/local/bin
  loop: "{{ ws_flatpak_apps | flatpak_app_shortcuts }}"
  loop_control:
    label: "{{ item.name }} -> {{ item.app }}"
  copy:
    content: |
      #!/bin/sh
      exec flatpak run{% if 'command' in item %} "--command={{ item.command }}"{% endif %} "{{ item.app }}" "$@"
    dest: "/usr/local/bin/{{ item.name }}"
    mode: 0755