On 2026-03-10 13:09, Gabriel Goller wrote:
> This debian package contains the jinja template files used to generate
> the frr config. Currently only the fabrics template files are here, the
> rest will be added in later commits. When installing this package the
> templates will be installed to `/usr/share/proxmox-frr/templates/`.
> `proxmox-frr` will then use `include_str!` to embed the templates into
> the binary.
>
> This package will only be published to the `devel` channel.
>
> Co-authored-by: Stefan Hanreich <[email protected]>
> Signed-off-by: Gabriel Goller <[email protected]>
> ---
[..]
> diff --git a/proxmox-frr-templates/templates/interface.jinja
> b/proxmox-frr-templates/templates/interface.jinja
> new file mode 100644
> index 000000000000..c3c3b6c3526f
> --- /dev/null
> +++ b/proxmox-frr-templates/templates/interface.jinja
> @@ -0,0 +1,9 @@
> +{% macro interface(name, addresses) %}
> +!
> +interface {{ name }}
> +{% for address in addresses %}
> + ip address {{address}}
I think we have to split v4 and v6 addresses cause FRR wants
`ipv6 address ...` for v6 addresses
> +{% endfor %}
> +{{ caller() -}}
> +exit
> +{% endmacro %}
> diff --git a/proxmox-frr-templates/templates/ospfd.jinja
> b/proxmox-frr-templates/templates/ospfd.jinja
> new file mode 100644
> index 000000000000..8f9e76390f75
> --- /dev/null
> +++ b/proxmox-frr-templates/templates/ospfd.jinja
> @@ -0,0 +1,18 @@
> +{% from "interface.jinja" import interface %}
> +{% if ospf.router %}
> +!
> +router ospf
> + ospf router-id {{ ospf.router.router_id }}
> +exit
> +{% endif %}
> +{% for interface_name, interface_config in ospf.interfaces|items %}
> +{% call interface(interface_name, interface_config.addresses) %}
> + ip ospf area {{ interface_config.area }}
> +{% if interface_config.passive %}
> + ip ospf passive
> +{% endif %}
> +{% if interface_config.network_type %}
> + ip ospf network {{ interface_config.network_type }}
> +{% endif %}
> +{% endcall %}
> +{% endfor %}
[..]
> +exit
> +{% endfor %}
> +{% endfor %}