lib/recipes/centos/memcached.rb in capitate-0.1.9 vs lib/recipes/centos/memcached.rb in capitate-0.2.1
- old
+ new
@@ -3,42 +3,32 @@
namespace :centos do
desc <<-DESC
Install memcached.
- memcached_memory: Memcached memory (in MB).
-
- set :memcached_memory, 64
-
- memcached_pid_path: Path to memcached pid file. Defaults to /var/run/memcached.pid
-
- set :memcached_pid_path, "/var/run/memcached.pid"
-
- memcached_port: Memcached port. Defaults to 11211.
-
- set :memcached_port, 11211
-
+ *memcached_build_options*: Memcached build options.\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 options
- memcached_options = {
- :url => "http://www.danga.com/memcached/dist/memcached-1.2.4.tar.gz",
- :configure_options => "--prefix=/usr/local"
- }
-
# Build
- script.make_install("memcached", memcached_options)
+ script.make_install("memcached", memcached_build_options)
# Install initscript, service
put template.load("memcached/memcached.initd.centos.erb"), "/tmp/memcached.initd"
- sudo "install -o root /tmp/memcached.initd /etc/init.d/memcached && rm -f /tmp/memcached.initd"
- sudo "/sbin/chkconfig --level 345 memcached on"
+ 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
\ No newline at end of file