X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/d1b835abf6c54e768ead54dd0056011554ba0b71..8ccf941a82940d016e9c68bdf0c29e190953c7f7:/cookbooks/tile/recipes/default.rb diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 57ee431b0..154ce68fd 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -23,6 +23,7 @@ include_recipe "git" include_recipe "munin" include_recipe "nodejs" include_recipe "postgresql" +include_recipe "prometheus" include_recipe "python" include_recipe "tools" @@ -45,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] @@ -53,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 @@ -79,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 @@ -601,3 +609,11 @@ munin_plugin "renderd_zoom" munin_plugin "renderd_zoom_time" munin_plugin "replication_delay" + +prometheus_collector "modtile" do + interval "1m" +end + +prometheus_collector "renderd" do + interval "1m" +end