X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/514777d2f84ab1ebb259ab62ddf57b8c4d1ecc72..7b4e373a485d44870c2118a7e473f76641a26159:/cookbooks/nominatim/recipes/master.rb diff --git a/cookbooks/nominatim/recipes/master.rb b/cookbooks/nominatim/recipes/master.rb index 2e0094152..b135022b8 100644 --- a/cookbooks/nominatim/recipes/master.rb +++ b/cookbooks/nominatim/recipes/master.rb @@ -17,12 +17,27 @@ # limitations under the License. # -include_recipe "nominatim::base" +include_recipe "git" passwords = data_bag_item("nominatim", "passwords") database_cluster = node[:nominatim][:database][:cluster] home_directory = data_bag_item("accounts", "nominatim")["home"] +wal_archives = node[:rsyncd][:modules][:archive][:path] +# XXX we really should get a list of nominatim-slave nodes here +slaves = "poldi" + +git "#{home_directory}/nominatim" do + action :checkout + repository node[:nominatim][:repository] + enable_submodules true + user "nominatim" + group "nominatim" + notifies :run, "execute[compile_nominatim]" +end + +include_recipe "nominatim::base" + superusers = %w(tomh lonvia twain nominatim) superusers.each do |user| @@ -42,11 +57,20 @@ postgresql_user "replication" do replication true end -git "#{home_directory}/nominatim" do - action :checkout - repository node[:nominatim][:repository] - enable_submodules true - user "nominatim" - group "nominatim" - notifies :run, "execute[compile_nominatim]" +directory wal_archives do + owner "postgres" + group "postgres" + mode 0o700 + only_if { node[:postgresql][:settings][:defaults][:archive_mode] == "on" } +end + +template "/usr/local/bin/clean-db-nominatim" do + source "clean-db-nominatim.erb" + owner "root" + group "root" + mode 0o755 + variables :archive_dir => wal_archives, + :update_stop_file => "#{home_directory}/status/updates_disabled", + :streaming_clients => slaves + only_if { node[:postgresql][:settings][:defaults][:archive_mode] == "on" } end