forked from tim/k3s-ansible
feat(metallb): add option to limit MetalLB layer2 announcements to specific interfaces (#696)
- roles/k3s_server_post/templates/metallb.crs.j2: render spec.interfaces in the L2Advertisement when metal_lb_interfaces is a non-empty list, so MetalLB only announces on the configured interfaces. Empty list (default) keeps announcing on all interfaces, preserving existing behavior. - roles/k3s_server_post/defaults/main.yml: add metal_lb_interfaces: [] default - roles/k3s_server_post/meta/main.yml: add metal_lb_interfaces argument_spec - inventory/sample/group_vars/all.yml: document the new sample variable - .github/scripts/test-metallb-interfaces.py: regression test rendering the template for empty/single/multiple interfaces and confirming the BGP path is unaffected - .pre-commit-config.yaml: wire the new test into pre-commit Co-authored-by: Leo <leo@kuboschek.me>
This commit is contained in:
@@ -93,6 +93,14 @@ repos:
|
||||
language: system
|
||||
pass_filenames: false
|
||||
files: ^roles/k3s_server/tasks/metallb\.yml$|^\.github/scripts/test-metallb-remote-read\.sh$
|
||||
- id: metallb-interfaces-test
|
||||
name: MetalLB interfaces test
|
||||
entry: python3 .github/scripts/test-metallb-interfaces.py
|
||||
language: python
|
||||
additional_dependencies:
|
||||
- Jinja2>=3.1
|
||||
pass_filenames: false
|
||||
files: ^roles/k3s_server_post/templates/metallb\.crs\.j2$|^\.github/scripts/test-metallb-interfaces\.py$
|
||||
- id: metallb-deploy-condition-test
|
||||
name: MetalLB deploy condition test
|
||||
entry: python3 .github/scripts/test-metallb-deploy-condition.py
|
||||
|
||||
Reference in New Issue
Block a user