]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/web/recipes/frontend.rb
Restrict queue runners on the main site to the mailers queue
[chef.git] / cookbooks / web / recipes / frontend.rb
index 3703cef31e2f2213a927525ff425f70f8d83ef6e..eb95b18f7b49982c4c14d4b697f5ad9dcd6c36e7 100644 (file)
@@ -8,7 +8,7 @@
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 #
-#     http://www.apache.org/licenses/LICENSE-2.0
+#     https://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,7 +38,8 @@ end
 
 apache_site "www.openstreetmap.org" do
   template "apache.frontend.erb"
-  variables :secret_key_base => web_passwords["secret_key_base"]
+  variables :status => node[:web][:status],
+            :secret_key_base => web_passwords["secret_key_base"]
 end
 
 template "/etc/logrotate.d/apache2" do
@@ -47,3 +48,14 @@ template "/etc/logrotate.d/apache2" do
   group "root"
   mode 0o644
 end
+
+service "rails-jobs" do
+  action [:stop, :disable]
+end
+
+service "rails-jobs@mailers" do
+  action [:enable, :start]
+  supports :restart => true
+  subscribes :restart, "rails_port[www.openstreetmap.org]"
+  subscribes :restart, "systemd_service[rails-jobs]"
+end