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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 33e2d6953534f1dbc33754e2c61a0590562b28b8
4
- data.tar.gz: 2d6b953f43d8dbedb76769e98e565300d9a08044
2
+ SHA256:
3
+ metadata.gz: d68073713d2afa54a74a21dacb7c053408222bd4c954a82dfd719d385f04bc46
4
+ data.tar.gz: e7e5a0d53e551c82008c2bddb65701e4067aa412bceb2e6be3ea817786e2035d
5
5
  SHA512:
6
- metadata.gz: 33926a7b625ad0f58e5ad5022255c1845bc3bd538a96849fcf031604c30cb6e76caac04e3f9ce8ca308b8da77ffc66ee5bd0790816d5bc5dda70de2cc7f73cde
7
- data.tar.gz: c117a938f7a882ce16d011ac6593a6b263b7cca3e9df4380519d7614c60c0b951ca62df24323d757e32bfcee3eff18bf0a74db10632f46b8a2821d5719ecd26c
6
+ metadata.gz: 1383b7b694915836ef9ba0b66a51f496d05c0190e54709823ba0538f8ad755db85f76442a603b1ce683792fb313ff9c088ca758c33c7f9cf7353f6127d98a2b3
7
+ data.tar.gz: 57064f09a63ad1da242319622637b3f571d2aa86529421264c159d84cac9a5c3e02d24847b035939fb3d6fc4d5e98bbb1955d4ff89e03320109ecdb57b44e455
data/README.md CHANGED
@@ -4,8 +4,6 @@ Run parallel ssh command for ec2.
4
4
 
5
5
  Commands can run to multiple hosts at once using the ec2 tag.
6
6
 
7
- required python.
8
-
9
7
  ## Examples
10
8
 
11
9
  $ pec2 -t Project:project_a Stages:production -c 'hostname'
data/Rakefile CHANGED
@@ -19,7 +19,3 @@ RSpec::Core::RakeTask.new
19
19
 
20
20
  task :test => :spec
21
21
  task :default => :spec
22
-
23
- require 'yard'
24
- YARD::Rake::YardocTask.new
25
- task :doc => :yard
@@ -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
 
@@ -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
- ENV['AWS_REGION'] = ENV['AWS_REGION'] || get_document['region']
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
@@ -26,7 +26,7 @@ module Pec2
26
26
  @print = options[:print]
27
27
  @sudo_password = options[:sudo_password]
28
28
  @ssh_options = {
29
- verify_host_key: false,
29
+ verify_host_key: :never,
30
30
  user_known_hosts_file: '/dev/null',
31
31
  }
32
32
  @logger = Logger.new(STDOUT)
@@ -1,4 +1,4 @@
1
1
  module Pec2
2
2
  # pec2 version
3
- VERSION = "0.6.2"
3
+ VERSION = "0.6.3"
4
4
  end
@@ -30,5 +30,4 @@ Gem::Specification.new do |gem|
30
30
  gem.add_development_dependency 'rspec'
31
31
  gem.add_development_dependency 'rubocop'
32
32
  gem.add_development_dependency 'rubygems-tasks'
33
- gem.add_development_dependency 'yard'
34
33
  end
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.2
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: 2017-09-29 00:00:00.000000000 Z
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.13
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.