From 802e9a13898c6b9676edfbfb8fab53404d2a7f06 Mon Sep 17 00:00:00 2001 From: Patrik Lundin Date: Thu, 10 Oct 2024 15:45:58 +0200 Subject: [PATCH] Fix erb iteration --- .../puppet/modules/cdn/templates/cache/haproxy.cfg.erb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/global/overlay/etc/puppet/modules/cdn/templates/cache/haproxy.cfg.erb b/global/overlay/etc/puppet/modules/cdn/templates/cache/haproxy.cfg.erb index 7952362..7822d49 100644 --- a/global/overlay/etc/puppet/modules/cdn/templates/cache/haproxy.cfg.erb +++ b/global/overlay/etc/puppet/modules/cdn/templates/cache/haproxy.cfg.erb @@ -43,8 +43,8 @@ listen haproxy_https bind /shared/haproxy_https accept-proxy mode 640 stick-table type ip size 100 stick on dst -<% @cache_secrets['customers'][@customer]['origins'].each do |index, origin_ip| -%> - server s<%= index %> <%= origin_ip %>:443 ssl ca-file /etc/ssl/certs/ca-certificates.crt alpn http/1.1 sni fc_pp_authority +<% @cache_secrets['customers'][@customer]['origins'].each_with_index do |origin, index| -%> + server s<%= index %> <%= origin %>:443 ssl ca-file /etc/ssl/certs/ca-certificates.crt alpn http/1.1 sni fc_pp_authority <% end -%> # While varnish could recach out to HTTP backends itself, lets stick to one @@ -56,6 +56,6 @@ listen haproxy_http bind /shared/haproxy_http accept-proxy mode 640 stick-table type ip size 100 stick on dst -<% @cache_secrets['customers'][@customer]['origins'].each do |index, origin_ip| -%> - server s<%= index %> <%= origin_ip %>:80 +<% @cache_secrets['customers'][@customer]['origins'].each_with_index do |origin, index| -%> + server s<%= index %> <%= origin %>:80 <% end -%>