Sha256: 61c361ef778eedbdc30251f9dc20e29db070a821fabff80b866909f2e57bfae5

Contents?: true

Size: 1.3 KB

Versions: 3

Compression:

Stored size: 1.3 KB

Contents

namespace :memcached do 
  
  namespace :centos do
    
    desc <<-DESC
    Install memcached.
    
    *memcached_build_options*: Memcached build options.\n
    <pre>
    set :memcached_build_options, {
      :url => "http://www.danga.com/memcached/dist/memcached-1.2.4.tar.gz",
      :configure_options => "--prefix=/usr/local"
    }
    </pre>\n
    *memcached_memory*: Memcached memory (in MB).\n    
    @set :memcached_memory, 64@\n
    *memcached_pid_path*: Path to memcached pid file. Defaults to /var/run/memcached.pid\n    
    @set :memcached_pid_path, "/var/run/memcached.pid"@\n
    *memcached_port*: Memcached port. Defaults to 11211.\n    
    @set :memcached_port, 11211@\n      
    DESC
    task :install do

      # Settings
      fetch_or_default(:memcached_pid_path, "/var/run/memcached.pid")
      fetch_or_default(:memcached_port, 11211)
      fetch(:memcached_memory)      
      fetch(:memcached_build_options)

      # Build
      build.make_install("memcached", memcached_build_options)

      # Install initscript, service
      put template.load("memcached/memcached.initd.centos.erb"), "/tmp/memcached.initd"
      run_via "install -o root /tmp/memcached.initd /etc/init.d/memcached && rm -f /tmp/memcached.initd"
      run_via "/sbin/chkconfig --level 345 memcached on"

    end
    
  end
  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
capitate-0.2.11 lib/recipes/centos/memcached.rb
capitate-0.2.8 lib/recipes/centos/memcached.rb
capitate-0.2.7 lib/recipes/centos/memcached.rb