refactor ♻️: Refactor task to detect physical NIC backing vmbr0 and update regex for extraction
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.
This commit is contained in:
@@ -19,12 +19,13 @@
|
|||||||
msg: "{{ bridge_links.stdout_lines }}"
|
msg: "{{ bridge_links.stdout_lines }}"
|
||||||
|
|
||||||
- name: "Detect physical NIC backing {{ wol_bridge }}"
|
- name: "Detect physical NIC backing {{ wol_bridge }}"
|
||||||
|
- name: Detect physical NIC backing vmbr0
|
||||||
ansible.builtin.set_fact:
|
ansible.builtin.set_fact:
|
||||||
wol_detected_phy_candidates: >-
|
wol_detected_phy_candidates: >-
|
||||||
{{
|
{{
|
||||||
bridge_links.stdout_lines
|
bridge_links.stdout_lines
|
||||||
| select('search', 'master ' ~ wol_bridge)
|
| select('search', 'master ' ~ wol_bridge)
|
||||||
| map('regex_replace', '^\\d+: ([^:@]+).*', '\\1')
|
| map('regex_replace', '^\\d+: ([^:@]+):.*$', '\\1')
|
||||||
| reject('search', '^(veth|tap|fw)')
|
| reject('search', '^(veth|tap|fw)')
|
||||||
| list
|
| list
|
||||||
}}
|
}}
|
||||||
|
|||||||
Reference in New Issue
Block a user