summaryrefslogtreecommitdiff
path: root/roles/ws/flatpak/tasks/main.yml
blob: 5229996ca0d7782747d464c61d2563b9a14f6370 (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
35
---
- 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 | selectattr('link', 'defined') }}"
  loop_control:
    label: "{{ item.name }}"
  copy:
    content: |
      #!/bin/sh

      exec flatpak run "{{ item.name }}"
    dest: "/usr/local/bin/{{ item.link }}"
    mode: 0755