]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/nominatim/recipes/default.rb
fix rubocop warnings
[chef.git] / cookbooks / nominatim / recipes / default.rb
index b516ffe883016fa7beeb0be874f44bd7548082b8..2bf8e35de9bd00311a69d88c529133d2496960e2 100644 (file)
 basedir = data_bag_item("accounts", "nominatim")["home"]
 email_errors = data_bag_item("accounts", "lonvia")["email"]
 
+directory basedir do
+  owner "nominatim"
+  group "nominatim"
+  mode 0o755
+  recursive true
+end
+
 directory node[:nominatim][:logdir] do
   owner "nominatim"
   group "nominatim"
@@ -41,12 +48,6 @@ file "#{node[:nominatim][:logdir]}/update.log" do
   mode 0o664
 end
 
-directory "#{basedir}/status" do
-  owner "nominatim"
-  group "postgres"
-  mode 0o775
-end
-
 ## Postgresql
 
 include_recipe "postgresql"
@@ -243,7 +244,9 @@ template "#{source_directory}/utils/nominatim-update" do
   user "nominatim"
   group "nominatim"
   mode 0o755
-  variables :logfile => "#{node[:nominatim][:logdir]}/update.log",
+  variables :bindir => build_directory,
+            :srcdir => source_directory,
+            :logfile => "#{node[:nominatim][:logdir]}/update.log",
             :branch => node[:nominatim][:revision],
             :update_stop_file => "#{basedir}/status/updates_disabled"
 end
@@ -268,7 +271,7 @@ end
 
 ## webserver frontend
 
-template "#{source_directory}/settings/ip_blocks.conf" do
+template "#{build_directory}/settings/ip_blocks.conf" do
   action :create_if_missing
   source "ipblocks.erb"
   owner "nominatim"
@@ -276,14 +279,14 @@ template "#{source_directory}/settings/ip_blocks.conf" do
   mode 0o664
 end
 
-file "#{source_directory}/settings/apache_blocks.conf" do
+file "#{build_directory}/settings/apache_blocks.conf" do
   action :create_if_missing
   owner "nominatim"
   group "nominatim"
   mode 0o664
 end
 
-file "#{source_directory}/settings/ip_blocks.map" do
+file "#{build_directory}/settings/ip_blocks.map" do
   action :create_if_missing
   owner "nominatim"
   group "nominatim"
@@ -379,3 +382,9 @@ end
 munin_plugin "nominatim_throttled_ips" do
   target "#{source_directory}/munin/nominatim_throttled_ips"
 end
+
+directory "#{basedir}/status" do
+  owner "nominatim"
+  group "postgres"
+  mode 0o775
+end