X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/13d1e4cec43f3af07ac845c241a5e1782f4e6d74..e1eee7937a3b5f480697025d783104f0a5711eb2:/cookbooks/tile/recipes/default.rb diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 6516831e2..b80dc01fb 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -194,7 +194,7 @@ 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 @@ -210,6 +210,7 @@ node[:tile][:data].each do |name,data| owner "tile" group "tile" mode 0644 + backup false notifies :run, resources(:execute => file), :immediately notifies :restart, resources(:service => "renderd") end @@ -367,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" @@ -479,6 +488,7 @@ template "/etc/rsyslog.d/20-renderd.conf" do notifies :restart, "service[rsyslog]" end +package "liblockfile-simple-perl" package "libfilesys-df-perl" template "/usr/local/bin/cleanup-tiles" do