]> git.openstreetmap.org Git - chef.git/commitdiff
Configure GeoIP database for web site
authorTom Hughes <tom@compton.nu>
Thu, 20 Oct 2016 20:56:43 +0000 (21:56 +0100)
committerTom Hughes <tom@compton.nu>
Thu, 20 Oct 2016 20:56:43 +0000 (21:56 +0100)
cookbooks/web/definitions/rails_port.rb

index 51a56e9e7f0140e9ae79dbaed47b0dd9fb9c1eda..6773cf9741e76d5f984b98fc51b3d5fb13e703ab 100644 (file)
@@ -44,6 +44,7 @@ define :rails_port, :action => [:create, :enable] do
   package "irb#{ruby_version}" if ruby_version.to_f < 1.9
   package "imagemagick"
   package "nodejs"
+  package "geoip-database"
 
   package "g++"
   package "pkg-config"
@@ -122,6 +123,8 @@ define :rails_port, :action => [:create, :enable] do
 
     line.gsub!(/^( *)#geonames_username:.*$/, "\\1geonames_username: \"openstreetmap\"")
 
+    line.gsub!(/^( *)#geoip_database:.*$/, "\\1geoip_database: \"/usr/share/GeoIP/GeoIPv6.dat\"")
+
     if params[:gpx_dir]
       line.gsub!(/^( *)gpx_trace_dir:.*$/, "\\1gpx_trace_dir: \"#{params[:gpx_dir]}/traces\"")
       line.gsub!(/^( *)gpx_image_dir:.*$/, "\\1gpx_image_dir: \"#{params[:gpx_dir]}/images\"")