From 9c408e5af204cd3e3bdb86dae6ee691f48c1daa2 Mon Sep 17 00:00:00 2001 From: jayjahns Date: Mon, 24 Aug 2026 16:51:33 -0500 Subject: Update enable_letsencrypt to boolean validation Fixes the enable_letsencrypt to properly use boolean instead of a string. Currently breaks acme in its current state. Co-Authored-By: Bartosz Bezak Closes-bug: #2164956 Change-Id: Iae8770438ba63717030cc4ec8662f5ca0f6c9168 Signed-off-by: jayjahns@gmail.com Signed-off-by: Bartosz Bezak (cherry picked from commit e372288577a189d8798e326c3ff2bd104b4a84a0) --- .../templates/haproxy_single_service_split.cfg.j2 | 2 +- ansible/roles/horizon/defaults/main.yml | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'ansible') diff --git a/ansible/roles/haproxy-config/templates/haproxy_single_service_split.cfg.j2 b/ansible/roles/haproxy-config/templates/haproxy_single_service_split.cfg.j2 index 10498e033..bae946b77 100644 --- a/ansible/roles/haproxy-config/templates/haproxy_single_service_split.cfg.j2 +++ b/ansible/roles/haproxy-config/templates/haproxy_single_service_split.cfg.j2 @@ -50,7 +50,7 @@ frontend {{ service_name }}_front {{ "bind %s:%s %s" | e | format(vip_address, service_port, tls_option) | trim() }} {# Redirect mode sets a redirect scheme instead of a backend #} {% if service_mode == 'redirect' %} -{% if enable_letsencrypt == 'yes' %} +{% if enable_letsencrypt | bool %} redirect scheme https code 301 if !{ ssl_fc } !{ path_reg ^/.well-known/acme-challenge/.+ } {% else %} redirect scheme https code 301 if !{ ssl_fc } diff --git a/ansible/roles/horizon/defaults/main.yml b/ansible/roles/horizon/defaults/main.yml index 04cd14761..9d7b66e01 100644 --- a/ansible/roles/horizon/defaults/main.yml +++ b/ansible/roles/horizon/defaults/main.yml @@ -34,7 +34,7 @@ horizon_services: port: "{% if kolla_enable_tls_internal | bool %}{{ horizon_tls_port }}{% else %}{{ horizon_port }}{% endif %}" listen_port: "{{ horizon_listen_port }}" frontend_http_extra: - - "{% if enable_letsencrypt == 'yes' %}use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }{% endif %}" + - "{% if enable_letsencrypt | bool %}use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }{% endif %}" backend_http_extra: - "balance {{ 'roundrobin' if enable_memcached | bool or horizon_backend_database | bool else 'source' }}" - "option httpchk" @@ -46,7 +46,7 @@ horizon_services: port: "{{ horizon_port }}" listen_port: "{{ horizon_listen_port }}" frontend_redirect_extra: - - "{% if enable_letsencrypt == 'yes' %}use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }{% endif %}" + - "{% if enable_letsencrypt | bool %}use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }{% endif %}" horizon_external: enabled: "{{ enable_horizon }}" mode: "http" @@ -55,7 +55,7 @@ horizon_services: port: "{% if kolla_enable_tls_external | bool %}{{ horizon_tls_port }}{% else %}{{ horizon_port }}{% endif %}" listen_port: "{{ horizon_listen_port }}" frontend_http_extra: - - "{% if enable_letsencrypt == 'yes' %}use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }{% endif %}" + - "{% if enable_letsencrypt | bool %}use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }{% endif %}" backend_http_extra: - "balance {{ 'roundrobin' if enable_memcached | bool or horizon_backend_database | bool else 'source' }}" - "option httpchk" @@ -68,9 +68,9 @@ horizon_services: port: "{{ horizon_port }}" listen_port: "{{ horizon_listen_port }}" frontend_redirect_extra: - - "{% if enable_letsencrypt == 'yes' %}use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }{% endif %}" + - "{% if enable_letsencrypt | bool %}use_backend acme_client_back if { path_reg ^/.well-known/acme-challenge/.+ }{% endif %}" acme_client: - enabled: "{{ enable_letsencrypt }}" + enabled: "{{ enable_letsencrypt | bool }}" with_frontend: false custom_member_list: "{{ acme_client_servers }}" -- cgit v1.2.3