'master' 3 set :rails_env, 'production' 4 5 require 'aws-sdk' 6 7 AWS.config( 8 access_key_id: ENV['AWS_ACCESS_KEY_ID'], 9 secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], 10 region: ‘{region}’ 11 ) 12 13 instances = AWS.ec2.instances.with_tag(:Name, ‘{instance_name}’).select{|i| i.status == :running}.map(&:dns_name) 14 15 role :app, instances, user: 'ubuntu' 16 role :web, instances, user: 'ubuntu' 17 role :db, instances.first, user: 'ubuntu' DPOpHEFQMPZQSPEVDUJPOSC