]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/planet/recipes/current.rb
Convert taginfo update to use a systemd timer
[chef.git] / cookbooks / planet / recipes / current.rb
index c7175e6e17ebd0b55597b55a2d33f93ce1c79176..517123f5913219f97a73d9402c419e81415bdac7 100644 (file)
@@ -17,6 +17,8 @@
 # limitations under the License.
 #
 
+node.default[:accounts][:users][:planet][:status] = :role
+
 include_recipe "accounts"
 
 package %w[
@@ -30,13 +32,6 @@ template "/usr/local/bin/planet-update" do
   mode "755"
 end
 
-template "/usr/local/bin/planet-update-file" do
-  source "planet-update-file.erb"
-  owner "root"
-  group "root"
-  mode "755"
-end
-
 directory "/var/lib/planet" do
   owner "planet"
   group "planet"
@@ -52,16 +47,11 @@ remote_file "/var/lib/planet/planet.osh.pbf" do
   not_if { kitchen? }
 end
 
-cron_d "planet-update" do
-  minute "37"
-  hour "1"
-  user "root"
-  command "/usr/local/bin/planet-update"
-end
-
-template "/etc/logrotate.d/planet-update" do
-  source "planet-update.logrotate.erb"
-  owner "root"
-  group "root"
-  mode "644"
+systemd_service "planet-update" do
+  description "Planet file update"
+  type "oneshot"
+  exec_start "/usr/local/bin/planet-update"
+  user "planet"
+  sandbox :enable_network => true
+  read_write_paths "/var/lib/planet"
 end