Last active
December 14, 2015 23:18
-
-
Save scalp42/5164178 to your computer and use it in GitHub Desktop.
Chef - Redis version attribute to use in a wrapper cookbook
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
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