From 6d0325190fcede5b912c20cfb6ffefab90a3f4f4 Mon Sep 17 00:00:00 2001 From: Viacheslav Hletenko Date: Sat, 13 May 2023 12:59:12 +0000 Subject: T5222: Add load-balancing for web traffic --- data/templates/load-balancing/override_haproxy.conf.j2 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 data/templates/load-balancing/override_haproxy.conf.j2 (limited to 'data/templates/load-balancing/override_haproxy.conf.j2') diff --git a/data/templates/load-balancing/override_haproxy.conf.j2 b/data/templates/load-balancing/override_haproxy.conf.j2 new file mode 100644 index 000000000..395b5d279 --- /dev/null +++ b/data/templates/load-balancing/override_haproxy.conf.j2 @@ -0,0 +1,14 @@ +{% set haproxy_command = 'ip vrf exec ' ~ vrf ~ ' ' if vrf is vyos_defined else '' %} +[Unit] +StartLimitIntervalSec=0 +After=vyos-router.service +ConditionPathExists=/run/haproxy/haproxy.cfg + +[Service] +EnvironmentFile= +Environment= +Environment="CONFIG=/run/haproxy/haproxy.cfg" "PIDFILE=/run/haproxy.pid" "EXTRAOPTS=-S /run/haproxy-master.sock" +ExecStart= +ExecStart={{ haproxy_command }}/usr/sbin/haproxy -Ws -f /run/haproxy/haproxy.cfg -p /run/haproxy.pid -S /run/haproxy-master.sock +Restart=always +RestartSec=10 -- cgit v1.2.3