From: Silvio Rhatto Date: Thu, 7 Jan 2010 21:17:31 +0000 (-0200) Subject: Adding $apache_use_domain X-Git-Url: https://gitweb.fluxo.info/?a=commitdiff_plain;h=b936755f402e7be72d00d5ccb618c222fbea23fc;p=puppet-apache.git Adding $apache_use_domain --- diff --git a/manifests/init.pp b/manifests/init.pp index e921255..edd84a8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -92,6 +92,11 @@ class apache { '': { $apache_error_dest = "${apache_error_folder}/index.html" } } + $use_domain = $apache_use_domain ? { + '' => $domain, + default => $apache_use_domain, + } + define site($ensure = present, $docroot = false, $redirect = false, $redirect_match = false, $protocol = 'http', $server_alias = false, $use = false, $ticket = false, diff --git a/templates/site.erb b/templates/site.erb index 1d050d6..f75c81a 100644 --- a/templates/site.erb +++ b/templates/site.erb @@ -1,9 +1,9 @@ # begin vhost for <%= title %> - ServerName <%= title %>.<%= domain %> + ServerName <%= title %>.<%= use_domain %> <% if server_alias != false %> ServerAlias <%= server_alias %><% end %> DocumentRoot <%= docroot %> -<% if redirect_match != false %> RedirectMatch ^/$ <%= protocol %>://<%= title %>.<%= domain %>/<%= redirect_match %><% end %> +<% if redirect_match != false %> RedirectMatch ^/$ <%= protocol %>://<%= title %>.<%= use_domain %>/<%= redirect_match %><% end %> <% if redirect != false %> Redirect <%= redirect %><% end %> <% if use != false %><% use.each do |instance| -%> Use <%= instance %>