From 4c6d777868e3b12e7fde9e1f29868c38277bfc6d Mon Sep 17 00:00:00 2001
From: Mark Goddard <mark@stackhpc.com>
Date: Tue, 21 Dec 2021 15:28:14 +0000
Subject: [PATCH] horizon: move horizon_enable_tls_backend to group_vars

This variable is referenced by horizon_listen_port, which becomes
undefined outside of the horizon role. One symptom of this is that
the hostvars variable becomes undefined when referenced for debugging
purposes.

This issue was introduced by Ibb5ad1a5d1bbc74bcb62610d77852d8124c4a323,
which has been backported to Victoria.

This change fixes the issue by moving horizon_enable_tls_backend to
group_vars.

TrivialFix

Change-Id: I1fc4e2a24fe096a49434d7e16851e63efd25d74c
---
 ansible/group_vars/all.yml              | 2 ++
 ansible/roles/horizon/defaults/main.yml | 5 -----
 2 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml
index f192562852..77e46ad677 100644
--- a/ansible/group_vars/all.yml
+++ b/ansible/group_vars/all.yml
@@ -1039,6 +1039,8 @@ enable_keystone_horizon_policy_file: "{{ enable_keystone }}"
 enable_neutron_horizon_policy_file: "{{ enable_neutron }}"
 enable_nova_horizon_policy_file: "{{ enable_nova }}"
 
+horizon_enable_tls_backend: "{{ kolla_enable_tls_backend }}"
+
 horizon_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ horizon_tls_port if kolla_enable_tls_internal | bool else horizon_port }}"
 horizon_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn | put_address_in_context('url') }}:{{ horizon_tls_port if kolla_enable_tls_external | bool else horizon_port }}"
 
diff --git a/ansible/roles/horizon/defaults/main.yml b/ansible/roles/horizon/defaults/main.yml
index 1cecac3afa..6a5c63a3ed 100644
--- a/ansible/roles/horizon/defaults/main.yml
+++ b/ansible/roles/horizon/defaults/main.yml
@@ -145,11 +145,6 @@ horizon_murano_dev_mode: "{{ kolla_dev_mode }}"
 horizon_source_version: "{{ kolla_source_version }}"
 horizon_murano_source_version: "{{ kolla_source_version }}"
 
-####################
-# TLS
-####################
-horizon_enable_tls_backend: "{{ kolla_enable_tls_backend }}"
-
 # This variable was created for administrators to define which one of the Keystone's URLs should be configured in Horizon.
 # In some cases, such as when using OIDC, horizon will need to be configured with Keystone's public URL.
 # Therefore, instead of overriding the whole "horizon_keystone_url", this change allows an easier integration because