From 4f96a58bb8e653a5126dbb6238a8033c716b67dc Mon Sep 17 00:00:00 2001 From: Dmitriy Rabotyagov Date: Fri, 15 Mar 2024 18:54:21 +0100 Subject: [PATCH] Add support for deploying Horizon with Skyline We change a default value of `horizon_webroot` to reflect the usecase where both Horizon and Skyline are deployed. When it is the case, horizon webroot URL will be changed to `/horizon`. Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/859446 Change-Id: Ia38311a6fde88292c090cf6289bf5b6c6279c479 --- defaults/main.yml | 4 +++- .../notes/horizon_webroot-ae22a11343c1fb1e.yaml | 11 +++++++++++ templates/openstack_dashboard.conf.j2 | 4 ++-- 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 releasenotes/notes/horizon_webroot-ae22a11343c1fb1e.yaml diff --git a/defaults/main.yml b/defaults/main.yml index 8b80ff28..74837f9f 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -426,7 +426,9 @@ horizon_custom_themes: {} # value is the theme_name from the vars above horizon_default_theme: "default" -horizon_webroot: / +# URI through which Horizon will be available. +# If Skyline is not deployed defaults to `/`, `/horizon` otherwise. +horizon_webroot: "{{ (groups['skyline_all'] | default([])) | ternary('/horizon', '/') }}" horizon_bind_address: "{{ openstack_service_bind_address | default('0.0.0.0') }}" diff --git a/releasenotes/notes/horizon_webroot-ae22a11343c1fb1e.yaml b/releasenotes/notes/horizon_webroot-ae22a11343c1fb1e.yaml new file mode 100644 index 00000000..971d07f4 --- /dev/null +++ b/releasenotes/notes/horizon_webroot-ae22a11343c1fb1e.yaml @@ -0,0 +1,11 @@ +--- +fixes: + - | + Change of ``horizon_webroot`` variable is now respected and will be + reflected in Apache configuration to serve static files and define + wsgi path accordingly. +features: + - | + Horizon is now co-installabe with Skyline dashboard. In case both + Horizon and Skyline are deployed, Horizon will be served by + `/horizon` URI. diff --git a/templates/openstack_dashboard.conf.j2 b/templates/openstack_dashboard.conf.j2 index 8ed5f8af..e8e912ee 100644 --- a/templates/openstack_dashboard.conf.j2 +++ b/templates/openstack_dashboard.conf.j2 @@ -48,7 +48,7 @@ Listen {{ horizon_bind_address }}:{{ horizon_listen_port }} RequestHeader set {{ horizon_secure_proxy_ssl_header }} "http" {% endif %} - WSGIScriptAlias / {{ horizon_lib_wsgi_file }} + WSGIScriptAlias {{ horizon_webroot }} {{ horizon_lib_wsgi_file }} WSGIDaemonProcess horizon user={{ horizon_system_user_name }} group={{ horizon_system_group_name }} processes={{ horizon_wsgi_processes | default(horizon_wsgi_threads) }} threads={{ horizon_wsgi_threads }} python-path={{ horizon_lib_dir | dirname }}/site-packages WSGIProcessGroup horizon @@ -66,7 +66,7 @@ Listen {{ horizon_bind_address }}:{{ horizon_listen_port }} - Alias /static {{ horizon_lib_dir }}/static/ + Alias {{ horizon_webroot }}/static {{ horizon_lib_dir }}/static/ Options -FollowSymlinks