lib/recipes/memcached.rb in capitate-0.1.9 vs lib/recipes/memcached.rb in capitate-0.2.1

- old
+ new

@@ -1,24 +1,30 @@ namespace :memcached do desc <<-DESC - Install memcached monit hooks. + Generate and install memcached monitrc. - memcached_pid_path: Path to memcached pid file. Defaults to /var/run/memcached.pid + *memcached_pid_path*: Path to memcached pid file. _Defaults to /var/run/memcached.pid_ - set :memcached_pid_path, "/var/run/memcached.pid" + @set :memcached_pid_path, "/var/run/memcached.pid"@ - memcached_port: Memcached port. Defaults to 11211. - - set :memcached_port, 11211 + *memcached_port*: Memcached port. _Defaults to 11211_ + + @set :memcached_port, 11211@ + + *monit_conf_dir*: Destination for monitrc. _Defaults to "/etc/monit"_ + + @set :monit_conf_dir, "/etc/monit"@ + DESC task :install_monit do # Settings fetch_or_default(:memcached_pid_path, "/var/run/memcached.pid") fetch_or_default(:memcached_port, 11211) + fetch_or_default(:monit_conf_dir, "/etc/monit") - put template.load("memcached/memcached.monitrc.erb", binding), "/tmp/memcached.monitrc" - sudo "install -o root /tmp/memcached.monitrc /etc/monit/memcached.monitrc" + put template.load("memcached/memcached.monitrc.erb"), "/tmp/memcached.monitrc" + run_via "install -o root /tmp/memcached.monitrc #{monit_conf_dir}/memcached.monitrc" end end \ No newline at end of file