Project

ey_info

0.0
No commit activity in last 3 years
No release in over 3 years
Ey Info - Easy way to setup ssh keys for ey cloud servers and also to dynamically pull server information from your ey servers and just it within capistrano.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

= 1.4.18
 Project Readme

Ey Info

Summary

Quickly set up your ~/.ssh/config shortcuts for your ey cloud servers.

Install

gem install --no-ri --no-rdoc ey_info # sudo if you need to

Usage Command Line

# will set up your ~/ssh/config shortcuts.
$ ey_info -i "id_rsa" -u "root" # same as defaults
$ ey_info # same as above

If you're environment in the ey cloud dashboard is called 'production' with an app_master, and 2 app instances.

$ ssh production_app_master
vs
$ ssh -i ~/.ssh/id-rsa root@ec2-xxx-xxx-xxx-xxx.compute-1.amazonaws.com

$ ssh production_app1
$ ssh production_app2
$ ssh production_db_master
$ ssh production_db_slave1

Usage With Capistrano

I still find capistrano a very useful utility for debugging and still use wanted to use it with EY's cloud.

$ cap invoke COMMAND="..." is extremely useful.  The engineyard gem provides a 
"ey ssh 'uptime' --all -e production" command but it loops through the servers one by one instead of running
the commands in parallel, which can be slow if you have lots of servers.

You can use this gem to dynamically grab the ec2 hosts information from your ey environment and set up your capistrano roles.

Here are a few examples of how you can use it in your config/deploy.rb:

require 'ey_info'
task :production do
  @info = EyInfo::Hosts.new
  hosts = @info.hosts("production") # parameter is the environment name in EY's gui interface

  role :db, hosts.find {|x| x[:role] == "app_master" }[:ssh_key], :primary => true
  # app instances
  hosts.select {|x| x[:role] =~ /app/ }.each do |h|
    role :web, h[:ssh_key]
    role :app, h[:ssh_key], :sphinx => true
  end
  # utility instances
  hosts.select {|x| x[:role] =~ /util/ }.each do |h|
    role :web, h[:ssh_key]
    role :app, h[:ssh_key], :sphinx => true
  end
end