]> git.openstreetmap.org Git - chef.git/commitdiff
Use internal address to check certificates on internal only machines
authorTom Hughes <tom@compton.nu>
Fri, 3 Aug 2018 07:35:57 +0000 (08:35 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 3 Aug 2018 07:38:05 +0000 (08:38 +0100)
cookbooks/letsencrypt/recipes/default.rb

index 5bc9e33137258bdae58636e09080b58b18d2fa2c..61a12005757a4b7f14bd9fce6ed85bd06f0e312e 100644 (file)
@@ -124,7 +124,10 @@ certificates = search(:node, "letsencrypt:certificates").each_with_object({}) do
   n[:letsencrypt][:certificates].each do |name, details|
     c[name] ||= details.merge(:nodes => [])
 
   n[:letsencrypt][:certificates].each do |name, details|
     c[name] ||= details.merge(:nodes => [])
 
-    c[name][:nodes] << { :name => n[:fqdn], :address => n.external_ipaddress }
+    c[name][:nodes] << {
+      :name => n[:fqdn],
+      :address => n.external_ipaddress || n.internal_ipaddress
+    }
   end
 end
 
   end
 end