]> gitweb.fluxo.info Git - puppet-apache.git/commitdiff
Adding $apache_use_domain
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 7 Jan 2010 21:17:31 +0000 (19:17 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 7 Jan 2010 21:17:31 +0000 (19:17 -0200)
manifests/init.pp
templates/site.erb

index e921255b1dfda907a5eb128b614a44de2f967b3d..edd84a8faf6fd56b17481bfa572c43fe70699967 100644 (file)
@@ -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,
index 1d050d6d0e226cda1804fe2b7461a9102c2b0887..f75c81ad9aa1dd519cf269ee6d6ce648ae287f25 100644 (file)
@@ -1,9 +1,9 @@
 # begin vhost for <%= title %>
 <VirtualHost *:80>
-   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 %>