mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-11-05 04:38:16 +00:00
Added draft for lid-switch
This commit is contained in:
6
roles/pc-lid-switch/handlers/main.yml
Normal file
6
roles/pc-lid-switch/handlers/main.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- name: Restart systemd-logind
|
||||||
|
become: yes
|
||||||
|
systemd:
|
||||||
|
name: systemd-logind
|
||||||
|
state: restarted
|
||||||
9
roles/pc-lid-switch/tasks/main.yml
Normal file
9
roles/pc-lid-switch/tasks/main.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
---
|
||||||
|
- name: Set HandleLidSwitch to hibernate in /etc/systemd/logind.conf
|
||||||
|
become: yes
|
||||||
|
lineinfile:
|
||||||
|
path: /etc/systemd/logind.conf
|
||||||
|
regexp: '^#?HandleLidSwitch='
|
||||||
|
line: 'HandleLidSwitch=hibernate'
|
||||||
|
backup: yes
|
||||||
|
notify: Restart systemd-logind
|
||||||
Reference in New Issue
Block a user