Start job processes for the traces queue on primary backends
authorTom Hughes <tom@compton.nu>
Thu, 28 Mar 2019 08:29:20 +0000 (08:29 +0000)
committerTom Hughes <tom@compton.nu>
Thu, 28 Mar 2019 08:29:20 +0000 (08:29 +0000)
cookbooks/web/attributes/default.rb
cookbooks/web/recipes/backend.rb
roles/equinix.rb

index 8ad59e5440da90c27e221518b68e409c94f96424..79890cbdb18361c460376b9d5f95c726bfe1c5e2 100644 (file)
@@ -1,3 +1,4 @@
 default[:web][:base_directory] = "/srv/www.openstreetmap.org"
 default[:web][:pid_directory] = "/var/run/web"
 default[:web][:log_directory] = "/var/log/web"
+default[:web][:primary_cluster] = false
index 69fb018d87760ed7df96e6f0a62f1e42ad985af1..e1995500cd2859d42bab41be5ee4b2c8e9785420 100644 (file)
@@ -41,3 +41,12 @@ apache_site "www.openstreetmap.org" do
 end
 
 node.normal[:memcached][:ip_address] = node.internal_ipaddress
+
+if node[:web][:primary_cluster]
+  service "rails-jobs@traces" do
+    action [:enable, :start]
+    supports :restart => true
+    subscribes :restart, "rails_port[www.openstreetmap.org]"
+    subscribes :restart, "systemd_service[rails-jobs]"
+  end
+end
index 85d445dce565c148ef948fe665d23b4557d20afb..a35b4775c50b97526ad92825f812b937402d4396 100644 (file)
@@ -27,7 +27,8 @@ default_attributes(
   :web => {
     :backends => %w[rails1 rails2 rails3],
     :fileserver => "ironbelly",
-    :readonly_database_host => "karm.ams.openstreetmap.org"
+    :readonly_database_host => "karm.ams.openstreetmap.org",
+    :primary_cluster => true
   }
 )