]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/db/recipes/master.rb
Make sure the planet user is created by recipes which use it
[chef.git] / cookbooks / db / recipes / master.rb
index f6641fd18fe85ba677d12d571c14024ac9780ab2..905d7a221ed8ed8f4d9fbc08bf1f649ded476cb5 100644 (file)
@@ -84,6 +84,25 @@ postgresql_extension "btree_gist" do
   only_if { node[:postgresql][:clusters][node[:db][:cluster]] && node[:postgresql][:clusters][node[:db][:cluster]][:version] >= 9.0 }
 end
 
-file "/etc/cron.daily/rails-db" do
-  action :delete
+cookbook_file "/usr/local/share/monthly-reindex.sql" do
+  owner "root"
+  group "root"
+  mode "644"
+end
+
+systemd_service "monthly-reindex" do
+  description "Monthly database reindex"
+  exec_start "/usr/bin/psql -f /usr/local/share/monthly-reindex.sql openstreetmap"
+  user "postgres"
+  sandbox true
+  restrict_address_families "AF_UNIX"
+end
+
+systemd_timer "monthly-reindex" do
+  description "Monthly database reindex"
+  on_calendar "Sun *-*-1..7 02:00"
+end
+
+service "monthly-reindex.timer" do
+  action [:enable, :start]
 end