From 55e5aa94d26c8b557004d12b55d5152c317e9200 Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 26 Dec 2025 10:02:46 +0100 Subject: [PATCH] =?UTF-8?q?feat=20=E2=9C=A8:=20Add=20new=20task=20to=20dis?= =?UTF-8?q?able=20Wake-on-LAN=20and=20update=20existing=20task=20with=20mo?= =?UTF-8?q?de=20parameter?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit introduces a new feature to disable Wake-on-LAN functionality and enhances an existing task by adding a mode parameter, allowing for more flexible configuration options. --- tasks/main.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 33d319d..8d2116e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -56,7 +56,7 @@ loop: "{{ en_interfaces }}" when: en_interfaces | length > 0 -- name: Set Wake-on-LAN +- name: "Set Wake-on-LAN to {{ wol_mode }}" ansible.builtin.command: "ethtool -s {{ item.0 }} wol {{ wol_mode }}" loop: "{{ en_interfaces | zip(wol_enabled.results, wol_supported.results) | list }}" loop_control: @@ -65,6 +65,15 @@ - wol_mode not in item.1.stdout - wol_mode in item.2.stdout +- name: "Disable Wake-on-LAN" + ansible.builtin.command: "ethtool -s {{ item.0 }} wol {{ wol_mode }}" + loop: "{{ en_interfaces | zip(wol_enabled.results, wol_supported.results) | list }}" + loop_control: + label: "{{ item.0 }}" + when: + - wol_mode == 'd' + - wol_mode not in item.1.stdout + # # ============================================================ # # Enable WOL immediately (only if needed)