apache_module "proxy"
apache_module "proxy_fcgi"
apache_module "proxy_http"
+apache_module "headers"
home_directory = data_bag_item("accounts", "nominatim")["home"]
source_directory = "#{home_directory}/nominatim"
source "fpm.conf.erb"
owner "root"
group "root"
- mode 0644
+ mode 0o644
variables data.merge(:name => name, :port => data[:port])
notifies :reload, "service[php5-fpm]"
end
database database_name
end
-directory "/var/log/nominatim" do
+directory node[:nominatim][:logdir] do
owner "nominatim"
group "nominatim"
- mode 0755
+ mode 0o755
+ recursive true
+end
+
+file "#{node[:nominatim][:logdir]}/query.log" do
+ action :create_if_missing
+ owner "www-data"
+ group "adm"
+ mode 0o664
+end
+
+file "#{node[:nominatim][:logdir]}/update.log" do
+ action :create_if_missing
+ owner "nominatim"
+ group "adm"
+ mode 0o664
end
directory "#{home_directory}/status" do
owner "nominatim"
group "postgres"
- mode 0775
+ mode 0o775
end
template "/etc/logrotate.d/nominatim" do
source "logrotate.nominatim.erb"
owner "root"
group "root"
- mode 0644
+ mode 0o644
+end
+
+template "/etc/logrotate.d/apache2" do
+ source "logrotate.apache.erb"
+ owner "root"
+ group "root"
+ mode 0o644
end
package "osmosis"
package "postgresql-server-dev-#{database_version}"
package "build-essential"
package "libxml2-dev"
+package "libexpat-dev"
package "libgeos-dev"
package "libgeos++-dev"
package "libpq-dev"
user "nominatim"
end
-directory "#{source_directory}/log" do
- owner "nominatim"
- group "nominatim"
- mode 0755
-end
-
template "#{source_directory}/.git/hooks/post-merge" do
source "update_source.erb"
owner "nominatim"
group "nominatim"
- mode 0755
+ mode 0o755
variables :source_directory => source_directory
end
source "nominatim.erb"
owner "nominatim"
group "nominatim"
- mode 0664
+ mode 0o664
variables :postgres_version => database_version
end
source "ipblocks.erb"
owner "nominatim"
group "nominatim"
- mode 0664
+ mode 0o664
end
file "#{source_directory}/settings/apache_blocks.conf" do
action :create_if_missing
owner "nominatim"
group "nominatim"
- mode 0664
+ mode 0o664
end
file "#{source_directory}/settings/ip_blocks.map" do
action :create_if_missing
owner "nominatim"
group "nominatim"
- mode 0664
+ mode 0o664
end
-if node[:nominatim][:enabled]
- cron_action = :create
-else
- cron_action = :delete
-end
+cron_action = if node[:nominatim][:enabled]
+ :create
+ else
+ :delete
+ end
template "/etc/cron.d/nominatim" do
action cron_action
source "updater.erb"
user "nominatim"
group "nominatim"
- mode 0755
+ mode 0o755
end
template "/etc/init.d/nominatim-update" do
source "updater.init.erb"
user "nominatim"
group "nominatim"
- mode 0755
+ mode 0o755
variables :source_directory => source_directory
end
munin_plugin_conf "nominatim" do
template "munin.erb"
+ variables :db => node[:nominatim][:database][:dbname],
+ :querylog => "#{node[:nominatim][:logdir]}/query.log"
end
munin_plugin "nominatim_importlag" do
source "http://www.nominatim.org/data/#{fname}"
owner "nominatim"
group "nominatim"
- mode 0644
+ mode 0o644
end
end
source "#{fname}.erb"
owner "root"
group "root"
- mode 0755
+ mode 0o755
+ variables :db => node[:nominatim][:database][:dbname]
end
end
directory File.dirname(node[:nominatim][:flatnode_file]) do
owner "nominatim"
group "nominatim"
- mode 0755
+ mode 0o755
recursive true
end