Skip to content

Instantly share code, notes, and snippets.

@deepthawtz
Created August 28, 2010 03:06
Show Gist options
  • Select an option

  • Save deepthawtz/554624 to your computer and use it in GitHub Desktop.

Select an option

Save deepthawtz/554624 to your computer and use it in GitHub Desktop.
require "dnapi"
run "sudo cp /etc/chef/dna.json /tmp/dna.json && sudo chmod 777 /tmp/dna.json && sync"
def engineyard
@engineyard ||= DNApi.from(File.read("/tmp/dna.json"))
end
b=engineyard.environment.utility_instances.find {|x| x.name.include? "redis"}
engineyard.apps.each do |app|
begin
run "echo host: #{b.public_hostname} > /data/#{app.name}/current/config/redis.yml"
rescue
run "echo host: localhost > /data/#{app.name}/current/config/redis.yml"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment