From b0d9b99f708ef7667b36c774a517b0a2c20822c3 Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 7 Jun 2024 17:44:43 +0200 Subject: [PATCH] Implement ability to define arbitrary options in local_settings.py Unfortunatelly having `horizon_config_overrides` is not sufficient, as not all options can be defined in HORIZON_CONFIG. Some are expected to be preset inside local_settings themselves. We introduce new variable that can be used to extend local_settings file with arbitrary parameters. Change-Id: Ic119105189c9158aa3b38c4deb07040110d9d660 --- defaults/main.yml | 1 + .../horizon_extend_local_settings-9e062b515de94b24.yaml | 7 +++++++ templates/horizon_local_settings.py.j2 | 4 ++++ 3 files changed, 12 insertions(+) create mode 100644 releasenotes/notes/horizon_extend_local_settings-9e062b515de94b24.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 66656c84..eaafea5a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -499,6 +499,7 @@ horizon_translations_pull: "{{ _horizon_translations_pull }}" # Set arbitrary horizon configuration options horizon_config_overrides: {} +horizon_extra_local_settings: {} # Set overrides for horizon embedded policies # horizon_policy_overrides: diff --git a/releasenotes/notes/horizon_extend_local_settings-9e062b515de94b24.yaml b/releasenotes/notes/horizon_extend_local_settings-9e062b515de94b24.yaml new file mode 100644 index 00000000..29c2d7b4 --- /dev/null +++ b/releasenotes/notes/horizon_extend_local_settings-9e062b515de94b24.yaml @@ -0,0 +1,7 @@ +--- +features: + - | + Implemented variable ``horizon_extra_local_settings`` that allows to + insert arbitrary parameters defined as a regular mapping inside + local_settings.py of Horizon. Parameters will be inserted at the end of + the config file. diff --git a/templates/horizon_local_settings.py.j2 b/templates/horizon_local_settings.py.j2 index 904f1264..72467c87 100644 --- a/templates/horizon_local_settings.py.j2 +++ b/templates/horizon_local_settings.py.j2 @@ -842,6 +842,10 @@ DEFAULT_THEME = '{{ horizon_default_theme }}' # Set arbitrary horizon configuration options HORIZON_CONFIG.update({{ horizon_config_overrides }}) +{% for key, value in horizon_extra_local_settings.items() %} +{{ key }} = {{ value }} +{% endfor %} + OPENSTACK_KEYSTONE_ADMIN_ROLES = [ {% for item in horizon_keystone_admin_roles %} '{{ item }}',