Sha256: 7de886b35bc2717166e3afca9042fdbf582436549cee4fb6030131eef7fa3b1e

Contents?: true

Size: 1.4 KB

Versions: 13

Compression:

Stored size: 1.4 KB

Contents

namespace :rubber do

  namespace :apache do
  
    rubber.allow_optional_tasks(self)

    after "rubber:install_packages", "rubber:apache:custom_install"

    task :custom_install, :roles => :apache do
      rsudo "a2dissite default"
    end

    # 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 => :apache do
        rsudo "service apache2 stop; service apache2 start"
      end
      rubber.serial_task self, :serial_reload, :roles => :apache do
        rsudo "if ! ps ax | grep -v grep | grep -c apache2 &> /dev/null; then service apache2 start; else service apache2 reload; fi"
      end
    end
    
    before "deploy:stop", "rubber:apache:stop"
    after "deploy:start", "rubber:apache:start"
    after "deploy:restart", "rubber:apache:reload"
    
    desc "Stops the apache web server"
    task :stop, :roles => :apache do
      rsudo "service apache2 stop || true"
    end
    
    desc "Starts the apache web server"
    task :start, :roles => :apache do
      rsudo "service apache2 start"
    end
    
    desc "Restarts the apache web server"
    task :restart, :roles => :apache do
      serial_restart
    end
  
    desc "Reloads the apache web server"
    task :reload, :roles => :apache do
      serial_reload
    end
  
  end

end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rubber-2.0.0 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre12 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre11 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre10 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre9 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre8 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre7 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre6 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre5 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre4 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre3 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre2 templates/apache/config/rubber/deploy-apache.rb
rubber-2.0.0.pre1 templates/apache/config/rubber/deploy-apache.rb