summaryrefslogtreecommitdiff
path: root/data/templates/load-balancing/override_haproxy.conf.j2
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-05-17 18:46:07 +0200
committerGitHub <noreply@github.com>2023-05-17 18:46:07 +0200
commit9e9794a763e7e56a3a4c0001ea2b5bbc46bbb681 (patch)
treeea53b705e7cf44a391a0dbef1323f97b5d735f54 /data/templates/load-balancing/override_haproxy.conf.j2
parent0c91c356183bb33dea0b24c9ccd77b55c15e7ea0 (diff)
parent6d0325190fcede5b912c20cfb6ffefab90a3f4f4 (diff)
downloadvyos-1x-9e9794a763e7e56a3a4c0001ea2b5bbc46bbb681.tar.gz
vyos-1x-9e9794a763e7e56a3a4c0001ea2b5bbc46bbb681.zip
Merge pull request #2004 from sever-sever/T5222
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