]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/recipes/version4.rb
nominatim v4: serve php from project directory
[chef.git] / cookbooks / nominatim / recipes / version4.rb
index e68be086e25ab3c0f376cb53e5140fc38bb01266..7b218d9511324d6b876286bdb7a4ba79925f2072 100644 (file)
@@ -64,6 +64,14 @@ postgis_version = node[:nominatim][:postgis]
 
 package "postgresql-#{postgresql_version}-postgis-#{postgis_version}"
 
+node[:nominatim][:dbadmins].each do |user|
+  postgresql_user user do
+    cluster node[:nominatim][:dbcluster]
+    superuser true
+    only_if { node[:nominatim][:state] != "slave" }
+  end
+end
+
 postgresql_user "nominatim" do
   cluster node[:nominatim][:dbcluster]
   superuser true
@@ -221,15 +229,15 @@ template "#{project_directory}/.env" do
             :tokenizer => node[:nominatim][:config][:tokenizer]
 end
 
-#%w[wikimedia-importance.sql.gz gb_postcodes.csv.gz us_postcodes.csv.gz].each do |fname|
-#  remote_file "#{project_directory}/#{fname}" do
-#    action :create
-#    source "https://www.nominatim.org/data/#{fname}"
-#    owner "nominatim"
-#    group "nominatim"
-#    mode "644"
-#  end
-#end
+%w[wikimedia-importance.sql.gz gb_postcodes.csv.gz us_postcodes.csv.gz].each do |fname|
+  remote_file "#{project_directory}/#{fname}" do
+    action :create
+    source "https://www.nominatim.org/data/#{fname}"
+    owner "nominatim"
+    group "nominatim"
+    mode "644"
+  end
+end
 
 # Webserver + frontend
 
@@ -277,7 +285,7 @@ frontends = search(:node, "recipes:web\\:\\:frontend").sort_by(&:name)
 
 nginx_site "nominatim" do
   template "nginx.erb"
-  directory build_directory
+  directory project_directory
   variables :pools => node[:nominatim][:fpm_pools],
             :frontends => frontends,
             :confdir => "#{basedir}/etc",