feat ✨: Add WOL status check and display feature
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 9s
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:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user