refactor ♻️: Refactor regex and add debug info
Refactored the regular expression to improve pattern matching and added debug information for better traceability in the `tasks/main.yml` file.
This commit is contained in:
@@ -20,10 +20,10 @@
|
|||||||
{{
|
{{
|
||||||
bridge_links.stdout_lines
|
bridge_links.stdout_lines
|
||||||
| select('search', 'master ' ~ wol_bridge)
|
| select('search', 'master ' ~ wol_bridge)
|
||||||
| map('regex_replace', '^\\d+: ([^:@]+).*', '\\1')
|
| select('match', '^\\d+: [a-zA-Z0-9]+:')
|
||||||
| reject('search', '^tap')
|
| reject('search', ' veth')
|
||||||
| reject('search', '^fw')
|
| reject('search', ' tap')
|
||||||
| reject('equalto', '')
|
| map('regex_replace', '^\\d+: ([^:]+):.*', '\\1')
|
||||||
| first
|
| first
|
||||||
}}
|
}}
|
||||||
|
|
||||||
@@ -32,6 +32,8 @@
|
|||||||
msg: >
|
msg: >
|
||||||
Unable to detect physical NIC backing {{ wol_bridge }}.
|
Unable to detect physical NIC backing {{ wol_bridge }}.
|
||||||
Please set wol_interface explicitly.
|
Please set wol_interface explicitly.
|
||||||
|
Bridge output:
|
||||||
|
{{ bridge_links.stdout_lines }}
|
||||||
when: wol_detected_phy | default('') | length == 0
|
when: wol_detected_phy | default('') | length == 0
|
||||||
|
|
||||||
# ------------------------------------------------------------
|
# ------------------------------------------------------------
|
||||||
|
|||||||
Reference in New Issue
Block a user