Sha256: fd9c83847c2b38522e788f5118933cff54b04ca3b5651f159fea3f4c3a0fc772

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

namespace :mongrel_cluster do 
  
  namespace :centos do
    
    desc <<-DESC
    Create mongrel cluster.
    
    mongrel_size: Number of mongrels.
    
      set :mongrel_size, 3

    mongrel_port: Starting port for mongrels. If there are 3 mongrels with port 9000, then instances will be at 
      9000, 9001, and 9002
      
      set :mongrel_port, 9000      
      
    DESC
    task :setup do 

      # Settings
      fetch(:mongrel_size)
      fetch(:mongrel_port)
      
      run "mkdir -p #{shared_path}/config"

      # Mongrel cluster config needs its own config directory
      mongrel_config_path = "#{shared_path}/config/mongrel" 
      run "mkdir -p #{mongrel_config_path}"

      pid_path = "#{shared_path}/pids"

      put template.load("mongrel/mongrel_cluster.initd.erb", binding), "/tmp/mongrel_cluster_#{application}.initd"    
      put template.load("mongrel/mongrel_cluster.yml.erb", binding), "#{mongrel_config_path}/mongrel_cluster.yml"

      # Setup the mongrel_cluster init script
      sudo "install -o root /tmp/mongrel_cluster_#{application}.initd /etc/init.d/mongrel_cluster_#{application}"

      sudo "/sbin/chkconfig --level 345 mongrel_cluster_#{application} on"
    end
    
    
  end
  
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capitate-0.1.8 lib/recipes/centos/mongrel_cluster.rb
capitate-0.1.9 lib/recipes/centos/mongrel_cluster.rb