fix 🐛: Update regex to match wake-on status with leading whitespace
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 10s
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:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user