Andrew Bogott has submitted this change and it was merged.

Change subject: Move horizon apache config into a vhost
......................................................................


Move horizon apache config into a vhost

Previously this was configured via a global apache config, which is weird.

Change-Id: I6ace37f9de5153af5e25ec62d6398547f4b84735
---
M modules/openstack/manifests/horizon/service.pp
A modules/openstack/templates/kilo/horizon/horizon.wikimedia.org.erb
D modules/openstack/templates/kilo/horizon/openstack-dashboard.conf.erb
3 files changed, 34 insertions(+), 22 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/openstack/manifests/horizon/service.pp 
b/modules/openstack/manifests/horizon/service.pp
index fda5dd2..8f6d4ac 100644
--- a/modules/openstack/manifests/horizon/service.pp
+++ b/modules/openstack/manifests/horizon/service.pp
@@ -1,7 +1,8 @@
 # The OpenStack Dashboard Project
 # http://docs.openstack.org/developer/horizon/
 class openstack::horizon::service(
-    $openstack_version=$::openstack::version,
+    $openstack_version  = $::openstack::version,
+    $webserver_hostname = 'horizon.wikimedia.org',
     $novaconfig)
 {
     # basic horizon packages and config
@@ -84,8 +85,8 @@
         mode    => '0444',
     }
 
-    apache::conf { 'horizon':
-        content => 
template("openstack/${$openstack_version}/horizon/openstack-dashboard.conf.erb"),
+    apache::site { $webserver_hostname:
+        content => 
template("openstack/${$openstack_version}/horizon/${webserver_hostname}.erb"),
         require => File['/etc/openstack-dashboard/local_settings.py'],
     }
 }
diff --git a/modules/openstack/templates/kilo/horizon/horizon.wikimedia.org.erb 
b/modules/openstack/templates/kilo/horizon/horizon.wikimedia.org.erb
new file mode 100644
index 0000000..9041950
--- /dev/null
+++ b/modules/openstack/templates/kilo/horizon/horizon.wikimedia.org.erb
@@ -0,0 +1,30 @@
+#####################################################################
+### THIS FILE IS MANAGED BY PUPPET
+### puppet:///openstack/horizon.wikimedia.org
+#####################################################################
+# vim: filetype=apache
+
+# This config is behind misc-web which handles ssl for us.
+<VirtualHost *:80>
+    ServerName <%= @webserver_hostname %>
+
+    RewriteEngine on
+    RewriteCond %{HTTP:X-Forwarded-Proto} !https
+    RewriteCond %{REQUEST_URI} !^/status$
+    RewriteRule ^/(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} 
[R=301,E=ProtoRedirect]
+    Header always merge Vary X-Forwarded-Proto env=ProtoRedirect
+
+    WSGIScriptAlias / 
/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
+    WSGIDaemonProcess horizon user=horizon group=horizon processes=3 threads=10
+    WSGIProcessGroup horizon
+    Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static/
+    <Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi>
+      <IfVersion >= 2.4>
+        Require all granted
+      </IfVersion>
+      <IfVersion < 2.4>
+        Order allow,deny
+        Allow from all
+      </IfVersion>
+    </Directory>
+</VirtualHost>
diff --git 
a/modules/openstack/templates/kilo/horizon/openstack-dashboard.conf.erb 
b/modules/openstack/templates/kilo/horizon/openstack-dashboard.conf.erb
deleted file mode 100644
index 40cf126..0000000
--- a/modules/openstack/templates/kilo/horizon/openstack-dashboard.conf.erb
+++ /dev/null
@@ -1,19 +0,0 @@
-RewriteEngine on
-RewriteCond %{HTTP:X-Forwarded-Proto} !https
-RewriteCond %{REQUEST_URI} !^/status$
-RewriteRule ^/(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,E=ProtoRedirect]
-Header always merge Vary X-Forwarded-Proto env=ProtoRedirect
-
-WSGIScriptAlias / 
/usr/share/openstack-dashboard/openstack_dashboard/wsgi/django.wsgi
-WSGIDaemonProcess horizon user=horizon group=horizon processes=3 threads=10
-WSGIProcessGroup horizon
-Alias /static /usr/share/openstack-dashboard/openstack_dashboard/static/
-<Directory /usr/share/openstack-dashboard/openstack_dashboard/wsgi>
-  <IfVersion >= 2.4>
-    Require all granted
-  </IfVersion>
-  <IfVersion < 2.4>
-    Order allow,deny
-    Allow from all
-  </IfVersion>
-</Directory>

-- 
To view, visit https://gerrit.wikimedia.org/r/270753
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6ace37f9de5153af5e25ec62d6398547f4b84735
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Andrew Bogott <[email protected]>
Gerrit-Reviewer: Alex Monk <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to