]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/imagery/resources/site.rb
Add a python cookbook
[chef.git] / cookbooks / imagery / resources / site.rb
index f8ab667319d6fcad61208bb4544b9c5a67c2b25a..137153a72f1539eafbbdfd1d75345a4610543326 100644 (file)
@@ -94,11 +94,15 @@ action :create do
     domains base_domains.flat_map { |d| [d, "a.#{d}", "b.#{d}", "c.#{d}"] }
   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