Skip to content

Commit 1279576

Browse files
author
Derek
committed
fix: add flatpak polkit rule for RDP sessions and keep snapd
1 parent 26260f6 commit 1279576

3 files changed

Lines changed: 30 additions & 10 deletions

File tree

ansible/roles/dfe_developer/tasks/desktop.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,11 @@
4040

4141
# Remove unwanted packages that come as recommends
4242
# - gnome-initial-setup: We suppress this anyway
43-
# - snapd: We don't use snaps, prefer apt/flatpak
4443
# - ubuntu-report, whoopsie, apport-gtk: Telemetry/crash reporting
4544
- name: Remove unwanted packages (Ubuntu)
4645
ansible.builtin.apt:
4746
name:
4847
- gnome-initial-setup
49-
- snapd
5048
- ubuntu-report
5149
- whoopsie
5250
- apport-gtk
@@ -55,14 +53,6 @@
5553
purge: true
5654
when: ansible_facts['distribution'] == 'Ubuntu'
5755

58-
# Prevent snapd from being reinstalled as a dependency
59-
- name: Hold snapd package to prevent reinstall
60-
ansible.builtin.dpkg_selections:
61-
name: snapd
62-
selection: hold
63-
when: ansible_facts['distribution'] == 'Ubuntu'
64-
failed_when: false
65-
6656
- name: Install LibreOffice (Ubuntu)
6757
ansible.builtin.apt:
6858
name: libreoffice

ansible/roles/dfe_rdp/tasks/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717
- ansible_facts['distribution'] in ['Fedora', 'Ubuntu']
1818
- not dfe_has_gnome
1919

20+
- name: Configure polkit rules for RDP sessions
21+
ansible.builtin.include_tasks:
22+
file: polkit.yml
23+
tags: ['polkit']
24+
2025
- name: Configure RDP certificates
2126
ansible.builtin.include_tasks:
2227
file: certificates.yml
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
# Polkit rules for RDP sessions
3+
# Allow wheel users to manage Flatpak without repeated auth prompts over RDP
4+
# See docs/POLKIT-RDP.md for details
5+
6+
- name: Allow wheel users to manage Flatpak on remote sessions
7+
ansible.builtin.copy:
8+
dest: /etc/polkit-1/rules.d/49-flatpak-wheel.rules
9+
owner: root
10+
group: root
11+
mode: '0644'
12+
content: |
13+
polkit.addRule(function(action, subject) {
14+
if ((action.id == "org.freedesktop.Flatpak.app-install" ||
15+
action.id == "org.freedesktop.Flatpak.runtime-install" ||
16+
action.id == "org.freedesktop.Flatpak.app-uninstall" ||
17+
action.id == "org.freedesktop.Flatpak.runtime-uninstall" ||
18+
action.id == "org.freedesktop.Flatpak.modify-repo") &&
19+
subject.active == true &&
20+
subject.isInGroup("wheel")) {
21+
return polkit.Result.YES;
22+
}
23+
return polkit.Result.NOT_HANDLED;
24+
});
25+
when: ansible_facts['distribution'] in ['Fedora', 'Ubuntu']

0 commit comments

Comments
 (0)