X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/c3a13fca5d82a7203707da7900341e7c30bf60ee..49e729f51ae97eb06c651ca23d86582b5f02e27f:/cookbooks/tile/recipes/default.rb?ds=sidebyside diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 7363e410c..4a1454760 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -46,7 +46,14 @@ 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 + ignore_failure 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 +61,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 +87,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 @@ -603,10 +611,10 @@ munin_plugin "renderd_zoom_time" munin_plugin "replication_delay" -prometheus_collector "modtile" do - interval "1m" +prometheus_exporter "modtile" do + port 9494 end -prometheus_collector "renderd" do - interval "1m" +prometheus_exporter "renderd" do + port 9393 end