fix 🐛: Update regex to match wake-on status with leading whitespace
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 10s

Modified the regular expression to accurately capture wake-on status values that may include leading whitespace, ensuring proper parsing and validation.
This commit is contained in:
2025-12-26 07:18:30 +01:00
parent 6e8a9d7631
commit ce888ccf84

View File

@@ -57,8 +57,8 @@
ansible.builtin.debug: ansible.builtin.debug:
msg: > msg: >
Interface {{ item.item }}: Interface {{ item.item }}:
Supported={{ (item.stdout | regex_findall('Supports Wake-on: (.+)') | first) | default('unknown') }}, Supported={{ (item.stdout | regex_findall('^\\s*Supports Wake-on: (.+)', multiline=True) | first) | default('unknown') }},
Current={{ (item.stdout | regex_findall('Wake-on: (.+)') | first) | default('unknown') }} Current={{ (item.stdout | regex_findall('^\\s*Wake-on: (.+)', multiline=True) | first) | default('unknown') }}
loop: "{{ wol_status.results }}" loop: "{{ wol_status.results }}"
when: item.stdout is defined when: item.stdout is defined