pec2 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/README.md +0 -2
- data/Rakefile +0 -4
- data/lib/pec2/cli.rb +2 -1
- data/lib/pec2/ec2.rb +18 -3
- data/lib/pec2/pssh.rb +1 -1
- data/lib/pec2/version.rb +1 -1
- data/pec2.gemspec +0 -1
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d68073713d2afa54a74a21dacb7c053408222bd4c954a82dfd719d385f04bc46
|
4
|
+
data.tar.gz: e7e5a0d53e551c82008c2bddb65701e4067aa412bceb2e6be3ea817786e2035d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1383b7b694915836ef9ba0b66a51f496d05c0190e54709823ba0538f8ad755db85f76442a603b1ce683792fb313ff9c088ca758c33c7f9cf7353f6127d98a2b3
|
7
|
+
data.tar.gz: 57064f09a63ad1da242319622637b3f571d2aa86529421264c159d84cac9a5c3e02d24847b035939fb3d6fc4d5e98bbb1955d4ff89e03320109ecdb57b44e455
|
data/README.md
CHANGED
data/Rakefile
CHANGED
data/lib/pec2/cli.rb
CHANGED
@@ -8,10 +8,11 @@ module Pec2
|
|
8
8
|
map '-v' => :version
|
9
9
|
default_task :run_command
|
10
10
|
|
11
|
+
class_option :profile, type: :string, default: nil, desc: 'profile'
|
11
12
|
def initialize(args = [], options = {}, config = {})
|
12
13
|
super(args, options, config)
|
13
14
|
@global_options = config[:shell].base.options
|
14
|
-
@core = Ec2.new
|
15
|
+
@core = Ec2.new(profile: @global_options[:profile])
|
15
16
|
@logger = Logger.new(STDOUT)
|
16
17
|
end
|
17
18
|
|
data/lib/pec2/ec2.rb
CHANGED
@@ -12,10 +12,9 @@ end
|
|
12
12
|
module Pec2
|
13
13
|
class Ec2
|
14
14
|
|
15
|
-
def initialize
|
15
|
+
def initialize(profile:)
|
16
16
|
@logger = Logger.new(STDOUT)
|
17
|
-
|
18
|
-
@ec2 = Aws::EC2::Client.new
|
17
|
+
@ec2 = Aws::EC2::Client.new(get_param(profile))
|
19
18
|
end
|
20
19
|
|
21
20
|
def instances_hash(condition)
|
@@ -45,5 +44,21 @@ module Pec2
|
|
45
44
|
raise "not EC2 instance"
|
46
45
|
end
|
47
46
|
end
|
47
|
+
|
48
|
+
private
|
49
|
+
|
50
|
+
def get_param(profile)
|
51
|
+
param = {}
|
52
|
+
region = if profile
|
53
|
+
param[:profile] = profile
|
54
|
+
else
|
55
|
+
param[:region] = if ENV['AWS_REGION']
|
56
|
+
ENV['AWS_REGION']
|
57
|
+
else
|
58
|
+
Metadata.get_document['region']
|
59
|
+
end
|
60
|
+
end
|
61
|
+
param
|
62
|
+
end
|
48
63
|
end
|
49
64
|
end
|
data/lib/pec2/pssh.rb
CHANGED
data/lib/pec2/version.rb
CHANGED
data/pec2.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pec2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- toyama0919
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-10-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|
@@ -178,20 +178,6 @@ dependencies:
|
|
178
178
|
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '0'
|
181
|
-
- !ruby/object:Gem::Dependency
|
182
|
-
name: yard
|
183
|
-
requirement: !ruby/object:Gem::Requirement
|
184
|
-
requirements:
|
185
|
-
- - ">="
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: '0'
|
188
|
-
type: :development
|
189
|
-
prerelease: false
|
190
|
-
version_requirements: !ruby/object:Gem::Requirement
|
191
|
-
requirements:
|
192
|
-
- - ">="
|
193
|
-
- !ruby/object:Gem::Version
|
194
|
-
version: '0'
|
195
181
|
description: run parallel ssh command. ec2 tag base operation.
|
196
182
|
email: toyama0919@gmail.com
|
197
183
|
executables:
|
@@ -241,7 +227,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
241
227
|
version: '0'
|
242
228
|
requirements: []
|
243
229
|
rubyforge_project:
|
244
|
-
rubygems_version: 2.6
|
230
|
+
rubygems_version: 2.7.6
|
245
231
|
signing_key:
|
246
232
|
specification_version: 4
|
247
233
|
summary: run parallel ssh command. ec2 tag base operation.
|