noha: Re-enable Horizon dashboard, fix CSS 74/69474/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 30 Dec 2019 15:12:14 +0000 (16:12 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Mon, 30 Dec 2019 17:59:28 +0000 (18:59 +0100)
- ha, noha: Fix misaligned python 3 requirement for Horizon:
  * python3-pylibmc
- ha, noha: Partially revert commit 63b712d:
  "[Horizon] Drop the obsolete Horizon workaround"
  Since we switched back from MCP Horizon package to UCA,
  fix misaligned expected static resources location.
- noha: Enable nginx proxy on ctl01 node for serving the Horizon
  dashboard at http://<cluster public VIP>:80 (http only, no SSL).

Change-Id: I5f930a5826a818791183d3910aa0e5607924e8f3
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/config/states/openstack_ha
mcp/config/states/openstack_noha
mcp/patches/salt-formula-horizon/0001-Support-stein-version.patch
mcp/patches/salt-formula-horizon/0002-Align-packages-with-Stein-reqs.patch [new file with mode: 0644]
mcp/reclass/classes/cluster/mcp-common-noha/openstack_control.yml.j2
mcp/reclass/classes/cluster/mcp-common-noha/openstack_init.yml.j2

index c28d0b4..4bea061 100755 (executable)
@@ -86,6 +86,13 @@ salt -I 'ceilometer:agent' state.sls ceilometer
 wait_for 3.0 "salt -I 'horizon:server' state.sls apache,horizon"
 salt -I 'nginx:server' state.sls nginx
 
+# Workaround Horizon missing CSS/JS, see FUEL-324
+if ! salt -C 'I@horizon:server and *01*' --out=yaml pkg.version openstack-dashboard | grep -qE ':.*mcp'; then
+  salt -I 'horizon:server' file.symlink \
+    /var/lib/openstack-dashboard/static \
+    /usr/share/openstack-dashboard/static
+fi
+
 cluster_public_host=$(salt -C 'I@nginx:server and *01*' --out=yaml \
   pillar.get _param:cluster_public_host | awk '{print $2; exit}')
 dashboard_host=$(salt -C 'I@nginx:server and *01*' --out=yaml cp.push \
index cb6059d..5022e6d 100755 (executable)
@@ -59,4 +59,11 @@ salt -I 'aodh:server' state.sls aodh
 salt -I 'ceilometer:server' state.sls ceilometer
 salt -I 'ceilometer:agent' state.sls ceilometer
 
-salt -I 'horizon:server' state.sls apache,horizon
+salt -I 'horizon:server' state.sls apache,horizon,nginx
+
+# Workaround Horizon missing CSS/JS, see FUEL-324
+if ! salt -C 'I@horizon:server and *01*' --out=yaml pkg.version openstack-dashboard | grep -qE ':.*mcp'; then
+  salt -I 'horizon:server' file.symlink \
+    /var/lib/openstack-dashboard/static \
+    /usr/share/openstack-dashboard/static
+fi
index 8c9aab9..3ae9363 100644 (file)
@@ -10,6 +10,13 @@ From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
 Date: Tue, 9 Jul 2019 14:54:50 +0400
 Subject: [PATCH] Support stein version
 
+---
+ horizon/files/local_settings/stein_settings.py | 1 +
+ horizon/files/policy/stein                     | 1 +
+ 2 files changed, 2 insertions(+)
+ create mode 120000 horizon/files/local_settings/stein_settings.py
+ create mode 120000 horizon/files/policy/stein
+
 diff --git a/horizon/files/local_settings/stein_settings.py b/horizon/files/local_settings/stein_settings.py
 new file mode 120000
 index 0000000..183e9a8
diff --git a/mcp/patches/salt-formula-horizon/0002-Align-packages-with-Stein-reqs.patch b/mcp/patches/salt-formula-horizon/0002-Align-packages-with-Stein-reqs.patch
new file mode 100644 (file)
index 0000000..90a0057
--- /dev/null
@@ -0,0 +1,30 @@
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+: Copyright (c) 2019 Mirantis Inc., Enea AB and others.
+:
+: All rights reserved. This program and the accompanying materials
+: are made available under the terms of the Apache License, Version 2.0
+: which accompanies this distribution, and is available at
+: http://www.apache.org/licenses/LICENSE-2.0
+::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+From: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+Date: Mon, 30 Dec 2019 16:15:04 +0100
+Subject: [PATCH] Align packages with Stein reqs
+
+Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
+---
+ horizon/map.jinja | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/horizon/map.jinja b/horizon/map.jinja
+index 3779d69..0cebe0c 100644
+--- a/horizon/map.jinja
++++ b/horizon/map.jinja
+@@ -6,7 +6,7 @@
+
+ {%- if not salt['pillar.get']('horizon:server:cache:backend') %}
+   {%- if salt['pillar.get']('horizon:server:version') not in ['mitaka','newton'] %}
+-    {%- set cache_pkgs = ['python-pylibmc'] %}
++    {%- set cache_pkgs = ['python3-pylibmc'] %}
+     {%- set default_cache_backend = 'django.core.cache.backends.memcached.PyLibMCCache' %}
+   {%- else %}
+     {% if grains['os_family'] == 'RedHat' %}
index 3d9dcf5..e383edd 100644 (file)
@@ -56,6 +56,8 @@ classes:
   - system.apache.server.site.barbican
   - system.apache.server.single
   - system.horizon.server.single
+  - system.nginx.server.single
+  - system.nginx.server.proxy.openstack_web
   - service.haproxy.proxy.single
 {%- if '-sfc-' in conf.MCP_DEPLOY_SCENARIO %}
   - system.keystone.client.service.tacker
@@ -238,3 +240,8 @@ parameters:
     server:
       env_variables:
         hostname: localhost
+  nginx:
+    server:
+      site:
+        nginx_ssl_redirect_openstack_web:
+          enabled: false
index 61f222c..3f3ff0a 100644 (file)
@@ -54,6 +54,12 @@ parameters:
     horizon_identity_host: ${_param:cluster_vip_address}
     horizon_identity_encryption: none
     horizon_identity_version: 3
+    horizon_public_protocol: http
+    horizon_public_port: 80
+    apache_mods_status_enabled: false
+    nginx_server_site_nginx_proxy_openstack_web_enabled: true
+    nginx_proxy_ssl:
+      enabled: false
 
     barbican_version: ${_param:openstack_version}
     barbican_service_host: ${_param:cluster_local_address}