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

index edd84a8faf6fd56b17481bfa572c43fe70699967..cdd4d6e4483c855e3f344c652ee32127c225d2c1 100644 (file)
@@ -92,9 +92,8 @@ class apache {
     '': { $apache_error_dest = "${apache_error_folder}/index.html" }
   }
 
-  $use_domain = $apache_use_domain ? {
-    ''      => $domain,
-    default => $apache_use_domain,
+  case $apache_use_domain {
+    '' { $apache_use_domain = $domain }
   }
 
   define site($ensure = present, $docroot = false, $redirect = false,
index f75c81ad9aa1dd519cf269ee6d6ce648ae287f25..56cc9297579c0f8012afda68aece40cae71a3431 100644 (file)
@@ -1,9 +1,9 @@
 # begin vhost for <%= title %>
 <VirtualHost *:80>
-   ServerName <%= title %>.<%= use_domain %>
+   ServerName <%= title %>.<%= apache_use_domain %>
 <% if server_alias != false %>   ServerAlias <%= server_alias %><% end %>
    DocumentRoot <%= docroot %>
-<% if redirect_match != false %>   RedirectMatch ^/$ <%= protocol %>://<%= title %>.<%= use_domain %>/<%= redirect_match %><% end %>
+<% if redirect_match != false %>   RedirectMatch ^/$ <%= protocol %>://<%= title %>.<%= apache_use_domain %>/<%= redirect_match %><% end %>
 <% if redirect != false %>   Redirect <%= redirect %><% end %>
 <% if use != false %><% use.each do |instance| -%>
    Use <%= instance %>