diff options
author | Viacheslav Hletenko <v.gletenko@vyos.io> | 2023-01-04 10:51:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-04 10:51:51 +0200 |
commit | f5af95be4f66380d213771b975c63361e27616ef (patch) | |
tree | 49c9eb0eb50aa33fda890a7b770a60e35a761f33 /data | |
parent | 6c78e460861419aa7a05a47ee779aaddd37cd14a (diff) | |
parent | 49234912119c224bf4c28df5573937668d03e651 (diff) | |
download | vyos-1x-f5af95be4f66380d213771b975c63361e27616ef.tar.gz vyos-1x-f5af95be4f66380d213771b975c63361e27616ef.zip |
Merge pull request #1735 from sever-sever/T4904
T4904: keepalived virtual-server allow multiple ports with fwmark
Diffstat (limited to 'data')
-rw-r--r-- | data/templates/high-availability/keepalived.conf.j2 | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/data/templates/high-availability/keepalived.conf.j2 b/data/templates/high-availability/keepalived.conf.j2 index 706e1c5ae..ebff52e1f 100644 --- a/data/templates/high-availability/keepalived.conf.j2 +++ b/data/templates/high-availability/keepalived.conf.j2 @@ -126,7 +126,12 @@ vrrp_sync_group {{ name }} { {% if virtual_server is vyos_defined %} # Virtual-server configuration {% for vserver, vserver_config in virtual_server.items() %} +# Vserver {{ vserver }} +{% if vserver_config.port is vyos_defined %} virtual_server {{ vserver }} {{ vserver_config.port }} { +{% else %} +virtual_server fwmark {{ vserver_config.fwmark }} { +{% endif %} delay_loop {{ vserver_config.delay_loop }} {% if vserver_config.algorithm is vyos_defined('round-robin') %} lb_algo rr @@ -156,9 +161,14 @@ virtual_server {{ vserver }} {{ vserver_config.port }} { {% for rserver, rserver_config in vserver_config.real_server.items() %} real_server {{ rserver }} {{ rserver_config.port }} { weight 1 +{% if rserver_config.health_check.script is vyos_defined %} + MISC_CHECK { + misc_path {{ rserver_config.health_check.script }} +{% else %} {{ vserver_config.protocol | upper }}_CHECK { -{% if rserver_config.connection_timeout is vyos_defined %} +{% if rserver_config.connection_timeout is vyos_defined %} connect_timeout {{ rserver_config.connection_timeout }} +{% endif %} {% endif %} } } |