Fix http-check ordering for services

Despite not being documented, order of http-check options are important

Defining `expect` before `check` leads to configuration error. In order to
avoid that we fix some defenitions of haproxy_services variable.

Related-Bug: #2046223

Needed-By: https://review.opendev.org/c/openstack/openstack-ansible-haproxy_server/+/903463
Change-Id: I6153e1ba5a4c45e2ed78d69da73e6524e3911db0
This commit is contained in:
Dmitriy Rabotyagov 2023-12-12 12:19:48 +01:00 committed by Dmitriy Rabotyagov
parent fd4e041608
commit 6a276938e7
4 changed files with 4 additions and 6 deletions

View File

@ -22,7 +22,6 @@ haproxy_blazar_api_service:
haproxy_balance_type: http
haproxy_backend_httpcheck_options:
- 'send hdr User-Agent "osa-haproxy-healthcheck" meth HEAD'
haproxy_backend_httpcheck_options:
- 'expect rstatus (200|401)'
haproxy_backend_ssl: "{{ blazar_backend_ssl | default(openstack_service_backend_ssl) }}"
haproxy_backend_ca: "{{ openstack_haproxy_backend_ca | default(True) }}"

View File

@ -22,7 +22,6 @@ haproxy_murano_service:
haproxy_balance_type: http
haproxy_backend_httpcheck_options:
- 'send hdr User-Agent "osa-haproxy-healthcheck" meth GET'
haproxy_backend_httpcheck_options:
- "expect status 401"
haproxy_backend_ssl: "{{ murano_backend_ssl | default(openstack_service_backend_ssl) }}"
haproxy_backend_ca: "{{ murano_haproxy_backend_ca | default(openstack_haproxy_backend_ca) }}"

View File

@ -66,7 +66,7 @@ haproxy_nova_spice_console_service:
haproxy_timeout_client: 60m
haproxy_timeout_server: 60m
haproxy_balance_alg: source
haproxy_backend_httpcheck_options: "{{ haproxy_nova_console_http_mode | ternary(['expect status 200', 'send ' ~ haproxy_nova_healthcheck_hdr ~ 'meth HEAD uri /spice_auto.html'], []) }}"
haproxy_backend_httpcheck_options: "{{ haproxy_nova_console_http_mode | ternary(['send ' ~ haproxy_nova_healthcheck_hdr ~ 'meth HEAD uri /spice_auto.html', 'expect status 200'], []) }}"
haproxy_backend_ssl: "{{ nova_backend_ssl | default(openstack_service_backend_ssl) }}"
haproxy_backend_ca: "{{ nova_haproxy_backend_ca | default(openstack_haproxy_backend_ca) }}"
haproxy_accept_both_protocols: "{{ nova_accept_both_protocols | default(openstack_service_accept_both_protocols) }}"
@ -82,7 +82,7 @@ haproxy_nova_serial_console_service:
haproxy_timeout_client: 60m
haproxy_timeout_server: 60m
haproxy_balance_alg: source
haproxy_backend_httpcheck_options: "{{ haproxy_nova_console_http_mode | ternary(['expect status 405', 'send ' ~ haproxy_nova_healthcheck_hdr ~ ' meth HEAD'], []) }}"
haproxy_backend_httpcheck_options: "{{ haproxy_nova_console_http_mode | ternary(['send ' ~ haproxy_nova_healthcheck_hdr ~ ' meth HEAD', 'expect status 405'], []) }}"
haproxy_backend_ssl: "{{ nova_backend_ssl | default(openstack_service_backend_ssl) }}"
haproxy_backend_ca: "{{ nova_haproxy_backend_ca | default(openstack_haproxy_backend_ca) }}"
haproxy_accept_both_protocols: "{{ nova_accept_both_protocols | default(openstack_service_accept_both_protocols) }}"
@ -99,7 +99,7 @@ haproxy_nova_novnc_console_service:
haproxy_timeout_client: 60m
haproxy_timeout_server: 60m
haproxy_balance_alg: source
haproxy_backend_httpcheck_options: "{{ haproxy_nova_console_http_mode | ternary(['expect status 200', 'send ' ~ haproxy_nova_healthcheck_hdr ~ ' meth HEAD uri /vnc.html'], []) }}"
haproxy_backend_httpcheck_options: "{{ haproxy_nova_console_http_mode | ternary(['send ' ~ haproxy_nova_healthcheck_hdr ~ ' meth HEAD uri /vnc.html', 'expect status 200'], []) }}"
haproxy_backend_ssl: "{{ nova_backend_ssl | default(openstack_service_backend_ssl) }}"
haproxy_backend_ca: "{{ nova_haproxy_backend_ca | default(openstack_haproxy_backend_ca) }}"
haproxy_accept_both_protocols: "{{ nova_accept_both_protocols | default(openstack_service_accept_both_protocols) }}"

View File

@ -37,8 +37,8 @@ haproxy_zun_console_service:
haproxy_timeout_server: 60m
haproxy_balance_alg: source
haproxy_backend_httpcheck_options:
- "expect status 405"
- 'send hdr User-Agent "osa-haproxy-healthcheck" meth HEAD'
- "expect status 405"
# haproxy_backend_ssl disabled due to: https://bugs.launchpad.net/zun/+bug/2016917
haproxy_backend_ssl: False