diff --git a/tasks/main.yml b/tasks/main.yml index 5a16026..d19c18b 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -57,20 +57,13 @@ when: en_interfaces | length > 0 - name: Enable Wake-on-LAN (magic packet) when supported - ansible.builtin.command: "ethtool -s {{ item.interface }} wol g" + ansible.builtin.command: "ethtool -s {{ item.0 }} wol g" loop: "{{ en_interfaces | zip(wol_enabled.results, wol_supported.results) | list }}" loop_control: label: "{{ item.0 }}" - vars: - # item.0 = interface - # item.1 = wol_enabled result - # item.2 = wol_supported result - interface: "{{ item.0 }}" - wol_enabled_result: "{{ item.1 }}" - wol_supported_result: "{{ item.2 }}" when: - - "'g' not in wol_enabled_result.stdout" - - "'g' in wol_supported_result.stdout" + - "'g' not in item.1.stdout" + - "'g' in item.2.stdout" # # ============================================================