feat : Add debug tasks for en_interfaces and wol_status
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 9s

This commit introduces new debug tasks specifically for the `en_interfaces` and `wol_status` modules, enhancing the diagnostic capabilities of these functionalities.
This commit is contained in:
2025-12-26 07:30:06 +01:00
parent ce888ccf84
commit 4ecc0d10f8

View File

@@ -35,11 +35,15 @@
| list | list
}} }}
- name: Display selected interfaces - name: Display debug selected interfaces
ansible.builtin.debug: ansible.builtin.debug:
msg: > msg: >
{{ en_interfaces }} {{ en_interfaces }}
- name: Display var selected interfaces
ansible.builtin.debug:
var: en_interfaces
- 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
@@ -48,18 +52,15 @@
loop: "{{ en_interfaces }}" loop: "{{ en_interfaces }}"
when: en_interfaces | length > 0 when: en_interfaces | length > 0
- name: Display var wol_status
ansible.builtin.debug:
var: wol_status
- name: Display WoL status - name: Display WoL status
ansible.builtin.debug: ansible.builtin.debug:
msg: "{{ item.item }}:\n{{ item.stdout | default('No output') }}" msg: "{{ item.item }}:\n{{ item.stdout | default('No output') }}"
loop: "{{ wol_status.results }}" loop: "{{ wol_status.results }}"
- name: Display WoL status summary
ansible.builtin.debug:
msg: >
Interface {{ item.item }}:
Supported={{ (item.stdout | regex_findall('^\\s*Supports Wake-on: (.+)', multiline=True) | first) | default('unknown') }},
Current={{ (item.stdout | regex_findall('^\\s*Wake-on: (.+)', multiline=True) | first) | default('unknown') }}
loop: "{{ wol_status.results }}"
when: item.stdout is defined when: item.stdout is defined