X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/6adfd52016f87f9622a750cea3e2e926e1f09d61..847ffefc0606eae909ccc4abe752fa1629085011:/cookbooks/imagery/resources/site.rb diff --git a/cookbooks/imagery/resources/site.rb b/cookbooks/imagery/resources/site.rb index f8ab66731..d6e2071cc 100644 --- a/cookbooks/imagery/resources/site.rb +++ b/cookbooks/imagery/resources/site.rb @@ -89,16 +89,21 @@ action :create do end base_domains = [name] + Array(aliases) + tile_domains = base_domains.flat_map { |d| [d, "a.#{d}", "b.#{d}", "c.#{d}"] } ssl_certificate new_resource.name do - domains base_domains.flat_map { |d| [d, "a.#{d}", "b.#{d}", "c.#{d}"] } + domains tile_domains + end + + resolvers = node[:networking][:nameservers].map do |resolver| + IPAddr.new(resolver).ipv6? ? "[#{resolver}]" : resolver end nginx_site new_resource.name do template "nginx_imagery.conf.erb" directory "/srv/imagery/#{name}" restart_nginx false - variables new_resource.to_hash + variables new_resource.to_hash.merge(:resolvers => resolvers) end end