From baf11a22fbf66ccd1cc95d60c3ea0c60a051decb Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Tue, 12 Dec 2023 10:51:07 +0100 Subject: [PATCH] Add httpchk option when httpcheck_options are defined In order for http-check to work, option httpchk must be loaded first. Otherwise regular L4 check will be issued and all `http-check` will be simply ignored. Closes-Bug: #2046223 Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/903545 Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/904303 Change-Id: Ie9ed322ab9c4a04d42cab4456567ac5d1f5c966b (cherry picked from commit 16ab20815f449703a94923a8613bf3577bef2833) --- templates/service.j2 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/templates/service.j2 b/templates/service.j2 index 69bec7a..f67df72 100644 --- a/templates/service.j2 +++ b/templates/service.j2 @@ -123,9 +123,12 @@ backend {{ service.haproxy_service_name }}-back {{ argument }} {% endfor %} {% set backend_httpcheck_options = service.haproxy_backend_httpcheck_options|default([]) %} +{% if backend_httpcheck_options %} + option httpchk {% for option in backend_httpcheck_options %} http-check {{ option }} {% endfor %} +{% endif %} {% for host_name in service.haproxy_backend_nodes %}