Sha256: e2367412437a1aa8bff9a75295da80edac0630ca3a760b1894b26d08e5f25fc6

Contents?: true

Size: 1.23 KB

Versions: 80

Compression:

Stored size: 1.23 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
        rsudo "service haproxy restart"
      end
      rubber.serial_task self, :serial_reload, :roles => :haproxy do
        rsudo "if ! ps ax | grep -v grep | grep -c haproxy &> /dev/null; then service haproxy start; else service 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 do
      rsudo "service haproxy stop; exit 0"
    end
    
    desc "Starts the haproxy server"
    task :start, :roles => :haproxy do
      rsudo "service 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

80 entries across 40 versions & 6 rubygems

Version Path
rubber-1.15.0 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.15.0 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.14.1 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.14.1 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.14.0 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.14.0 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.13.2 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.13.2 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.13.1 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.13.1 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.13.0 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.13.0 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.12.2 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.12.2 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.12.1 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.12.1 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.12.0 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.12.0 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.11.0 lib/generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb
rubber-1.11.0 generators/vulcanize/templates/haproxy/config/rubber/deploy-haproxy.rb