toquen 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -1
- data/lib/toquen/aws.rb +1 -1
- data/lib/toquen/capistrano.rb +22 -0
- data/lib/toquen/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba05c3cff5f5aebcb43a18ad9e4bb40f21dbfd61
|
4
|
+
data.tar.gz: 5b3b541003443108fd84341f93e1006004e7eefe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
##
|
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
|
data/lib/toquen/aws.rb
CHANGED
@@ -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,
|
data/lib/toquen/capistrano.rb
CHANGED
@@ -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')
|
data/lib/toquen/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capistrano
|