refactor ♻️: Refactor task handling to use en_interfaces and add non-empty list condition
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 9s

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.
This commit is contained in:
2025-12-26 08:50:11 +01:00
parent a26cb5d0cf
commit 2dc6fd8158

View File

@@ -60,9 +60,10 @@
- name: Check supported Wake-on-LAN modes - name: Check supported Wake-on-LAN modes
ansible.builtin.shell: "ethtool {{ item }} | grep 'Supports Wake-on' | tail -1 | awk '{print $3}'" ansible.builtin.shell: "ethtool {{ item }} | grep 'Supports Wake-on' | tail -1 | awk '{print $3}'"
loop: "{{ interfaces }}" loop: "{{ en_interfaces }}"
register: wol_supported register: wol_supported
changed_when: false changed_when: false
when: en_interfaces | length > 0
- name: Display supported WoL modes - name: Display supported WoL modes
ansible.builtin.debug: ansible.builtin.debug: