summaryrefslogtreecommitdiff
path: root/data/templates/load-balancing/override_haproxy.conf.j2
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2023-05-13 12:59:12 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2023-05-17 13:23:18 +0000
commit6d0325190fcede5b912c20cfb6ffefab90a3f4f4 (patch)
treed4cc3cd284044d644c4d268d53e8b0538ddd89d2 /data/templates/load-balancing/override_haproxy.conf.j2
parent25545b1e3cf2e94f3521e4ed80ce744f4b08683e (diff)
downloadvyos-1x-6d0325190fcede5b912c20cfb6ffefab90a3f4f4.tar.gz
vyos-1x-6d0325190fcede5b912c20cfb6ffefab90a3f4f4.zip
T5222: Add load-balancing for web traffic
Diffstat (limited to 'data/templates/load-balancing/override_haproxy.conf.j2')
-rw-r--r--data/templates/load-balancing/override_haproxy.conf.j214
1 files changed, 14 insertions, 0 deletions
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