X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/c3a13fca5d82a7203707da7900341e7c30bf60ee..61ba6f810b825a7e456579a60eb9b1a9c7d11a36:/cookbooks/tile/recipes/default.rb diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 7363e410c..241b73a8e 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -46,7 +46,13 @@ ssl_certificate node[:fqdn] do notifies :reload, "service[apache2]" end +remote_file "#{Chef::Config[:file_cache_path]}/fastly-ip-list.json" do + source "https://api.fastly.com/public-ip-list" + compile_time true +end + tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] } +fastlyips = JSON.parse(IO.read("#{Chef::Config[:file_cache_path]}/fastly-ip-list.json")) apache_site "default" do action [:disable] @@ -54,7 +60,7 @@ end apache_site "tile.openstreetmap.org" do template "apache.erb" - variables :caches => tilecaches + variables :caches => tilecaches, :fastly => fastlyips["addresses"] end template "/etc/logrotate.d/apache2" do