- action [ :enable, :start ]
- supports :restart => true
- subscribes :restart, resources(:template => "/usr/local/bin/replicate")
- subscribes :restart, resources(:template => "/etc/init.d/replicate")
+ action [:enable, :start]
+ subscribes :restart, "template[/usr/local/bin/replicate]"
+ subscribes :restart, "systemd_service[replicate]"
+end
+
+template "/usr/local/bin/render-lowzoom" do
+ source "render-lowzoom.erb"
+ owner "root"
+ group "root"
+ mode "755"
+ variables :threads => lowzoom_threads
+end
+
+systemd_service "render-lowzoom" do
+ description "Render low zoom tiles"
+ condition_path_exists_glob "!/run/update-lowzoom-*"
+ user "tile"
+ exec_start "/usr/local/bin/render-lowzoom"
+ sandbox true
+ restrict_address_families "AF_UNIX"
+ read_write_paths "/var/log/tile"
+end
+
+systemd_timer "render-lowzoom" do
+ description "Render low zoom tiles"
+ on_calendar "23:00 #{node[:timezone]}"
+end
+
+service "render-lowzoom.timer" do
+ action [:enable, :start]