Sha256: a33a0db714fb7847aa85d6da5882af30532cdd11622aed1a22c3e757407517f7
Contents?: true
Size: 1.26 KB
Versions: 37
Compression:
Stored size: 1.26 KB
Contents
namespace :rubber do namespace :haproxy do rubber.allow_optional_tasks(self) # serial_task can only be called after roles defined - not normally a problem, but # rubber auto-roles don't get defined till after all tasks are defined on :load do rubber.serial_task self, :serial_restart, :roles => :haproxy do run "/etc/init.d/haproxy restart" end rubber.serial_task self, :serial_reload, :roles => :haproxy do run "if ! ps ax | grep -v grep | grep -c haproxy &> /dev/null; then /etc/init.d/haproxy start; else /etc/init.d/haproxy reload; fi" end end before "deploy:stop", "rubber:haproxy:stop" after "deploy:start", "rubber:haproxy:start" after "deploy:restart", "rubber:haproxy:reload" desc "Stops the haproxy server" task :stop, :roles => :haproxy, :on_error => :continue do run "/etc/init.d/haproxy stop" end desc "Starts the haproxy server" task :start, :roles => :haproxy do run "/etc/init.d/haproxy start" end desc "Restarts the haproxy server" task :restart, :roles => :haproxy do serial_restart end desc "Reloads the haproxy web server" task :reload, :roles => :haproxy do serial_reload end end end
Version data entries
37 entries across 37 versions & 5 rubygems