diff --git a/modules/cgit/manifests/init.pp b/modules/cgit/manifests/init.pp index ef16d8f1c0..333f5e73e2 100644 --- a/modules/cgit/manifests/init.pp +++ b/modules/cgit/manifests/init.pp @@ -17,6 +17,7 @@ class cgit( $vhost_name = $::fqdn, $serveradmin = "webmaster@${::fqdn}", + $serveraliases = '', $cgitdir = '/var/www/cgit', $staticfiles = '/var/www/cgit/static', $ssl_cert_file = '', @@ -116,12 +117,13 @@ class cgit( } apache::vhost { $vhost_name: - port => $https_port, - docroot => 'MEANINGLESS ARGUMENT', - priority => '50', - template => 'cgit/git.vhost.erb', - ssl => true, - require => [ + port => $https_port, + serveraliases => $serveraliases, + docroot => 'MEANINGLESS ARGUMENT', + priority => '50', + template => 'cgit/git.vhost.erb', + ssl => true, + require => [ File[$staticfiles], Package['cgit'], ], diff --git a/modules/cgit/templates/git.vhost.erb b/modules/cgit/templates/git.vhost.erb index 6a1a46d9ba..9bda1f842f 100644 --- a/modules/cgit/templates/git.vhost.erb +++ b/modules/cgit/templates/git.vhost.erb @@ -2,6 +2,12 @@ ServerName <%= scope.lookupvar("cgit::vhost_name") %> 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 ScriptAlias /cgit /var/www/cgi-bin/cgit Alias /static <%= scope.lookupvar("cgit::staticfiles") %> @@ -27,6 +33,12 @@ ServerName <%= scope.lookupvar("cgit::vhost_name") %> 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 ScriptAlias /cgit /var/www/cgi-bin/cgit Alias /static <%= scope.lookupvar("cgit::staticfiles") %>