feat: tilføj sudoers-regel for shutdown uden password
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.
This commit is contained in:
@@ -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=
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user