conf "tile.conf.erb"
end
-tilecaches = search(:node, "roles:tilecache")
+tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] }
apache_site "default" do
action [ :disable ]
end
node[:tile][:styles].each do |name,details|
- directory = "/srv/tile.openstreetmap.org/styles/#{name}"
+ style_directory = "/srv/tile.openstreetmap.org/styles/#{name}"
+ tile_directory = "/srv/tile.openstreetmap.org/tiles/#{name}"
- git directory do
+ template "/usr/local/bin/update-lowzoom-#{name}" do
+ source "update-lowzoom.erb"
+ owner "root"
+ group "root"
+ mode 0755
+ variables :style => name
+ end
+
+ template "/etc/init.d/update-lowzoom-#{name}" do
+ source "update-lowzoom.init.erb"
+ owner "root"
+ group "root"
+ mode 0755
+ variables :style => name
+ end
+
+ service "update-lowzoom-#{name}" do
+ action :disable
+ supports :restart => true
+ end
+
+ file "#{tile_directory}/planet-import-complete" do
+ action :create_if_missing
+ owner "tile"
+ group "tile"
+ mode 0444
+ end
+
+ git style_directory do
action :sync
repository details[:repository]
revision details[:revision]
group "tile"
end
- link "#{directory}/data" do
+ link "#{style_directory}/data" do
to "/srv/tile.openstreetmap.org/data"
owner "tile"
group "tile"
end
- execute "#{directory}/project.mml" do
+ execute "#{style_directory}/project.mml" do
+ action :nothing
command "carto project.mml > project.xml"
- cwd directory
+ cwd style_directory
user "tile"
group "tile"
- not_if do
- File.exist?("#{directory}/project.xml") and
- File.mtime("#{directory}/project.xml") >= File.mtime("#{directory}/project.mml")
- end
- notifies :restart, resources(:service => "renderd")
+ subscribes :run, "git[#{style_directory}]"
+ notifies :restart, "service[renderd]"
+ notifies :restart, "service[update-lowzoom-#{name}]"
end
end
# end
#end
+directory "/var/log/tile" do
+ owner "tile"
+ group "tile"
+ mode 0755
+end
+
package "osm2pgsql"
package "osmosis"
mode 0755
end
-directory "/var/log/replicate" do
- owner "tile"
- group "tile"
- mode 0755
-end
-
template "/var/lib/replicate/configuration.txt" do
source "replicate.configuration.erb"
owner "tile"