X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/9802985c84fa828a7a94ac5a7aafbd5b0f6e5a2c..860431223d5e1ada6bc6549c2cfa30dea4d23182:/cookbooks/web/recipes/cgimap.rb?ds=inline diff --git a/cookbooks/web/recipes/cgimap.rb b/cookbooks/web/recipes/cgimap.rb index ba9799c4c..8a6b23b28 100644 --- a/cookbooks/web/recipes/cgimap.rb +++ b/cookbooks/web/recipes/cgimap.rb @@ -27,18 +27,14 @@ package "openstreetmap-cgimap-bin" do action :upgrade end -if node[:web][:readonly_database_host] - database_host = node[:web][:readonly_database_host] - database_readonly = true -else - database_host = node[:web][:database_host] - database_readonly = node[:web][:status] == "database_readonly" -end +database_host = if node[:web][:readonly_database_host] + node[:web][:readonly_database_host] + else + node[:web][:database_host] + end memcached_servers = node[:web][:memcached_servers] || [] -switches = database_readonly ? " --readonly" : "" - systemd_service "cgimap" do description "OpenStreetMap API Server" type "forking" @@ -54,7 +50,7 @@ systemd_service "cgimap" do "CGIMAP_RATELIMIT" => "204800", "CGIMAP_MAXDEBT" => "250" user "rails" - exec_start "/usr/bin/openstreetmap-cgimap --daemon --port 8000 --instances 30#{switches}" + exec_start "/usr/bin/openstreetmap-cgimap --daemon --port 8000 --instances 30" exec_reload "/bin/kill -HUP $MAINPID" private_tmp true private_devices true