X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/ee7f44802058c129e156835b9bc2934dbbcf2183..59899933a1b22ff9e35a50730ea5eebf9dcfc6a6:/cookbooks/tile/recipes/default.rb?ds=sidebyside diff --git a/cookbooks/tile/recipes/default.rb b/cookbooks/tile/recipes/default.rb index 824b6cf58..d2f875611 100644 --- a/cookbooks/tile/recipes/default.rb +++ b/cookbooks/tile/recipes/default.rb @@ -368,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"