Align all web server usage on apache module.
Change-Id: Idd712a8ee5ec81c6b88b7d3e2270dce4da254927 Reviewed-on: https://review.openstack.org/10838 Approved: Monty Taylor <mordred@inaugust.com> Reviewed-by: Monty Taylor <mordred@inaugust.com> Tested-by: Jenkins
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Install and maintain Gerrit Code Review.
|
||||
# params:
|
||||
# virtual_hostname:
|
||||
# vhost_name:
|
||||
# used in the Apache virtual host, eg., review.example.com
|
||||
# canonicalweburl:
|
||||
# Used in the Gerrit config to generate links, eg., https://review.example.com/
|
||||
@@ -53,8 +53,9 @@
|
||||
# which can interfere with testing.
|
||||
# TODO: make more gerrit options configurable here
|
||||
|
||||
class gerrit($virtual_hostname=$fqdn,
|
||||
class gerrit($vhost_name=$fqdn,
|
||||
$canonicalweburl="https://$fqdn/",
|
||||
$serveradmin="webmaster@$fqdn",
|
||||
$ssl_cert_file='/etc/ssl/certs/ssl-cert-snakeoil.pem',
|
||||
$ssl_key_file='/etc/ssl/private/ssl-cert-snakeoil.key',
|
||||
$ssl_chain_file='',
|
||||
@@ -87,7 +88,6 @@ class gerrit($virtual_hostname=$fqdn,
|
||||
) {
|
||||
|
||||
include apache
|
||||
require apache::dev
|
||||
|
||||
$java_home = $lsbdistcodename ? {
|
||||
"precise" => "/usr/lib/jvm/java-6-openjdk-amd64/jre",
|
||||
@@ -248,7 +248,7 @@ class gerrit($virtual_hostname=$fqdn,
|
||||
|
||||
# Set up apache.
|
||||
|
||||
apache::vhost { $virtual_hostname:
|
||||
apache::vhost { $vhost_name:
|
||||
port => 443,
|
||||
docroot => 'MEANINGLESS ARGUMENT',
|
||||
priority => '50',
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
<VirtualHost *:80>
|
||||
<VirtualHost <%= scope.lookupvar("gerrit::vhost_name") %>:80>
|
||||
ServerAdmin <%= scope.lookupvar("gerrit::serveradmin") %>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/gerrit-error.log
|
||||
|
||||
LogLevel warn
|
||||
|
||||
CustomLog ${APACHE_LOG_DIR}/gerrit-access.log combined
|
||||
|
||||
Redirect / <%= scope.lookupvar("gerrit::canonicalweburl") %>
|
||||
Redirect / https://<%= scope.lookupvar("gerrit::vhost_name") %>/
|
||||
|
||||
</VirtualHost>
|
||||
|
||||
<IfModule mod_ssl.c>
|
||||
<VirtualHost _default_:443>
|
||||
ServerName <%= scope.lookupvar("gerrit::virtual_hostname") %>
|
||||
<VirtualHost <%= scope.lookupvar("gerrit::vhost_name") %>:443>
|
||||
ServerName <%= scope.lookupvar("gerrit::vhost_name") %>
|
||||
ServerAdmin <%= scope.lookupvar("gerrit::serveradmin") %>
|
||||
|
||||
ErrorLog ${APACHE_LOG_DIR}/gerrit-ssl-error.log
|
||||
|
||||
@@ -41,7 +44,7 @@
|
||||
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
|
||||
|
||||
RewriteEngine on
|
||||
RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("gerrit::virtual_hostname") %>
|
||||
RewriteCond %{HTTP_HOST} !<%= scope.lookupvar("gerrit::vhost_name") %>
|
||||
RewriteRule ^.*$ <%= scope.lookupvar("gerrit::canonicalweburl") %>
|
||||
<% if scope.lookupvar("gerrit::replicate_local") -%>
|
||||
RewriteCond %{REQUEST_URI} !^/p/
|
||||
|
||||
Reference in New Issue
Block a user