refactor ♻️: Refactor task parsing logic
Some checks failed
ansible-lint / Ansible Lint (push) Failing after 10s

Updated the task parsing algorithm to handle WOL support and state more robustly, ensuring accurate task management.
This commit is contained in:
2025-12-24 10:59:04 +01:00
parent 672d0457fe
commit c52fb6c563

View File

@@ -44,7 +44,7 @@
msg: >
{{ wol_check.results | map(attribute='stdout_lines') | list }}
- name: Parse WOL support and state
- name: Parse WOL support and state (robust)
ansible.builtin.set_fact:
wol_info: >-
{{
@@ -55,9 +55,10 @@
(
item.stdout_lines
| select('search', '^\\s*Supports Wake-on:')
| join(' ')
| regex_search('g')
) is not none,
| map('regex_replace', '^\\s*Supports Wake-on:\\s*', '')
| first
| default('')
).find('g') != -1,
'current_state':
(
item.stdout_lines