]> git.openstreetmap.org Git - chef.git/commitdiff
Add brackets around IPv6 resolver addresses
authorTom Hughes <tom@compton.nu>
Wed, 14 Aug 2024 10:40:35 +0000 (11:40 +0100)
committerTom Hughes <tom@compton.nu>
Wed, 14 Aug 2024 10:40:35 +0000 (11:40 +0100)
cookbooks/community/recipes/default.rb
cookbooks/community/templates/default/web_only.yml.erb

index 224cb975daf7d35b6103b459cd59e12ca25a71da..fdf9379800071b688a2fabb52ed301ed1f94e63f 100644 (file)
@@ -81,13 +81,17 @@ template "/srv/community.openstreetmap.org/docker/containers/data.yml" do
   notifies :run, "notify_group[discourse_container_new_data]"
 end
 
+resolvers = node[:networking][:nameservers].map do |resolver|
+  resolver =~ /:/ ? "[#{resolver}]" : resolver
+end
+
 template "/srv/community.openstreetmap.org/docker/containers/web_only.yml" do
   source "web_only.yml.erb"
   owner "root"
   group "root"
   mode "640"
   variables :license_keys => license_keys, :passwords => passwords,
-            :prometheus_servers => prometheus_servers
+            :prometheus_servers => prometheus_servers, :resolvers => resolvers
   notifies :run, "notify_group[discourse_container_new_web_only]"
 end
 
index 5ec88d923259b8963933b44e8721c23d2fc30864..31d4c18fe8e253a17a0c29d12669cd947b606cd0 100644 (file)
@@ -129,6 +129,6 @@ hooks:
         to: |
           add_header Strict-Transport-Security 'max-age=63072000' always;
           ssl_stapling on;
-          resolver <%= node[:networking][:nameservers].join(" ") %>;
+          resolver <%= @resolvers.join(" ") %>;
           resolver_timeout 5s;
           ssl_dhparam /shared/ssl/dhparam.pem;