mode 0o755
end
+ ruby_version = node[:passenger][:ruby_version]
+
+ systemd_service "rails-jobs@" do
+ description "Rails job queue runner"
+ type "simple"
+ user "apis"
+ working_directory "/srv/%i.apis.dev.openstreetmap.org/rails"
+ exec_start "/usr/local/bin/bundle#{ruby_version} exec rake jobs:work"
+ restart "on-failure"
+ private_tmp true
+ private_devices true
+ protect_system "full"
+ protect_home true
+ no_new_privileges true
+ end
+
systemd_service "cgimap@" do
description "OpenStreetMap API Server"
type "forking"
end
rails_port site_name do
- ruby node[:passenger][:ruby_version]
+ ruby ruby_version
directory rails_directory
user "apis"
group "apis"
notifies :restart, "rails_port[#{site_name}]"
end
+ service "rails-jobs@#{name}" do
+ action [:enable, :start]
+ supports :restart => true
+ subscribes :restart, "rails_port[#{site_name}]"
+ subscribes :restart, "systemd_service[#{name}]"
+ only_if "fgrep -q delayed_job #{rails_directory}/Gemfile.lock"
+ end
+
if details[:cgimap_repository]
git cgimap_directory do
action :sync
group "root"
mode 0o644
end
+
+service "rails-jobs" do
+ action [:enable, :start]
+ supports :restart => true
+ subscribes :restart, "rails_port[www.openstreetmap.org]"
+ subscribes :restart, "systemd_service[rails-jobs]"
+end
mode 0o755
end
+ruby_version = node[:passenger][:ruby_version]
rails_directory = "#{node[:web][:base_directory]}/rails"
piwik = data_bag_item("web", "piwik")
rails_port "www.openstreetmap.org" do
- ruby node[:passenger][:ruby_version]
+ ruby ruby_version
directory rails_directory
user "rails"
group "rails"
csp_enforce true
end
+systemd_service "rails-jobs" do
+ description "Rails job queue runner"
+ type "simple"
+ user "rails"
+ working_directory rails_directory
+ exec_start "/usr/local/bin/bundle#{ruby_version} exec rake jobs:work"
+ restart "on-failure"
+ private_tmp true
+ private_devices true
+ protect_system "full"
+ protect_home true
+ no_new_privileges true
+end
+
package "libjson-xs-perl"
template "/usr/local/bin/cleanup-rails-assets" do