From f7a22cb3eccfa230c84902e4ca7593b37578c911 Mon Sep 17 00:00:00 2001 From: GlennIgen Date: Fri, 22 May 2026 21:54:31 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20tilf=C3=B8j=20sudoers-regel=20for=20shu?= =?UTF-8?q?tdown=20uden=20password?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Opretter /etc/sudoers.d/shutdown-nopasswd så brugeren kan køre /sbin/shutdown uden sudo-password — nødvendigt for shutdown/reboot scripts. Syntaks valideres med visudo inden filen skrives. --- kde_shortcuts/custom_shortcuts.kksrc | 5 +---- tasks/system.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/kde_shortcuts/custom_shortcuts.kksrc b/kde_shortcuts/custom_shortcuts.kksrc index 2c672ee..b840d75 100644 --- a/kde_shortcuts/custom_shortcuts.kksrc +++ b/kde_shortcuts/custom_shortcuts.kksrc @@ -14,14 +14,11 @@ Name=app_close_and_shutdown Exec=kitty --override window_title="shutdown-script" bash -c "~/scripts/app_close_and_reboot.sh; exec bash" Name=app_close_and_restart.sh\s -[StandardShortcuts] -Close=Ctrl+Esc - [kitty.desktop][Global Shortcuts] _launch=Meta+Return [kwin][Global Shortcuts] -Window Close=Ctrl+W; Alt+F4 +Window Close=Alt+F4 Window Custom Quick Tile Bottom= Window Custom Quick Tile Top= diff --git a/tasks/system.yml b/tasks/system.yml index 17cb0ee..0427e72 100644 --- a/tasks/system.yml +++ b/tasks/system.yml @@ -17,6 +17,14 @@ enabled: true state: started +- name: System - tillad shutdown uden password (til scripts) + ansible.builtin.lineinfile: + path: /etc/sudoers.d/shutdown-nopasswd + line: "{{ actual_user.stdout }} ALL=(ALL) NOPASSWD: /sbin/shutdown" + create: true + mode: '0440' + validate: 'visudo -cf %s' + - name: System - resolv.conf symlink (NetworkManager + systemd-resolved fix) ansible.builtin.file: src: /run/systemd/resolve/stub-resolv.conf