Created
July 3, 2014 19:42
-
-
Save mieciu/f9b6bc3c120da7f2fc55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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