난 당신이 database.yml을을 업데이트하고 애플리케이션 서버를 다시 시작합니다 사용자 정의 조리법을 정의해야합니다 생각합니다.
는 this guide에서 같은 일 예로서 레디 스 서버를 사용하여 수행됩니다 :
node[:deploy].each do |application, deploy|
if deploy[:application_type] != 'rails'
Chef::Log.debug("Skipping redis::configure as application #{application} as it is not an Rails app")
next
end
execute "restart Rails app #{application}" do
cwd deploy[:current_path]
command "touch tmp/restart.txt"
action :nothing
only_if do
File.exists?(deploy[:current_path])
end
end
redis_server = node[:opsworks][:layers][:redis][:instances].keys.first rescue nil
template "#{deploy[:deploy_to]}/current/config/redis.yml" do
source "redis.yml.erb"
mode "0660"
group deploy[:group]
owner deploy[:user]
variables(:host => (node[:opsworks][:layers][:redis][:instances][redis_server][:private_dns_name] rescue nil))
notifies :run, resources(:execute => "restart Rails app #{application}")
only_if do
File.directory?("#{deploy[:deploy_to]}/current")
end
end
end
나는 아직 자신이이 시험하지 않았다 그러나 나는 곧 내가 같은이 대답을 업데이트하려고합니다 것으로 예상 곧 내가하는 것처럼.