9 lines
256 B
YAML

---
- 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