Host a devstack.org redirect on static

This provides a hollow "devstack.org" vhost as a permanent redirect
to the docs.openstack.org/developer/devstack site. It also aliases
*.devstack.org to the same vhost.

Change-Id: Ib96e4d4e21bbdd961eb32529c66acf750d79bec5
This commit is contained in:
Jeremy Stanley 2014-10-21 18:41:14 +00:00
parent aace25f971
commit af6add3361
2 changed files with 32 additions and 0 deletions

View File

@ -243,4 +243,15 @@ class openstack_project::static (
require => [File['/srv/static/specs'],
$::project_config::config_dir],
}
###########################################################
# legacy devstack.org site redirect
apache::vhost { 'devstack.org':
port => 80,
priority => '50',
docroot => 'MEANINGLESS_ARGUMENT',
serveraliases => ['*.devstack.org'],
template => 'openstack_project/devstack.vhost.erb',
}
}

View File

@ -0,0 +1,21 @@
# ************************************
# Managed by Puppet
# ************************************
NameVirtualHost <%= @vhost_name %>:<%= @port %>
<VirtualHost <%= @vhost_name %>:<%= @port %>>
ServerName <%= @srvname %>
<% if @serveraliases.is_a? Array -%>
<% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
<% elsif @serveraliases != '' -%>
<%= " ServerAlias #{@serveraliases}" %>
<% end -%>
RewriteEngine On
RewriteRule ^/(.*) http://docs.openstack.org/developer/devstack/$1 [last,redirect=permanent]
ErrorLog /var/log/apache2/<%= @name %>_error.log
LogLevel warn
CustomLog /var/log/apache2/<%= @name %>_access.log combined
ServerSignature Off
</VirtualHost>