Add serveraliases to cgit vhost template
Allow for specifying ServerAlias entries in the apache vhost for the cgit puppet module. (vhost template section lifted from the puppetlabs-apache v0.0.4 vhost-default template). Change-Id: If7c297247b9556458154e4d01a1e0165a25a14b5
This commit is contained in:
parent
dc8b2ae79f
commit
e39b5ce777
@ -17,6 +17,7 @@
|
|||||||
class cgit(
|
class cgit(
|
||||||
$vhost_name = $::fqdn,
|
$vhost_name = $::fqdn,
|
||||||
$serveradmin = "webmaster@${::fqdn}",
|
$serveradmin = "webmaster@${::fqdn}",
|
||||||
|
$serveraliases = '',
|
||||||
$cgitdir = '/var/www/cgit',
|
$cgitdir = '/var/www/cgit',
|
||||||
$staticfiles = '/var/www/cgit/static',
|
$staticfiles = '/var/www/cgit/static',
|
||||||
$ssl_cert_file = '',
|
$ssl_cert_file = '',
|
||||||
@ -116,12 +117,13 @@ class cgit(
|
|||||||
}
|
}
|
||||||
|
|
||||||
apache::vhost { $vhost_name:
|
apache::vhost { $vhost_name:
|
||||||
port => $https_port,
|
port => $https_port,
|
||||||
docroot => 'MEANINGLESS ARGUMENT',
|
serveraliases => $serveraliases,
|
||||||
priority => '50',
|
docroot => 'MEANINGLESS ARGUMENT',
|
||||||
template => 'cgit/git.vhost.erb',
|
priority => '50',
|
||||||
ssl => true,
|
template => 'cgit/git.vhost.erb',
|
||||||
require => [
|
ssl => true,
|
||||||
|
require => [
|
||||||
File[$staticfiles],
|
File[$staticfiles],
|
||||||
Package['cgit'],
|
Package['cgit'],
|
||||||
],
|
],
|
||||||
|
@ -2,6 +2,12 @@
|
|||||||
ServerName <%= scope.lookupvar("cgit::vhost_name") %>
|
ServerName <%= scope.lookupvar("cgit::vhost_name") %>
|
||||||
ServerAdmin <%= scope.lookupvar("cgit::serveradmin") %>
|
ServerAdmin <%= scope.lookupvar("cgit::serveradmin") %>
|
||||||
|
|
||||||
|
<% if serveraliases.is_a? Array -%>
|
||||||
|
<% serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
||||||
|
<% elsif serveraliases != '' -%>
|
||||||
|
<%= " ServerAlias #{serveraliases}" -%>
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
Alias /cgit-data /usr/share/cgit
|
Alias /cgit-data /usr/share/cgit
|
||||||
ScriptAlias /cgit /var/www/cgi-bin/cgit
|
ScriptAlias /cgit /var/www/cgi-bin/cgit
|
||||||
Alias /static <%= scope.lookupvar("cgit::staticfiles") %>
|
Alias /static <%= scope.lookupvar("cgit::staticfiles") %>
|
||||||
@ -27,6 +33,12 @@
|
|||||||
ServerName <%= scope.lookupvar("cgit::vhost_name") %>
|
ServerName <%= scope.lookupvar("cgit::vhost_name") %>
|
||||||
ServerAdmin <%= scope.lookupvar("cgit::serveradmin") %>
|
ServerAdmin <%= scope.lookupvar("cgit::serveradmin") %>
|
||||||
|
|
||||||
|
<% if serveraliases.is_a? Array -%>
|
||||||
|
<% serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%>
|
||||||
|
<% elsif serveraliases != '' -%>
|
||||||
|
<%= " ServerAlias #{serveraliases}" -%>
|
||||||
|
<% end -%>
|
||||||
|
|
||||||
Alias /cgit-data /usr/share/cgit
|
Alias /cgit-data /usr/share/cgit
|
||||||
ScriptAlias /cgit /var/www/cgi-bin/cgit
|
ScriptAlias /cgit /var/www/cgi-bin/cgit
|
||||||
Alias /static <%= scope.lookupvar("cgit::staticfiles") %>
|
Alias /static <%= scope.lookupvar("cgit::staticfiles") %>
|
||||||
|
Loading…
Reference in New Issue
Block a user