[PATCH proxmox-ve-rs v5 09/46] frr-templates: change route maps template to adapt to new frr types

Stefan Hanreich
2026-05-05T15:37:58Z

Instead of defining every potential match / set type manually under a
different name, proxmox-frr now uses the Adjacently tagged
representation for representing key/value pairs for match/set actions.
This allows simplifying the route_maps template by simply rendering
the respective key / value fields.

proxmox-frr added support for call actions and exit policies as well.
Add them to the template so they get rendered properly.

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
---
.../templates/route_maps.jinja | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/proxmox-frr-templates/templates/route_maps.jinja b/proxmox-frr-templates/templates/route_maps.jinja
index 172c682..12c314c 100644
--- a/proxmox-frr-templates/templates/route_maps.jinja
+++ b/proxmox-frr-templates/templates/route_maps.jinja
@@ -3,17 +3,20 @@
!
route-map {{ name }} {{ routemap.action }} {{ routemap.seq }}
{% for match in routemap.matches %}
-{% if match.value.list_type == "prefixlist" %}
- match {{ match.protocol_type }} {{ match.match_type }} prefix-list {{ match.value.list_name }}
-{% elif match.value.list_type == "accesslist" %}
- match {{ match.protocol_type }} {{ match.match_type }} {{ match.value.list_name }}
-{% elif match.match_type == "next-hop" %}
- match {{ match.protocol_type }} next-hop {{ match.value }}
-{% endif %}
+ match {{ match.key }}{% if match.value is defined %}{{ " " ~ match.value }}{% endif %}
+
{% endfor %}
{% for set in routemap.sets %}
- set {{ set.set_type }} {{ set.value }}
+ set {{ set.key }}{% if set.value is defined %}{{ " " ~ set.value }}{% endif %}
+
{% endfor %}
+{% if routemap.call %}
+ call {{ routemap.call }}
+{% endif %}
+{% if routemap.exit_action %}
+ {{ routemap.exit_action.key }}{% if routemap.exit_action.value is defined %}{{ " " ~ routemap.exit_action.value }}{% endif %}
+
+{% endif %}
{% for line in routemap.custom_frr_config %}
{{ line }}
{% endfor %}
--
2.47.3