Viktor Michalek 78aab26295 Haproxy: fix haproxy_cmd for Debian
Change-Id: I097082112b857444c3e2f73896be5832a776743b
2019-10-03 04:33:22 -07:00

11 lines
582 B
Django/Jinja

#!/bin/bash -x
{% set haproxy_cmd='/usr/sbin/haproxy -W -db' if kolla_base_distro in ['debian', 'ubuntu'] else '/usr/sbin/haproxy-systemd-wrapper' %}
# We need to run haproxy with one `-f` for each service, because including an
# entire config directory was not a feature until version 1.7 of HAProxy.
# So, append "-f $cfg" to the haproxy command for each service file.
# This will run haproxy_cmd *exactly once*.
find /etc/haproxy/services.d/ -mindepth 1 -print0 | \
xargs -0 -Icfg echo -f cfg | \
xargs {{ haproxy_cmd }} -p /run/haproxy.pid -f /etc/haproxy/haproxy.cfg