toquen 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3e35803c6014457d4b1865f9e08af7b8a50e6a04
4
- data.tar.gz: 2c93235e6285491b42b7ff9d7763758ace466644
3
+ metadata.gz: ba05c3cff5f5aebcb43a18ad9e4bb40f21dbfd61
4
+ data.tar.gz: 5b3b541003443108fd84341f93e1006004e7eefe
5
5
  SHA512:
6
- metadata.gz: b5a596381ae877a688a92002902bfd3b8768de58bbb0c32d1738da439de32d40b4ed21c9f84a87aba022cb306fadd62bdad5a6ee4115e98870a7514ef9a04eaa
7
- data.tar.gz: 10893f1b36c9e4422519f384f3d5cb638344412303d54a4fbf8bb9eabdfa883bfb11531ea201f7d3fbdf91ad28eb40d629e9e6f24c31e9348273bda4a56a749f
6
+ metadata.gz: 9b3c4d4ed2941bd43fab04f815517e236ee9303807f0dc35fec2e85cc84532bf37342d6a1f0c4ee194b2ec654f159fd306792622fff2b3735e4aaa65a7c1043f
7
+ data.tar.gz: 3ecb5c8fe475b96b940323125718db039844a7a9800374b4d491de39189be7a74daef4948300aee85f6e714698924325c44773c93b05604b7eeb40437ec8f385
data/README.md CHANGED
@@ -135,7 +135,14 @@ Or for a given server with:
135
135
  cap server-<server name> details
136
136
  ```
137
137
 
138
- ## Open SSH to Current Machine
138
+ ## SSH Into Server
139
+ To SSH into a server, use the *ssh* cap task. It will handle execing SSH with the correct paths to keys.
140
+
141
+ ```shell
142
+ cap <role> ssh
143
+ ```
144
+
145
+ ## Open SSH in Security Group to Current Machine
139
146
  To allow an SSH connection from your current machine (based on your internet visible IP, as determined using [this method](http://findingscience.com/internet/ruby/2014/05/17/stunning:-determining-your-public-ip.html)), use the open_ssh/close_ssh capistrano tasks.
140
147
 
141
148
  ```shell
@@ -89,7 +89,7 @@ module Toquen
89
89
  def server_details_in(region)
90
90
  AWS.config(:access_key_id => @key_id, :secret_access_key => @key, :region => region)
91
91
  AWS.memoize do
92
- AWS::EC2.new.instances.map do |i|
92
+ AWS::EC2.new.instances.filter("instance-state-name", "running").map do |i|
93
93
  {
94
94
  :id => i.tags["Name"],
95
95
  :internal_ip => i.private_ip_address,
@@ -26,6 +26,28 @@ task :update_roles do
26
26
  Toquen::LocalWriter.superfluous_check!(servers, roles.keys)
27
27
  end
28
28
 
29
+ desc "SSH into a specific server"
30
+ task :ssh do
31
+ hosts = []
32
+ on roles(:all) do |host|
33
+ run_locally { hosts << host.hostname }
34
+ end
35
+
36
+ run_locally do
37
+ if hosts.length == 0
38
+ warn "No server matched that role"
39
+ elsif hosts.length > 1
40
+ warn "More than one server matched that role"
41
+ else
42
+ keys = fetch(:ssh_options)[:keys]
43
+ keyoptions = keys.map { |key| "-i #{key}" }.join(' ')
44
+ cmd = "ssh #{keyoptions} #{fetch(:ssh_options)[:user]}@#{hosts.first}"
45
+ info "Running #{cmd}"
46
+ exec cmd
47
+ end
48
+ end
49
+ end
50
+
29
51
  desc "send up apps.json config file"
30
52
  task :update_appconfig do
31
53
  return unless File.exists?('config/apps.json')
@@ -1,3 +1,3 @@
1
1
  module Toquen
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: toquen
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Muller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-06 00:00:00.000000000 Z
11
+ date: 2014-11-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano