]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/recipes/default.rb
Remove some no longer needed Ubuntu 12.04 compatibility code
[chef.git] / cookbooks / nominatim / recipes / default.rb
index 65da50c5456cfbe628451563ad2381255f042501..ebcc5d7835ccf24b46659e5858c1d5a2fa40d562 100644 (file)
@@ -29,13 +29,8 @@ package "php-pear"
 package "php-apc"
 
 apache_module "rewrite"
-
-if node[:lsb][:release].to_f >= 14.04
-  apache_module "proxy"
-  apache_module "proxy_fcgi"
-else
-  apache_module "fastcgi-handler"
-end
+apache_module "proxy"
+apache_module "proxy_fcgi"
 
 home_directory = data_bag_item("accounts", "nominatim")["home"]
 source_directory = "#{home_directory}/nominatim"
@@ -48,9 +43,7 @@ database_name = node[:nominatim][:database][:dbname]
 postgis_version = node[:nominatim][:database][:postgis]
 
 service "php5-fpm" do
-  if node[:lsb][:release].to_f >= 14.04
-    provider Chef::Provider::Service::Upstart
-  end
+  provider Chef::Provider::Service::Upstart
   action [ :enable, :start ]
   supports :status => true, :restart => true, :reload => true
 end
@@ -243,17 +236,41 @@ munin_plugin "nominatim_importlag" do
 end
 
 munin_plugin "nominatim_query_speed" do
-  target "#{source_directory}/munin/nominatim_query_speed"
+  target "#{source_directory}/munin/nominatim_query_speed_querylog"
 end
 
 munin_plugin "nominatim_requests" do
-  target "#{source_directory}/munin/nominatim_requests"
+  target "#{source_directory}/munin/nominatim_requests_querylog"
 end
 
 munin_plugin "nominatim_throttled_ips" do
   target "#{source_directory}/munin/nominatim_throttled_ips"
 end
 
+remote_file "#{source_directory}/data/wikipedia_article.sql.bin" do
+  action :create_if_missing
+  source "http://www.nominatim.org/data/wikipedia_article.sql.bin"
+  owner  "nominatim"
+  group  "nominatim"
+  mode   0644
+end
+
+remote_file "#{source_directory}/data/wikipedia_redirect.sql.bin" do
+  action :create_if_missing
+  source "http://www.nominatim.org/data/wikipedia_redirect.sql.bin"
+  owner  "nominatim"
+  group  "nominatim"
+  mode   0644
+end
+
+remote_file "#{source_directory}/data/gb_postcode_data.sql.gz" do
+  action :create_if_missing
+  source "http://www.nominatim.org/data/gb_postcode_data.sql.gz"
+  owner  "nominatim"
+  group  "nominatim"
+  mode   0644
+end
+
 template "/usr/local/bin/backup-nominatim" do
   source "backup-nominatim.erb"
   owner "root"
@@ -261,3 +278,10 @@ template "/usr/local/bin/backup-nominatim" do
   mode 0755
 end
 
+directory File.dirname(node[:nominatim][:flatnode_file]) do
+  owner "nominatim"
+  group "nominatim"
+  mode 0755
+  recursive true
+end
+