Skip to content

Instantly share code, notes, and snippets.

@scalp42
Last active December 14, 2015 23:18
Chef - Redis version attribute to use in a wrapper cookbook
require "net/http"
require "uri"
require "json"
redis_info = URI.parse("http://www.askcerebro.com/redis")
response = Net::HTTP.get_response(redis_info)
info = JSON.parse(response.body)
redis_version = info['redis']['stable']['version']
default[:redis][:server][:addr] = "127.0.0.1"
default[:redis][:server][:version] = redis_version.chomp!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment