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/+/903488
Change-Id: Ie9ed322ab9c4a04d42cab4456567ac5d1f5c966b
This commit is contained in:
Dmitriy Rabotyagov 2023-12-12 10:51:07 +01:00 committed by Dmitriy Rabotyagov
parent 2cc2fceaf6
commit 16ab20815f
1 changed files with 3 additions and 0 deletions

View File

@ -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 %}