Merge "[baremetal] cleanup: rm cloud-init iface config"
[fuel.git] / mcp / config / states / openstack_ha
index 0bbf7cd..404c89c 100755 (executable)
@@ -65,21 +65,25 @@ salt -I 'ceilometer:agent' state.sls ceilometer
 salt -I 'horizon:server' state.sls horizon
 salt -I 'nginx:server' state.sls nginx,sphinx
 
-# workaround for the pike horizon is missing css, FUEL-324
-salt -I 'horizon:server' file.symlink \
-  /var/lib/openstack-dashboard/static \
-  /usr/share/openstack-dashboard/static
-salt -I 'horizon:server' cmd.run "/usr/share/openstack-dashboard/manage.py collectstatic --noinput"
-salt -I 'horizon:server' cmd.run "/usr/share/openstack-dashboard/manage.py compress --force"
-salt -I 'horizon:server' file.append /etc/openstack-dashboard/local_settings.py \
- "AVAILABLE_THEMES = [ ('default', 'Default', 'themes/default'),]"
-salt -I 'horizon:server' service.reload apache2
-
-clstr_vip_addr=$(salt -C 'I@nginx:server and *01*' --out=yaml \
-  pillar.get _param:cluster_vip_address | awk '{print $2; exit}')
-salt -C 'I@nginx:server and *01*' cp.push \
-  "/etc/ssl/certs/${clstr_vip_addr}-with-chain.crt" upload_path='certs/os_cacert'
-cd /etc/ssl/certs && ln -sf /var/cache/salt/master/minions/prx01.*/files/certs/os_cacert
+# workaround for Ubuntu Pike Horizon missing css, 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
+  salt -I 'horizon:server' cmd.run "/usr/share/openstack-dashboard/manage.py collectstatic --noinput"
+  salt -I 'horizon:server' cmd.run "/usr/share/openstack-dashboard/manage.py compress --force"
+  salt -I 'horizon:server' file.append /etc/openstack-dashboard/local_settings.py \
+   "AVAILABLE_THEMES = [ ('default', 'Default', 'themes/default'),]"
+  salt -I 'horizon:server' service.reload apache2
+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 \
+  "/etc/ssl/certs/${cluster_public_host}-with-chain.crt" \
+  upload_path='certs/os_cacert' | cut -d':' -f1)
+cd /etc/ssl/certs && \
+  ln -sf "/var/cache/salt/master/minions/${dashboard_host}/files/certs/os_cacert"
 
 # glance v1 api is required by orchestra tests
 salt -I 'glance:server' ini.set_option /etc/glance/glance-api.conf '{DEFAULT: {enable_v1_api: True}}'