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