-template "/etc/init.d/nominatim-update" do
- source "updater.init.erb"
- user "nominatim"
- group "nominatim"
- mode 0755
- variables :source_directory => source_directory
+ssl_certificate node[:fqdn] do
+ domains [node[:fqdn],
+ "nominatim.openstreetmap.org",
+ "nominatim.osm.org",
+ "nominatim.openstreetmap.com",
+ "nominatim.openstreetmap.net",
+ "nominatim.openstreetmaps.org",
+ "nominatim.openmaps.org"]
+ notifies :reload, "service[nginx]"
+end
+
+package "apache2" do
+ action :remove
+end
+
+include_recipe "nginx"
+
+nginx_site "default" do
+ action [:delete]
+end
+
+nginx_site "nominatim" do
+ template "nginx.erb"
+ directory build_directory
+ variables :pools => node[:nominatim][:fpm_pools],
+ :frontends => search(:node, "recipes:web\\:\\:frontend"),
+ :confdir => "#{basedir}/etc",
+ :ui_directory => ui_directory
+end
+
+template "/etc/logrotate.d/nginx" do
+ source "logrotate.nginx.erb"
+ owner "root"
+ group "root"
+ mode "644"