pierky / arouteserver

A tool to automatically build (and test) feature-rich configurations for BGP route servers.
https://arouteserver.readthedocs.org/
GNU General Public License v3.0
284 stars 46 forks source link

Update general.py #118

Closed netfreak98 closed 11 months ago

netfreak98 commented 1 year ago

Adding the option of configuring deamon listen IPs via j2 template:

For example:

general.yml

cfg:
  rs_as: 6695
  router_id: 1.3.3.7
  rs_listen_v4: 172.31.206.157
  rs_listen_v6: 2001:db8::1a27:5051:ce9d

custom_templates/openbgpd/header.j2

AS {{ cfg.rs_as }}
router-id {{ cfg.router_id }}

## custom_templates/openbgpd/header.j2
listen on {% if cfg.rs_listen_v4 is current_ipver %} {{ cfg.rs_listen_v4 }} {% else %} {{ cfg.rs_listen_v6 }} {% endif +%}
socket "/run/bgpd-rs-ipv{{ ip_ver }}-sock.0"
netfreak98 commented 1 year ago

@pierky Hi, could you please provide an update on this or tell me how you intended a user to add custom config variables? :D Thanks! Joey

pierky commented 1 year ago

Hello @netfreak98,

sorry for the late feedback on this PR.

I'm a bit reluctant to introduce deployment-related options into the configuration of ARouteServer. That would open the scope of the tool quite a lot and with many potential ramifications into other deployment-specific knobs and settings.

The goal that you would achieve with the changes proposed in this PR is probably easily achievable via the generic handling of site-specific local files, which you can find documented here: https://arouteserver.readthedocs.io/en/latest/CONFIG.html#site-specific-custom-configuration-files

Would you mind checking whether that would work for you?