re-write how static vhosts with extra config work
authorPeter Palfrader <peter@palfrader.org>
Fri, 29 Jul 2016 17:35:46 +0000 (17:35 +0000)
committerPeter Palfrader <peter@palfrader.org>
Fri, 29 Jul 2016 17:35:46 +0000 (17:35 +0000)
modules/roles/templates/static-mirroring/static-vhost.conf.erb
modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb

index ad39851..e041357 100644 (file)
@@ -43,7 +43,7 @@
 </Macro>
 
 
-<Macro common-static-vhost-with-extra $name $extra>
+<Macro common-static-vhost-with-extra $name>
        <Virtualhost <%= vhost_listen %> >
                ServerName $name
                ServerAdmin debian-admin@lists.debian.org
                CustomLog /var/log/apache2/$name-access.log privacy
 
                Use common-static-base $name
-               $extra
+               Use vhost-$name-extra
        </VirtualHost>
 </Macro>
 
 <Macro common-static-vhost $name>
-       Use common-static-vhost-with-extra $name "# nada"
+       <Macro vhost-$name-extra>
+               # mod macro does not like empty macros, so here's some content:
+               <Directory /non-existant>
+               </Directory>
+       </Macro>
+       Use common-static-vhost-with-extra $name
 </Macro>
 
 
index 7b15f25..728c345 100644 (file)
 </Macro>
 <% end -%>
 
+<Macro vhost-network-test.debian.org-extra>
+       ServerAlias network-test-backend.debian.org
+</Macro>
 
 <%=
 
-def vhost(lines, sn, type=nil, extra=nil)
+def vhost(lines, sn, type=nil)
   if scope.function_has_static_component([sn])
     t = 'common-static-vhost'
     if type then t += "-#{type}"; end
 
-    e = ''
-    if extra then e += " #{extra}"; end
-
-    lines << "Use #{t} #{sn}#{e}"
+    lines << "Use #{t} #{sn}"
   end
 end
 
@@ -35,7 +35,7 @@ vhost(lines, "debdeltas.debian.net")
 vhost(lines, "news.debian.net"         , "ssl")
 vhost(lines, "debaday.debian.net"      , "ssl")
 vhost(lines, "timeline.debian.net"     , "ssl")
-vhost(lines, "network-test.debian.org" , "with-extra", '"ServerAlias network-test-backend.debian.org"')
+vhost(lines, "network-test.debian.org" , "with-extra")
 vhost(lines, "blends.debian.org"       , "ssl")
 vhost(lines, "wnpp-by-tags.debian.net" , "ssl")
 vhost(lines, "security-team.debian.org", "ssl")
@@ -57,7 +57,7 @@ vhost(lines, "es.debconf.org"      , "ssl")
 vhost(lines, "fr.debconf.org"      , "ssl")
 vhost(lines, "miniconf10.debconf.org" , "ssl")
 
-vhost(lines, "deb.debian.org", "with-extra", '"Use vhost-deb.debian.org-extra"')
+vhost(lines, "deb.debian.org", "with-extra")
 
 lines.join("\n")
 -%>