From 49d61d5cd552e0f48a24040c5df3d7d63b93ef72 Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 23 Dec 2025 21:11:21 +0100 Subject: [PATCH] =?UTF-8?q?refactor=20=E2=99=BB=EF=B8=8F:=20Refactor=20reg?= =?UTF-8?q?ex=20and=20add=20debug=20info?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Refactored the regular expression to improve pattern matching and added debug information for better traceability in the `tasks/main.yml` file. --- tasks/main.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index b9a9379..4844360 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -20,10 +20,10 @@ {{ bridge_links.stdout_lines | select('search', 'master ' ~ wol_bridge) - | map('regex_replace', '^\\d+: ([^:@]+).*', '\\1') - | reject('search', '^tap') - | reject('search', '^fw') - | reject('equalto', '') + | select('match', '^\\d+: [a-zA-Z0-9]+:') + | reject('search', ' veth') + | reject('search', ' tap') + | map('regex_replace', '^\\d+: ([^:]+):.*', '\\1') | first }} @@ -32,6 +32,8 @@ msg: > Unable to detect physical NIC backing {{ wol_bridge }}. Please set wol_interface explicitly. + Bridge output: + {{ bridge_links.stdout_lines }} when: wol_detected_phy | default('') | length == 0 # ------------------------------------------------------------