From e2e2fd3a111dc307fb8e54dae9689ff901e7e9c1 Mon Sep 17 00:00:00 2001 From: Ahmed Abdelhalim Date: Fri, 3 Jul 2026 11:00:17 +0200 Subject: Update ethtool to handle laptop lid suspend issues When using WoL with laptops (ex Lenovo) closing the lid suspends the laptop and breaks WoL, this is to allow configuring the lid behavior --- roles/ethtool/tasks/main.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'roles/ethtool/tasks') diff --git a/roles/ethtool/tasks/main.yml b/roles/ethtool/tasks/main.yml index 9d2dac60..d1832d0b 100644 --- a/roles/ethtool/tasks/main.yml +++ b/roles/ethtool/tasks/main.yml @@ -22,3 +22,18 @@ enabled: true state: "started" daemon_reload: true + +- name: "Ensure /etc/systemd/logind.conf.d exists" + become: true + ansible.builtin.file: + path: "/etc/systemd/logind.conf.d" + state: "directory" + mode: "0755" + +- name: "Configure lid switch on AC power" + become: true + ansible.builtin.template: + src: "logind.conf.j2" + dest: "/etc/systemd/logind.conf.d/wol.conf" + mode: "0644" + notify: "Reload systemd-logind" -- cgit v1.2.3