Commit a2f96b46 by Andrew Babichev

Re-config sneakers monit service on fail

parent 4eec4195
...@@ -39,14 +39,23 @@ namespace :sneakers do ...@@ -39,14 +39,23 @@ namespace :sneakers do
desc 'Monitor Sneakers monit-service' desc 'Monitor Sneakers monit-service'
task :monitor do task :monitor do
on roles(fetch(:sneakers_roles)) do on roles(fetch(:sneakers_roles)) do
begin
sudo_if_needed "#{fetch(:monit_bin)} monitor #{sneakers_service_name}" sudo_if_needed "#{fetch(:monit_bin)} monitor #{sneakers_service_name}"
rescue
invoke 'sneakers:monit:config'
sudo_if_needed "#{fetch(:monit_bin)} monitor #{sneakers_service_name}"
end
end end
end end
desc 'Unmonitor Sneakers monit-service' desc 'Unmonitor Sneakers monit-service'
task :unmonitor do task :unmonitor do
on roles(fetch(:sneakers_roles)) do on roles(fetch(:sneakers_roles)) do
begin
sudo_if_needed "#{fetch(:monit_bin)} unmonitor #{sneakers_service_name}" sudo_if_needed "#{fetch(:monit_bin)} unmonitor #{sneakers_service_name}"
rescue
# no worries here
end
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment