Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Chef recipe to write redis.yml on Engine Yard Cloud
# ey-cloud-recipes/cookbooks/redis-yml/recipes/default.rb
if ['app_master', 'app'].include?(node[:instance_role])
redis_instance = node['utility_instances'].find { |instance| instance['name'] == 'redis' }
if redis_instance
node[:applications].each do |app, data|
template "/data/#{app}/shared/config/redis.yml"do
source 'redis.yml.erb'
owner node[:owner_name]
group node[:owner_name]
mode 0655
backup 0
variables({
:environment => node[:environment][:framework_env],
:hostname => redis_instance[:hostname]
})
end
end
end
end
# ey-cloud-recipes/cookbooks/redis-yml/templates/default/redis.yml.erb
<%= @environment %>:
host: <%= @hostname %>
port: 6379
@ghost

This comment has been minimized.

Copy link

commented Nov 28, 2012

Do these files get added to the right place automatically or would I need to copy these over manually? I'm specifically talking about redis.yml.erb, which doesn't seem to show up after applying the custom recipes. I've created config/redis.yml with a development environment setting, but the file is never overwritten in production.

@hoenth

This comment has been minimized.

Copy link

commented Nov 2, 2013

I am having the same issue using the same recipe. Were you able to figure it out? The recipe matches the api-keys recipe that works fine.

@parhamr

This comment has been minimized.

Copy link

commented Jan 9, 2014

Should this logic also include node[:instance_role] == 'solo', to also function for a small staging environment?

@takjared

This comment has been minimized.

Copy link

commented Apr 21, 2014

Anyone here have any luck with this recipe?

@takjared

This comment has been minimized.

Copy link

commented Apr 22, 2014

UPDATE AFTER SPEAKING W ENGINE YARD

@parhamr - you are correct. That was one problem. The second problem was an issue with the redis recipe:

Needed to change (this may be updated at this point) redis/templates/default/redis.monitrc.erb to:

check process redis-<%= @profile %>
with pidfile <%= @pidfile %>
  start program = "/usr/sbin/redis-server <%= @configfile %>"
  stop program = "/usr/bin/redis-cli -p <%= @port %> shutdown"
  group redis-util

The problem was that start program was looking at /usr/bin/ instead of /usr/sbin/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.