infra-ctrl 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +19 -19
- data/ctrl.gemspec +5 -6
- data/lib/ctrl/instance_selector.rb +1 -0
- data/lib/ctrl/ssh_command.rb +4 -4
- data/lib/ctrl/version.rb +1 -1
- metadata +17 -32
- data/README.rdoc +0 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 61af13373a9219c1b84f2a2d74f50f901e138c2f
|
4
|
+
data.tar.gz: 494a698e36789034a631ae9fe79229fa03321672
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 78b5125f1480b3cdb4fe148bec8a7282ac092e38ba15cb0d035c5dfaf7b221ec1fe40ea2d836ea4f3c2650dd14b2adb7654221918d0afe8ca6d7b349e7acf95d
|
7
|
+
data.tar.gz: f6e58b7da91de9652aa324db7053415697b52985529beb5d3eea9acf06808ecdc745ef9c477d93f1754a46c933c31cf53cb67278a4ff483b3adcfcde2951a442
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -1,36 +1,36 @@
|
|
1
1
|
# Ctrl
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
TODO: Delete this and the text above, and describe your gem
|
3
|
+
This is a simple gem to ease listing and sshing to instances in an AWS VPC.
|
6
4
|
|
7
5
|
## Installation
|
8
6
|
|
9
|
-
|
10
|
-
|
11
|
-
```ruby
|
12
|
-
gem 'ctrl'
|
13
|
-
```
|
7
|
+
$ gem install infra-ctrl
|
14
8
|
|
15
|
-
|
9
|
+
Add environment variables for AWS (direnv.net FTW):
|
16
10
|
|
17
|
-
|
11
|
+
* AWS_DEFAULT_REGION
|
12
|
+
* AWS_SECRET_ACCESS_KEY
|
13
|
+
* AWS_ACCESS_KEY_ID
|
18
14
|
|
19
|
-
|
15
|
+
As well as a couple for specifying the users to log in as when sshing to the nat and internal instances:
|
20
16
|
|
21
|
-
|
17
|
+
* CTRL_SSH_USER
|
18
|
+
* CTRL_SSH_NAT_USER
|
22
19
|
|
23
|
-
##
|
20
|
+
## Notes
|
24
21
|
|
25
|
-
|
22
|
+
Assumptions about your infrastructure:
|
26
23
|
|
27
|
-
|
24
|
+
1. Instances with public ips are connected to directly using the CTRL_SSH_USER
|
25
|
+
2. Each instance has a tag:Environment
|
26
|
+
3. VPC private instances use the same user to log in
|
27
|
+
4. You have the necessary keys locally, and are fine forwarding your agent
|
28
28
|
|
29
|
-
|
29
|
+
## Usage
|
30
30
|
|
31
|
-
|
31
|
+
$ ctrl ls <env> <instance name>
|
32
|
+
$ ctrl ssh <env> <instance name>
|
32
33
|
|
33
34
|
## Contributing
|
34
35
|
|
35
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
36
|
-
|
36
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/MattHall/ctrl
|
data/ctrl.gemspec
CHANGED
@@ -5,7 +5,7 @@ require 'ctrl/version'
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "infra-ctrl"
|
8
|
-
spec.license=""
|
8
|
+
spec.license = "MIT"
|
9
9
|
spec.version = Ctrl::VERSION
|
10
10
|
spec.authors = ["Matt Hall"]
|
11
11
|
spec.email = ["matt@codebeef.com"]
|
@@ -19,14 +19,13 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = ["ctrl"]
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "virtus"
|
23
|
-
spec.add_dependency('methadone', '~> 1.9
|
22
|
+
spec.add_dependency "virtus", '~> 1.0'
|
23
|
+
spec.add_dependency('methadone', '~> 1.9')
|
24
24
|
spec.add_dependency('aws-sdk', '~> 2')
|
25
25
|
|
26
26
|
spec.add_development_dependency "bundler", "~> 1.12"
|
27
27
|
spec.add_development_dependency "rake", "~> 10.0"
|
28
28
|
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
-
spec.add_development_dependency('
|
30
|
-
spec.add_development_dependency('
|
31
|
-
spec.add_development_dependency('pry')
|
29
|
+
spec.add_development_dependency('aruba', "~> 0.14")
|
30
|
+
spec.add_development_dependency('pry', "0.14")
|
32
31
|
end
|
data/lib/ctrl/ssh_command.rb
CHANGED
@@ -8,12 +8,12 @@ module Ctrl
|
|
8
8
|
attribute :nat_instance
|
9
9
|
attribute :target_instance
|
10
10
|
|
11
|
-
def
|
12
|
-
|
11
|
+
def target_is_public?
|
12
|
+
target_instance.public_ip_address.to_s != ""
|
13
13
|
end
|
14
14
|
|
15
15
|
def direct_cmd
|
16
|
-
"ssh -A #{SSH_USER}@#{
|
16
|
+
"ssh -A #{SSH_USER}@#{target_instance.public_ip_address}"
|
17
17
|
end
|
18
18
|
|
19
19
|
def proxied_cmd
|
@@ -21,7 +21,7 @@ module Ctrl
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def to_s
|
24
|
-
return direct_cmd if
|
24
|
+
return direct_cmd if target_is_public?
|
25
25
|
proxied_cmd
|
26
26
|
end
|
27
27
|
end
|
data/lib/ctrl/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: infra-ctrl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Hall
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0'
|
19
|
+
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0'
|
26
|
+
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: methadone
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.9
|
33
|
+
version: '1.9'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.9
|
40
|
+
version: '1.9'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: aws-sdk
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -94,48 +94,34 @@ dependencies:
|
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rdoc
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: aruba
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
114
100
|
requirements:
|
115
|
-
- - "
|
101
|
+
- - "~>"
|
116
102
|
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
103
|
+
version: '0.14'
|
118
104
|
type: :development
|
119
105
|
prerelease: false
|
120
106
|
version_requirements: !ruby/object:Gem::Requirement
|
121
107
|
requirements:
|
122
|
-
- - "
|
108
|
+
- - "~>"
|
123
109
|
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
110
|
+
version: '0.14'
|
125
111
|
- !ruby/object:Gem::Dependency
|
126
112
|
name: pry
|
127
113
|
requirement: !ruby/object:Gem::Requirement
|
128
114
|
requirements:
|
129
|
-
- -
|
115
|
+
- - '='
|
130
116
|
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
117
|
+
version: '0.14'
|
132
118
|
type: :development
|
133
119
|
prerelease: false
|
134
120
|
version_requirements: !ruby/object:Gem::Requirement
|
135
121
|
requirements:
|
136
|
-
- -
|
122
|
+
- - '='
|
137
123
|
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
124
|
+
version: '0.14'
|
139
125
|
description: Simple way to ls / ssh into vpns
|
140
126
|
email:
|
141
127
|
- matt@codebeef.com
|
@@ -149,7 +135,6 @@ files:
|
|
149
135
|
- Gemfile
|
150
136
|
- Gemfile.lock
|
151
137
|
- README.md
|
152
|
-
- README.rdoc
|
153
138
|
- Rakefile
|
154
139
|
- bin/console
|
155
140
|
- bin/ctrl
|
@@ -165,7 +150,7 @@ files:
|
|
165
150
|
- lib/ctrl/version.rb
|
166
151
|
homepage: https://github.com/MattHall/ctrl
|
167
152
|
licenses:
|
168
|
-
-
|
153
|
+
- MIT
|
169
154
|
metadata: {}
|
170
155
|
post_install_message:
|
171
156
|
rdoc_options: []
|
data/README.rdoc
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
= ctrl - DESCRIBE YOUR GEM
|
2
|
-
|
3
|
-
Author:: YOUR NAME (YOUR EMAIL)
|
4
|
-
Copyright:: Copyright (c) 2016 YOUR NAME
|
5
|
-
|
6
|
-
|
7
|
-
DESCRIBE YOUR GEM HERE
|
8
|
-
|
9
|
-
== Links
|
10
|
-
|
11
|
-
* {Source on Github}[LINK TO GITHUB]
|
12
|
-
* RDoc[LINK TO RDOC.INFO]
|
13
|
-
|
14
|
-
== Install
|
15
|
-
|
16
|
-
== Examples
|
17
|
-
|
18
|
-
== Contributing
|
19
|
-
|