Skip to content
Snippets Groups Projects
Commit 2455a95f authored by Michal Arbet's avatar Michal Arbet
Browse files

Trivial but necessary fix - loadbalancer weight

Weight for haproxy backend was merged in [1] with
tiny bug, there is need to convert to int to check
conditional <= 256. Otherwise, it's not working as
expected.

[1] https://review.opendev.org/c/openstack/kolla-ansible/+/775627

Change-Id: Icb6f5147ebd2a0be52ba4ef6ba4a00bbd0242d3d
parent f1cbff6b
No related branches found
No related tags found
No related merge requests found
......@@ -95,7 +95,7 @@ backend {{ service_name }}_back
{% set host_ip = 'api' | kolla_address(host) %}
{% set service_weight = 'haproxy_' + service_name + '_weight' %}
{% set backend_weight_info = '' %}
{% if hostvars[host][service_weight] is defined and hostvars[host][service_weight] | int != 0 and hostvars[host][service_weight] <= 256 %}
{% if hostvars[host][service_weight] is defined and hostvars[host][service_weight] | int != 0 and hostvars[host][service_weight] | int <= 256 %}
{% set backend_weight_info = 'weight %s'|format(hostvars[host][service_weight]) %}
{% endif %}
server {{ host_name }} {{ host_ip }}:{{ listen_port }} {{ haproxy_health_check_final }} {{ backend_tls_info }} {{ backend_weight_info }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment