feat : Add WOL status check and display feature
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 9s

This commit introduces a new feature that allows users to check and display the Wake-on-LAN (WOL) status for their network interfaces.
This commit is contained in:
2025-12-26 08:25:27 +01:00
parent c35ff62880
commit 7c9d61cbe5

View File

@@ -44,6 +44,20 @@
ansible.builtin.debug: ansible.builtin.debug:
var: en_interfaces var: en_interfaces
- name: WOL | Check if enabled
shell: >
ethtool {{ item }} | grep 'Wake-on' | tail -1 | awk '{print substr($0,length,1)}'
register: wol_enabled
changed_when: false
failed_when: false
loop: "{{ en_interfaces }}"
when: en_interfaces | length > 0
- name: Display var wol_enabled
ansible.builtin.debug:
var: wol_enabled
- name: Check WoL status with ethtool - name: Check WoL status with ethtool
ansible.builtin.shell: "ethtool {{ item }} | grep 'Wake-on'" ansible.builtin.shell: "ethtool {{ item }} | grep 'Wake-on'"
register: wol_status register: wol_status