Commit cf0309ca by Andrew Babichev

Rename sneakers_monit_bin to monit_bin

parent acee972a
...@@ -32,7 +32,7 @@ Configurable options, shown here with defaults: ...@@ -32,7 +32,7 @@ Configurable options, shown here with defaults:
# sneakers monit # sneakers monit
:sneakers_monit_conf_dir => '/etc/monit/conf.d' :sneakers_monit_conf_dir => '/etc/monit/conf.d'
:sneakers_monit_use_sudo => true :sneakers_monit_use_sudo => true
:sneakers_monit_bin => '/usr/bin/monit' :monit_bin => '/usr/bin/monit'
:sneakers_monit_templates_path => 'config/deploy/templates' :sneakers_monit_templates_path => 'config/deploy/templates'
``` ```
......
namespace :load do namespace :load do
task :defaults do task :defaults do
set :monit_bin, '/usr/bin/monit'
set :sneakers_monit_default_hooks, true set :sneakers_monit_default_hooks, true
set :sneakers_monit_conf_dir, -> { '/etc/monit/conf.d' } set :sneakers_monit_conf_dir, -> { '/etc/monit/conf.d' }
set :sneakers_monit_use_sudo, true set :sneakers_monit_use_sudo, true
set :sneakers_monit_bin, '/usr/bin/monit'
set :sneakers_monit_templates_path, 'config/deploy/templates' set :sneakers_monit_templates_path, 'config/deploy/templates'
end end
end end
...@@ -32,42 +32,42 @@ namespace :sneakers do ...@@ -32,42 +32,42 @@ namespace :sneakers do
mv_command = "mv #{fetch(:tmp_dir)}/monit.conf #{fetch(:sneakers_monit_conf_dir)}/#{sneakers_service_name}.conf" mv_command = "mv #{fetch(:tmp_dir)}/monit.conf #{fetch(:sneakers_monit_conf_dir)}/#{sneakers_service_name}.conf"
sudo_if_needed mv_command sudo_if_needed mv_command
sudo_if_needed "#{fetch(:sneakers_monit_bin)} reload" sudo_if_needed "#{fetch(:monit_bin)} reload"
end end
end end
desc 'Monitor Sneakers monit-service' desc 'Monitor Sneakers monit-service'
task :monitor do task :monitor do
on roles(fetch(:sneakers_role)) do on roles(fetch(:sneakers_role)) do
sudo_if_needed "#{fetch(:sneakers_monit_bin)} monitor #{sneakers_service_name}" sudo_if_needed "#{fetch(:monit_bin)} monitor #{sneakers_service_name}"
end end
end end
desc 'Unmonitor Sneakers monit-service' desc 'Unmonitor Sneakers monit-service'
task :unmonitor do task :unmonitor do
on roles(fetch(:sneakers_role)) do on roles(fetch(:sneakers_role)) do
sudo_if_needed "#{fetch(:sneakers_monit_bin)} unmonitor #{sneakers_service_name}" sudo_if_needed "#{fetch(:monit_bin)} unmonitor #{sneakers_service_name}"
end end
end end
desc 'Start Sneakers monit-service' desc 'Start Sneakers monit-service'
task :start do task :start do
on roles(fetch(:sneakers_role)) do on roles(fetch(:sneakers_role)) do
sudo_if_needed "#{fetch(:sneakers_monit_bin)} start #{sneakers_service_name}" sudo_if_needed "#{fetch(:monit_bin)} start #{sneakers_service_name}"
end end
end end
desc 'Stop Sneakers monit-service' desc 'Stop Sneakers monit-service'
task :stop do task :stop do
on roles(fetch(:sneakers_role)) do on roles(fetch(:sneakers_role)) do
sudo_if_needed "#{fetch(:sneakers_monit_bin)} stop #{sneakers_service_name}" sudo_if_needed "#{fetch(:monit_bin)} stop #{sneakers_service_name}"
end end
end end
desc 'Restart Sneakers monit-service' desc 'Restart Sneakers monit-service'
task :restart do task :restart do
on roles(fetch(:sneakers_role)) do on roles(fetch(:sneakers_role)) do
sudo_if_needed "#{fetch(:sneakers_monit_bin)} restart #{sneakers_service_name}" sudo_if_needed "#{fetch(:monit_bin)} restart #{sneakers_service_name}"
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