From 2dc6fd8158bb1e2bddfcf7592b6a6ac22588e76c Mon Sep 17 00:00:00 2001 From: Jose Date: Fri, 26 Dec 2025 08:50:11 +0100 Subject: [PATCH] =?UTF-8?q?refactor=20=E2=99=BB=EF=B8=8F:=20Refactor=20tas?= =?UTF-8?q?k=20handling=20to=20use=20en=5Finterfaces=20and=20add=20non-emp?= =?UTF-8?q?ty=20list=20condition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit refactors the task handling logic to utilize the `en_interfaces` module and includes a conditional check for non-empty lists, enhancing code readability and functionality. --- tasks/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index ddd5367..ba34f09 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -60,9 +60,10 @@ - name: Check supported Wake-on-LAN modes ansible.builtin.shell: "ethtool {{ item }} | grep 'Supports Wake-on' | tail -1 | awk '{print $3}'" - loop: "{{ interfaces }}" + loop: "{{ en_interfaces }}" register: wol_supported changed_when: false + when: en_interfaces | length > 0 - name: Display supported WoL modes ansible.builtin.debug: