refactor ♻️: Refactor regex and filter logic for Wake-on state extraction
All checks were successful
ansible-lint / Ansible Lint (push) Successful in 9s

Updated regular expression patterns and filtering mechanisms to more accurately extract the Wake-on state from system logs.
This commit is contained in:
2025-12-25 21:50:06 +01:00
parent 670021fcc8
commit 40f25bbd53

View File

@@ -60,8 +60,9 @@
'current_state': 'current_state':
( (
item.stdout_lines item.stdout_lines
| select('search', '^\\s*Wake-on:') | map('trim')
| map('regex_replace', '.*Wake-on:\\s*', '') | select('match', '^Wake-on:')
| map('regex_replace', 'Wake-on:\\s*', '')
| first | first
| default('unknown') | default('unknown')
) )