]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/recipes/default.rb
Configure the nfs_client and tcp munin plugins
[chef.git] / cookbooks / nominatim / recipes / default.rb
index f6a57a8efc7d78047bed6e9ac42e404e9e485c1a..6f3394403a5271971066a0040938eddec689a49c 100644 (file)
@@ -42,7 +42,7 @@ end
 
 apache_site "nominatim.openstreetmap.org" do
   template "apache.erb"
-  directory "/home/lonvia/nominatim"
+  directory source_directory
   variables :pools => node[:nominatim][:fpm_pools]
 end
 
@@ -54,7 +54,7 @@ node[:nominatim][:fpm_pools].each do |name,data|
     group "root"
     mode 0644
     variables data.merge(:name => name)
-    notifies :reload, resources(:service => "php5-fpm")
+    notifies :reload, "service[php5-fpm]"
   end
 end
 
@@ -93,6 +93,14 @@ directory "/var/log/nominatim" do
   mode 0755
 end
 
+template "/etc/logrotate.d/nominatim" do
+  source "logrotate.nominatim.erb"
+  owner "root"
+  group "root"
+  mode 0644
+end
+
+
 package "osmosis"
 package "gcc"
 package "proj-bin"
@@ -110,6 +118,7 @@ package "automake"
 package "libproj-dev"
 package "libprotobuf-c0-dev"
 package "protobuf-c-compiler"
+package "python-psycopg2"
 
 execute "php-pear-db" do
   command "pear install DB"
@@ -223,3 +232,38 @@ template "/etc/init.d/nominatim-update" do
   variables :source_directory => source_directory
 end
 
+munin_plugin_conf "nominatim" do
+  template "munin.erb"
+end
+
+munin_plugin "nominatim_importlag" do
+  target "#{source_directory}/munin/nominatim_importlag"
+end
+
+munin_plugin "nominatim_query_speed" do
+  target "#{source_directory}/munin/nominatim_query_speed"
+end
+
+munin_plugin "nominatim_requests" do
+  target "#{source_directory}/munin/nominatim_requests"
+end
+
+munin_plugin "nominatim_throttled_ips" do
+  target "#{source_directory}/munin/nominatim_throttled_ips"
+end
+
+template "/usr/local/bin/backup-nominatim" do
+  source "backup-nominatim.erb"
+  owner "root"
+  group "root"
+  mode 0755
+end
+
+cron "nominatim_backup" do
+  hour "3"
+  minute "00"
+  day "1"
+  command "/usr/local/bin/backup-nominatim"
+  user "nominatim"
+  mailto email_errors
+end