Skip to content

Instantly share code, notes, and snippets.

@glennpratt
Created June 30, 2011 23:22
Show Gist options
  • Select an option

  • Save glennpratt/1057533 to your computer and use it in GitHub Desktop.

Select an option

Save glennpratt/1057533 to your computer and use it in GitHub Desktop.
dev.rb
require 'json'
# User information for ec2 key pair.
set :user, 'ubuntu'
ssh_options[:keys] = [File.join(ENV["HOME"], ".ssh", "devallplayerscom.pem")]
# Get app server nodes in this environment.
data = JSON.parse(`knife search node "chef_environment:dev AND tags:app" -F json -a cloud.public_hostname`)
app_servers = []
data['rows'].each {|row| app_servers << row['cloud.public_hostname']}
role :app, *app_servers
# TODO
role :web, "www.dev.allplayers.com"
role :db
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment