From cd2b905a0b4c211d528024cfe4f8e21248acfa8c Mon Sep 17 00:00:00 2001 From: GeertJohan Date: Fri, 7 Aug 2026 20:59:51 +0200 Subject: [PATCH] Expose METAL_CORE_ADDITIONAL_MGMT_ROUTES in the metal-core role metal-core supports additional destination CIDRs routed to the management network gateway since metal-stack/metal-core#204, but the role never rendered the env var, so deployments could not set it. Same list + join pattern as the additional bridge vars; empty by default, which older metal-core versions ignore. --- partition/roles/metal-core/README.md | 1 + partition/roles/metal-core/defaults/main.yaml | 1 + partition/roles/metal-core/templates/metal-core-env.j2 | 1 + 3 files changed, 3 insertions(+) diff --git a/partition/roles/metal-core/README.md b/partition/roles/metal-core/README.md index a3b8a72ba..319c951df 100644 --- a/partition/roles/metal-core/README.md +++ b/partition/roles/metal-core/README.md @@ -30,6 +30,7 @@ You can look up all the default values of this role [here](defaults/main.yaml). | metal_core_grpc_client_key | | The gRPC client certificate key content | | metal_core_additional_bridge_vids | | | | metal_core_additional_bridge_ports | | | +| metal_core_additional_mgmt_routes | | Additional destination CIDRs that are routed to the management network gateway next to the default route. | | metal_core_spine_uplinks | | The switch ports that connect a leaf to a spine switch or other ports that need to be part of the EVPN underlay fabric. Defaults to `swp31` and `swp32` at the metal-core. | | metal_core_consider_hosts_file_resolution | | If set to true mounts `/etc/nsswitch.conf` into the container to enable dns resolution with the hosts file (see [go#22846](https://github.com/golang/go/issues/22846)) | | metal_core_interfaces_tpl_file | | The golang template file to use for rendering `/etc/network/interfaces`. If this is left blank the default template shipped with metal-core will be used. | diff --git a/partition/roles/metal-core/defaults/main.yaml b/partition/roles/metal-core/defaults/main.yaml index 47ae517a5..c6bafd805 100644 --- a/partition/roles/metal-core/defaults/main.yaml +++ b/partition/roles/metal-core/defaults/main.yaml @@ -18,6 +18,7 @@ metal_core_grpc_client_key: "{{ metal_partition_metal_api_grpc_client_key }}" metal_core_additional_bridge_vids: [] metal_core_additional_bridge_ports: [] +metal_core_additional_mgmt_routes: [] metal_core_additional_volume_mounts: [] metal_core_consider_hosts_file_resolution: false diff --git a/partition/roles/metal-core/templates/metal-core-env.j2 b/partition/roles/metal-core/templates/metal-core-env.j2 index 183ffc5cf..953c6d1b8 100644 --- a/partition/roles/metal-core/templates/metal-core-env.j2 +++ b/partition/roles/metal-core/templates/metal-core-env.j2 @@ -27,6 +27,7 @@ METAL_CORE_GRPC_CLIENT_CERT_FILE: "{{ metal_core_grpc_cert_dir }}/client.pem" METAL_CORE_GRPC_CLIENT_KEY_FILE: "{{ metal_core_grpc_cert_dir }}/client-key.pem" METAL_CORE_ADDITIONAL_BRIDGE_VIDS: "{{ metal_core_additional_bridge_vids | join(',') }}" METAL_CORE_ADDITIONAL_BRIDGE_PORTS: "{{ metal_core_additional_bridge_ports | join(',') }}" +METAL_CORE_ADDITIONAL_MGMT_ROUTES: "{{ metal_core_additional_mgmt_routes | join(',') }}" {% if metal_core_spine_uplinks is defined %} METAL_CORE_SPINE_UPLINKS: "{{ metal_core_spine_uplinks | join(',') }}" {% endif %}