X-Git-Url: https://git.openstreetmap.org/chef.git/blobdiff_plain/ff044920428608b2c04507ad52d6ab52c9d6555f..10e1976e6e9fd98e058831e93fbec2eafd9c8167:/cookbooks/nominatim/recipes/default.rb diff --git a/cookbooks/nominatim/recipes/default.rb b/cookbooks/nominatim/recipes/default.rb index ab4e6e15e..e8ca87f9c 100644 --- a/cookbooks/nominatim/recipes/default.rb +++ b/cookbooks/nominatim/recipes/default.rb @@ -37,14 +37,14 @@ source_directory = "#{home_directory}/nominatim" email_errors = data_bag_item("accounts", "lonvia")["email"] database_cluster = node[:nominatim][:database][:cluster] -database_version = database_cluster.sub(/\/.*/, "") +database_version = database_cluster.sub(%r{/.*}, "") database_name = node[:nominatim][:database][:dbname] postgis_version = node[:nominatim][:database][:postgis] service "php5-fpm" do provider Chef::Provider::Service::Upstart - action [ :enable, :start ] + action [:enable, :start] supports :status => true, :restart => true, :reload => true end @@ -55,10 +55,10 @@ apache_site "nominatim.openstreetmap.org" do end apache_site "default" do - action [ :disable ] + action [:disable] end -node[:nominatim][:fpm_pools].each do |name,data| +node[:nominatim][:fpm_pools].each do |name, data| template "/etc/php5/fpm/pool.d/#{name}.conf" do source "fpm.conf.erb" owner "root" @@ -111,7 +111,6 @@ template "/etc/logrotate.d/nominatim" do mode 0644 end - package "osmosis" package "gcc" package "proj-bin" @@ -161,12 +160,11 @@ directory "#{source_directory}/log" do mode 0755 end - template "#{source_directory}/.git/hooks/post-merge" do source "update_source.erb" - owner "nominatim" - group "nominatim" - mode 0755 + owner "nominatim" + group "nominatim" + mode 0755 variables :source_directory => source_directory end @@ -215,19 +213,18 @@ template "/etc/cron.d/nominatim" do variables :bin_directory => "#{source_directory}/utils", :mailto => email_errors end - template "#{source_directory}/utils/nominatim-update" do source "updater.erb" - user "nominatim" - group "nominatim" - mode 0755 + user "nominatim" + group "nominatim" + mode 0755 end template "/etc/init.d/nominatim-update" do source "updater.init.erb" - user "nominatim" - group "nominatim" - mode 0755 + user "nominatim" + group "nominatim" + mode 0755 variables :source_directory => source_directory end @@ -254,25 +251,25 @@ 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 + 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 + 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 + owner "nominatim" + group "nominatim" + mode 0644 end template "/usr/local/bin/backup-nominatim" do