Skip to content

Instantly share code, notes, and snippets.

@quocble
Created September 20, 2012 09:19
Show Gist options
  • Save quocble/3754866 to your computer and use it in GitHub Desktop.
Save quocble/3754866 to your computer and use it in GitHub Desktop.
Simple Chef Recipe for Redis
package "redis-server"
ruby_block "redis-conf" do
block do
filename = "/etc/redis/redis.conf"
if File::exists?(filename)
redisConf = File.read(filename)
redisConf = redisConf.gsub(/bind .*/, "bind 0.0.0.0")
File.open(filename, 'w') {|f| f.write(redisConf) }
end
end
action :create
end
service "redis-server" do
action :restart
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment