]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/letsencrypt/recipes/default.rb
Check all hosts for shared certificates
[chef.git] / cookbooks / letsencrypt / recipes / default.rb
index a2c42e1c5cfe1f18dbdb684e227be8c4c1586c85..34e9be8f7adf85d73ec315905bd4f5fb57f2a5b7 100644 (file)
@@ -121,7 +121,11 @@ directory "/srv/acme.openstreetmap.org/requests" do
 end
 
 certificates = search(:node, "letsencrypt:certificates").each_with_object({}) do |n, c|
-  c.merge!(n[:letsencrypt][:certificates])
+  n[:letsencrypt][:certificates].each do |name, details|
+    c[name] ||= details.merge(:nodes => [])
+
+    c[name][:nodes] << { :name => n[:fqdn], :address => n[:ipaddress] }
+  end
 end
 
 certificates.each do |name, details|