]> git.openstreetmap.org Git - chef.git/commitdiff
nominatim: add config in new dotenv format
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 30 Dec 2020 10:27:24 +0000 (11:27 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 30 Dec 2020 10:27:52 +0000 (11:27 +0100)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/nominatim.env.erb [new file with mode: 0644]

index b5496a6526b0f44dbc988db9476cdd8a533d91ea..445ef7b5a2d4c1cb9f60b1c53cfc6dc82429e2a0 100644 (file)
@@ -227,6 +227,17 @@ template "#{build_directory}/settings/local.php" do
             :log_file => "#{node[:nominatim][:logdir]}/query.log"
 end
 
             :log_file => "#{node[:nominatim][:logdir]}/query.log"
 end
 
+template "#{build_directory}/.env" do
+  source "nominatim.env.erb"
+  owner "nominatim"
+  group "nominatim"
+  mode "664"
+  variables :base_url => node[:nominatim][:state] == "off" ? node[:fqdn] : "nominatim.openstreetmap.org",
+            :dbname => node[:nominatim][:dbname],
+            :flatnode_file => node[:nominatim][:flatnode_file],
+            :log_file => "#{node[:nominatim][:logdir]}/query.log"
+end
+
 git ui_directory do
   action :sync
   repository node[:nominatim][:ui_repository]
 git ui_directory do
   action :sync
   repository node[:nominatim][:ui_repository]
diff --git a/cookbooks/nominatim/templates/default/nominatim.env.erb b/cookbooks/nominatim/templates/default/nominatim.env.erb
new file mode 100644 (file)
index 0000000..062d5f9
--- /dev/null
@@ -0,0 +1,26 @@
+# DO NOT EDIT - This file is being maintained by Chef
+
+NOMINATIM_DATABASE_DSN="<%= @dbname %>"
+NOMINATIM_MAPICON_URL="https://<%= @base_url %>/ui/mapicons/"
+
+<% if @flatnode_file -%>
+NOMINATIM_FLATNODE_FILE="<%= @flatnode_file %>"
+<% end -%>
+
+NOMINATIM_IMPORT_STYLE=extratags
+
+NOMINATIM_USE_US_TIGER_DATA=yes
+
+NOMINATIM_TABLESPACE_SEARCH_DATA=dsearch
+NOMINATIM_TABLESPACE_SEARCH_INDEX=isearch
+NOMINATIM_TABLESPACE_OSM_DATA=dosm
+NOMINATIM_TABLESPACE_OSM_INDEX=iosm
+NOMINATIM_TABLESPACE_PLACE_DATA=dplace
+NOMINATIM_TABLESPACE_PLACE_INDEX=iplace
+NOMINATIM_TABLESPACE_ADDRESS_DATA=daddress
+NOMINATIM_TABLESPACE_ADDRESS_INDEX=iaddress
+NOMINATIM_TABLESPACE_AUX_DATA=daux
+NOMINATIM_TABLESPACE_AUX_INDEX=iaux
+
+NOMINATIM_LOG_DB=no
+NOMINATIM_LOG_FILE="<%= @log_file %>"