X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/e2fccde243e82951a757683066a80071f67bda2b..2c854e9952890a119750a187479eb2701107705f:/cookbooks/tile/recipes/default.rb?ds=sidebyside diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 4f3cc5002..d2f875611 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -169,7 +169,7 @@ node[:tile][:data].each do |name,data| execute file do action :nothing - command "unzip -qq #{file} -d #{directory}" + command "unzip -qq -o #{file} -d #{directory}" user "tile" group "tile" end @@ -194,16 +194,23 @@ node[:tile][:data].each do |name,data| action :nothing command "find #{directory} -type f -iname '*.shp' -print0 | xargs -0 --no-run-if-empty shapeindex --shape_files" user "tile" - user "tile" + group "tile" subscribes :run, resources(:execute => file), :immediately end remote_file file do - action :create_if_missing + if data[:refresh] + action :create + use_conditional_get true + else + action :create_if_missing + end + source url owner "tile" group "tile" mode 0644 + backup false notifies :run, resources(:execute => file), :immediately notifies :restart, resources(:service => "renderd") end @@ -361,11 +368,19 @@ postgresql_munin "gis" do database "gis" end -#file node[:tile][:node_file] do -# owner "tile" -# group "www-data" -# mode 0640 -#end +tile_uid = node[:etc][:passwd]["tile"][:uid] +www_data_gid = node[:etc][:group]["www-data"][:gid] + +ruby_block node[:tile][:node_file] do + block do + File.chown(tile_uid, www_data_gid, node[:tile][:node_file]) + File.chmod(0640, node[:tile][:node_file]) + end + not_if do + stat = File.stat(node[:tile][:node_file]) + stat.uid == tile_uid && stat.gid == www_data_gid && stat.mode == 0640 + end +end directory "/var/log/tile" do owner "tile" @@ -462,7 +477,7 @@ template "/etc/cron.d/render-lowzoom" do source "render-lowzoom.cron.erb" owner "root" group "root" - mode 0755 + mode 0644 end template "/etc/rsyslog.d/20-renderd.conf" do @@ -479,7 +494,7 @@ template "/usr/local/bin/cleanup-tiles" do source "cleanup-tiles.erb" owner "root" group "root" - mode 0644 + mode 0755 end tile_directories = node[:tile][:styles].collect do |name,style| @@ -495,12 +510,13 @@ template "/etc/cron.d/cleanup-tiles" do end munin_plugin "mod_tile_fresh" +munin_plugin "mod_tile_latency" munin_plugin "mod_tile_response" munin_plugin "mod_tile_zoom" -munin_plugin "mod_tile_latency" munin_plugin "renderd_processed" munin_plugin "renderd_queue" +munin_plugin "renderd_queue_time" munin_plugin "renderd_zoom" munin_plugin "renderd_zoom_time"