File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,14 @@ Note: Mac users with the latest version of XCode may run into a compilation err
2727 -l, --login [USER] Log in with this user
2828 -t, --tags [TAGS] a 'space' sparated key value pair of tags and values (i.e. -t 'role=web,database environment=dev')
2929 -r, --region [REGION] AWS region
30+ -o, --options [SSH_OPTIONS] ssh options to pass directly to cssh
3031 -s, --screen [SCREEN] What screen to use for clustering windows (form multiple displays)
3132 -p, --use-public-ip Use public IP (default false)
3233
3334
3435 $cluster -t Name=web,database #Connects to all web and database servers
3536 $cluster -t 'role=web,database environment=dev' #Connects to all web and database servers in the dev environment
37+ $cluster -t 'role=web,database environment=dev' -o"-i /Path/to/key.pem" # connect using explicit private key
3638
3739## Notes
3840
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ options = {
1010}
1111
1212OptionParser . new do |opts |
13- opts . banner = "Usage: cluster [-t TAGS] [-l USER] [-k KEY -s SECRET] [-r region]"
13+ opts . banner = "Usage: cluster [-t TAGS] [-l USER] [-k KEY -s SECRET] [-r region] [-o SSH_OPTIONS] "
1414
1515 opts . on ( "-l" , "--login [USER]" , "Log in with this user" ) do |opt |
1616 options [ 'user' ] = opt
@@ -32,6 +32,11 @@ OptionParser.new do |opts|
3232 options [ 'use_public_ip' ] = true
3333 end
3434
35+ #Allow -o to be passed to give specific ssh options
36+ opts . on ( "-o" , "--options [SSH_OPTIONS]" , "ssh options to pass directly to cssh" ) do |opt |
37+ options [ 'SSH_OPTIONS' ] = opt
38+ end
39+
3540end . parse!
3641
3742Aws . config . update ( { :region => options [ 'region' ] } )
8085cssh = ( /darwin/ =~ RUBY_PLATFORM ) ? 'csshX' : 'cssh'
8186
8287cmd = "#{ cssh } "
88+ cmd = cmd + " --ssh_args '#{ options [ 'SSH_OPTIONS' ] } '"
8389cmd = cmd + " -l #{ options [ 'user' ] } " unless options [ 'user' ] . nil?
8490cmd = cmd + " -screen #{ options [ 'screen' ] } " unless options [ 'screen' ] . nil?
8591cmd = cmd + " #{ matched_instances . join ' ' } "
You can’t perform that action at this time.
0 commit comments