Skip to content

Instantly share code, notes, and snippets.

@mieciu
Created July 3, 2014 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mieciu/f9b6bc3c120da7f2fc55 to your computer and use it in GitHub Desktop.
Save mieciu/f9b6bc3c120da7f2fc55 to your computer and use it in GitHub Desktop.
package "build-essential" do
action :install
end
bash "compile_redis_source" do
cwd Chef::Config[:file_cache_path]
code <<-EOH
tar zxf redis.tar.gz
cd antirez-redis-55479a7
make && make install
EOH
creates "/usr/local/bin/redis-server"
end
service "redis" do
provider Chef::Provider::Service::Upstart
subscribes :restart, resources(:bash => "compile_redis_source")
supports :restart => true, :start => true, :stop => true
end
template "redis.conf" do
path "#{node[:redis][:dir]}/redis.conf"
source "redis.conf.erb"
owner "root"
group "root"
mode "0644"
notifies :restart, resources(:service => "redis")
end
service "redis" do
action [:enable, :start]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment