Merge branch 'master' of git+ssh://puppet.debian.org/srv/puppet.debian.org/git/dsa...
authorMartin Zobel-Helas <zobel@debian.org>
Thu, 13 Apr 2017 00:05:03 +0000 (02:05 +0200)
committerMartin Zobel-Helas <zobel@debian.org>
Thu, 13 Apr 2017 00:05:03 +0000 (02:05 +0200)
* 'master' of git+ssh://puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet:
  Use list of binds in apache config for syncproxies

modules/roles/templates/syncproxy/syncproxy.debian.org-apache.erb

index 6da98e6..eb59b0c 100644 (file)
@@ -3,20 +3,11 @@
 ## USE: git clone git+ssh://$USER@puppet.debian.org/srv/puppet.debian.org/git/dsa-puppet.git
 ##
 
-<%
-  vhost_listen = [ (@bind != '') ? "#{@bind}" : "*",  (@bind6 != '') ? "#{@bind6}" : "*"].uniq
-  vhost_listen_443 = [ (@bind != '') ? "#{@bind}:443" : "*:443",  (@bind6 != '') ? "[#{@bind6}]:443" : "*:443"].uniq
-%>
+<% @binds.each do |bind| -%>
+  Use common-debian-service-https-redirect "<%= bind %>" "<%= @syncproxy_name %>"
+<% end -%>
 
-<%=
-lines = []
-vhost_listen.each do |bind|
-   lines << "Use common-debian-service-https-redirect \"#{@bind}\" \"#{@syncproxy_name}\""
-end
-lines.join("\n")
-
-%>
-<Virtualhost <%= vhost_listen_443.join(' ') %> >
+<Virtualhost <%= @binds.map { |bind| "#{bind}:443" }.join(' ') %> >
    ServerName <%= @syncproxy_name %>
    DocumentRoot /srv/www/syncproxy.debian.org/htdocs