]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/planet/recipes/replication.rb
vectortile: make enabled a boolean
[chef.git] / cookbooks / planet / recipes / replication.rb
index c3893834daec2affd2b6a7acc3f505dc25aec397..f7552ddf226bee77270e61869f0024f8dfe8a8ba 100644 (file)
@@ -22,6 +22,7 @@ require "yaml"
 include_recipe "accounts"
 include_recipe "apt"
 include_recipe "osmosis"
+include_recipe "planet::aws"
 include_recipe "ruby"
 include_recipe "tools"
 
@@ -31,14 +32,18 @@ db_passwords = data_bag_item("db", "passwords")
 
 package %w[
   postgresql-client
-  ruby-libxml
   make
   gcc
   libc6-dev
   libpq-dev
+  libxml2-dev
   osmdbt
 ]
 
+gem_package "libxml-ruby" do
+  gem_binary node[:ruby][:gem]
+end
+
 gem_package "pg" do
   gem_binary node[:ruby][:gem]
 end
@@ -90,6 +95,13 @@ template "/usr/local/bin/users-deleted" do
   mode "755"
 end
 
+template "/usr/local/bin/replicate-changesets" do
+  source "replicate-changesets.erb"
+  owner "root"
+  group "root"
+  mode "755"
+end
+
 ## Published deleted users directory
 
 remote_directory "/store/planet/users_deleted" do
@@ -206,6 +218,8 @@ systemd_service "replication-changesets" do
   user "planet"
   exec_start "/usr/local/bin/replicate-changesets /etc/replication/changesets.conf"
   sandbox :enable_network => true
+  protect_home "tmpfs"
+  bind_paths "/home/planet"
   read_write_paths [
     "/run/replication",
     "/store/planet/replication/changesets"
@@ -266,6 +280,8 @@ systemd_service "replication-minutely" do
   working_directory "/etc/replication"
   exec_start "/usr/local/bin/replicate-minute"
   sandbox :enable_network => true
+  protect_home "tmpfs"
+  bind_paths "/home/planet"
   read_write_paths [
     "/run/replication",
     "/store",
@@ -309,10 +325,12 @@ end
 systemd_service "replication-hourly" do
   description "Hourly replication"
   user "planet"
-  exec_start "/usr/local/bin/osmosis -q --merge-replication-files workingDirectory=/var/lib/replication/hour"
+  exec_start "/usr/local/bin/replicate-hour"
   environment "LD_PRELOAD" => "/opt/flush/flush.so"
   sandbox :enable_network => true
   memory_deny_write_execute false
+  protect_home "tmpfs"
+  bind_paths "/home/planet"
   read_write_paths [
     "/store/planet/replication/hour",
     "/var/lib/replication/hour"
@@ -353,10 +371,12 @@ end
 systemd_service "replication-daily" do
   description "Daily replication"
   user "planet"
-  exec_start "/usr/local/bin/osmosis -q --merge-replication-files workingDirectory=/var/lib/replication/day"
+  exec_start "/usr/local/bin/replicate-day"
   environment "LD_PRELOAD" => "/opt/flush/flush.so"
   sandbox :enable_network => true
   memory_deny_write_execute false
+  protect_home "tmpfs"
+  bind_paths "/home/planet"
   read_write_paths [
     "/store/planet/replication/day",
     "/var/lib/replication/day"