From 4c7d4bae08c818fbd0cbf3a05bfa8870189f72b3 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Fri, 29 Jul 2016 17:35:46 +0000 Subject: [PATCH] re-write how static vhosts with extra config work --- .../static-mirroring/static-vhost.conf.erb | 11 ++++++++--- .../vhost/static-vhosts-simple.erb | 14 +++++++------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/modules/roles/templates/static-mirroring/static-vhost.conf.erb b/modules/roles/templates/static-mirroring/static-vhost.conf.erb index ad39851f8..e0413572c 100644 --- a/modules/roles/templates/static-mirroring/static-vhost.conf.erb +++ b/modules/roles/templates/static-mirroring/static-vhost.conf.erb @@ -43,7 +43,7 @@ - + > ServerName $name ServerAdmin debian-admin@lists.debian.org @@ -52,12 +52,17 @@ CustomLog /var/log/apache2/$name-access.log privacy Use common-static-base $name - $extra + Use vhost-$name-extra - Use common-static-vhost-with-extra $name "# nada" + + # mod macro does not like empty macros, so here's some content: + + + + Use common-static-vhost-with-extra $name diff --git a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb index 7b15f2585..728c345ba 100644 --- a/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb +++ b/modules/roles/templates/static-mirroring/vhost/static-vhosts-simple.erb @@ -11,18 +11,18 @@ <% end -%> + + ServerAlias network-test-backend.debian.org + <%= -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") -%> -- 2.20.1