X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/c3a13fca5d82a7203707da7900341e7c30bf60ee..8ccf941a82940d016e9c68bdf0c29e190953c7f7:/cookbooks/tile/recipes/default.rb diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 7363e410c..154ce68fd 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 @@ -80,6 +86,7 @@ systemd_service "renderd" do exec_start "/usr/bin/renderd -f" runtime_directory "renderd" standard_error "null" + limit_nofile 4096 private_tmp true private_devices true private_network true