X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/6dcccc4cf3623b9b27c3f8ac3d389c1bfad2100a..2324d633f206c9360b4effe891a577aa57da74af:/cookbooks/web/recipes/cgimap.rb?ds=sidebyside diff --git a/cookbooks/web/recipes/cgimap.rb b/cookbooks/web/recipes/cgimap.rb index 32b6365ca..fc1e1f47c 100644 --- a/cookbooks/web/recipes/cgimap.rb +++ b/cookbooks/web/recipes/cgimap.rb @@ -24,12 +24,29 @@ db_passwords = data_bag_item("db", "passwords") package "openstreetmap-cgimap-bin" +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 + +memcached_servers = node[:web][:memcached_servers] || [] + template "/etc/init.d/cgimap" do owner "root" group "root" mode 0o755 source "cgimap.init.erb" - variables :db_password => db_passwords["rails"] + variables { + :db_password => db_passwords["rails"], + :pid_directory => node[:web][:pid_directory], + :log_directory => node[:web][:log_directory], + :database_host => database_host, + :database_readonly => database_readonly, + :memcached_servers => memcached_servers + } end if %w(database_offline api_offline).include?(node[:web][:status])