X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/5dea55cbbebb12ce1526c6401ad551ccd8d496dd..408f8f15779069865660e5d3215d235688a920ce:/cookbooks/nominatim/recipes/default.rb diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index 43982b751..0a245969c 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -1,8 +1,8 @@ # -# Cookbook Name:: nominatim +# Cookbook:: nominatim # Recipe:: base # -# Copyright 2015, OpenStreetMap Foundation +# Copyright:: 2015, OpenStreetMap Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -17,6 +17,8 @@ # limitations under the License. # +include_recipe "munin" + basedir = data_bag_item("accounts", "nominatim")["home"] email_errors = data_bag_item("accounts", "lonvia")["email"] @@ -55,7 +57,6 @@ include_recipe "postgresql" postgresql_version = node[:nominatim][:dbcluster].split("/").first postgis_version = node[:nominatim][:postgis] -package "postgis" package "postgresql-#{postgresql_version}-postgis-#{postgis_version}" node[:nominatim][:dbadmins].each do |user| @@ -109,7 +110,7 @@ node[:nominatim][:tablespaces].each do |name, location| end end -if node[:nominatim][:state] == "master" # ~FC023 +if node[:nominatim][:state] == "master" postgresql_user "replication" do cluster node[:nominatim][:dbcluster] password data_bag_item("nominatim", "passwords")["replication"] @@ -151,7 +152,9 @@ package %w[ libpq-dev libgeos++-dev libproj-dev + python3-pyosmium pyosmium + python3-psycopg2 ] source_directory = "#{basedir}/nominatim" @@ -208,7 +211,7 @@ template "#{build_directory}/settings/local.php" do :log_file => "#{node[:nominatim][:logdir]}/query.log" end -if node[:nominatim][:flatnode_file] # ~FC023 +if node[:nominatim][:flatnode_file] directory File.dirname(node[:nominatim][:flatnode_file]) do recursive true end @@ -222,8 +225,7 @@ template "/etc/logrotate.d/nominatim" do end external_data = [ - "wikipedia_article.sql.bin", - "wikipedia_redirect.sql.bin", + "wikimedia-importance.sql.gz", "gb_postcode_data.sql.gz" ] @@ -316,8 +318,6 @@ include_recipe "apache" package "php" package "php-fpm" package "php-pgsql" -package "php-pear" -package "php-db" package "php-intl" apache_module "rewrite" @@ -342,6 +342,13 @@ node[:nominatim][:fpm_pools].each do |name, data| end end +systemd_service "apache-nominatim" do + service "apache2" + dropin "nominatim" + tasks_max 12000 + notifies :restart, "service[apache2]" +end + ssl_certificate "nominatim.openstreetmap.org" do domains ["nominatim.openstreetmap.org", "nominatim.osm.org", @@ -356,6 +363,7 @@ apache_site "nominatim.openstreetmap.org" do template "apache.erb" directory build_directory variables :pools => node[:nominatim][:fpm_pools] + only_if { node[:nominatim][:state] != "off" } end apache_site "default" do