Skip to content

Instantly share code, notes, and snippets.

@jweiss
Last active January 4, 2016 21:09
Show Gist options
  • Select an option

  • Save jweiss/8679122 to your computer and use it in GitHub Desktop.

Select an option

Save jweiss/8679122 to your computer and use it in GitHub Desktop.
redis_port = '6379'
redis_server = node[:opsworks][:layers][:redis][:instances].keys.first rescue nil
if redis_server
node[:deploy].each do |app, config|
template "#{node[:deploy][app][:deploy_to]}/current/config/redis.yml" do
variables :ip => redis_server[:private_ip], :port => redis_port
notifies :restart, resources(:service => 'tomcat')
only_if do
File.exists?("#{node[:deploy][app][:deploy_to]}/current/config/")
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment