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

Version Path
sml-rubber-0.9.1 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.10 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.11 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.13 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.3 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.4 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.5 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.6 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.7 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.8 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
sml-rubber-0.9.9 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
wr0ngway-rubber-1.0.0 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
wr0ngway-rubber-1.0.1 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
axtro-rubber-1.2.3 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
axtro-rubber-1.2.2 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.2.1 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
axtro-rubber-1.2.1 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
axtro-rubber-1.2.0 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
axtro-rubber-1.0.2.8 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
axtro-rubber-1.0.2.7 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb