From f087eaf5cd86464dae5f6c3363c57cca1e4a1ba9 Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 23 Dec 2025 21:31:41 +0100 Subject: [PATCH] =?UTF-8?q?refactor=20=E2=99=BB=EF=B8=8F:=20Refactor=20tas?= =?UTF-8?q?k=20to=20detect=20physical=20NIC=20backing=20vmbr0=20and=20upda?= =?UTF-8?q?te=20regex=20for=20extraction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit refactors the task logic to accurately detect the physical NIC backing vmbr0 and updates the regular expression used for extracting relevant information. This ensures more precise and reliable network configuration management. --- tasks/main.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index ec427c0..9239f47 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -19,15 +19,16 @@ msg: "{{ bridge_links.stdout_lines }}" - name: "Detect physical NIC backing {{ wol_bridge }}" +- name: Detect physical NIC backing vmbr0 ansible.builtin.set_fact: wol_detected_phy_candidates: >- {{ bridge_links.stdout_lines | select('search', 'master ' ~ wol_bridge) - | map('regex_replace', '^\\d+: ([^:@]+).*', '\\1') + | map('regex_replace', '^\\d+: ([^:@]+):.*$', '\\1') | reject('search', '^(veth|tap|fw)') | list - }} + }} - name: Select first physical NIC candidate ansible.builtin.set_fact: