rcmd 1.6.4 → 1.6.5

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: ef2d6e4a0f3903338259d59c44d9b28ef9d3a2c6
4
- data.tar.gz: f2fb6ce8e638474cec958d9b04f7043110d93524
2
+ SHA256:
3
+ metadata.gz: ea6e23572cd12a902786b08ac638f760f083b2867d6a8cad0a87fb8fb8140032
4
+ data.tar.gz: a61eea7a7084a38fabe65e19c927e299ccb56738cfa96698530c28a36193af8f
5
5
  SHA512:
6
- metadata.gz: 57bf0fb42a1c513a49626d4415e57f0afd9a9834a90bd4c5a2a6a522bf4abbfadabbda77604abf4f1c6aed21f43e600e3ff0406f5986cebb3e40a0fe14f2f739
7
- data.tar.gz: 5ff7aa09debaa9ad74ba5eadf733d79f543c8ebcbe212c8997d7a851cf11147268f5d64c6764b16f536affe05e2471373075fde65154f7d9f909d9a3a779bfd0
6
+ metadata.gz: 190605c6d4a1501d4d008f81f7291a0b005ee8e80f22bdae8b62342562be7915530cedc1bfc1cab43a97fcef08b8b2f91a3106f717c1d7b2b8c410c458b9d72b
7
+ data.tar.gz: 9e191ebe7771dc3b337b800db67335aef14613b7122643b44d6ef003ba6c4b3bfde6538eb205dfc9a0d078d4598265f0c4d660560b4e214765f731ea66ce0485
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rcmd (1.6.4)
4
+ rcmd (1.6.5)
5
5
  activerecord
6
6
  activesupport
7
7
  io-console
@@ -82,4 +82,4 @@ DEPENDENCIES
82
82
  sqlite3
83
83
 
84
84
  BUNDLED WITH
85
- 1.15.4
85
+ 1.16.1
data/exe/rcmd CHANGED
@@ -16,7 +16,10 @@ require 'rcmd'
16
16
 
17
17
  =end
18
18
  # Set default options
19
- options = { :threads => 4, :nodes => nil, :environment => nil, :user => 'root', :password => false, :command => nil, :quiet => false, :version => false, :debug => false, :expression => nil, :database => false, :config => false, :type => nil, :host => nil, :os => nil }
19
+ options = { :threads => 4, :nodes => nil, :environment => nil, :user => 'root', :password => false,
20
+ :command => nil, :quiet => false, :version => false, :debug => false, :expression => nil,
21
+ :database => false, :config => false, :type => nil, :host => nil, :os => nil ,
22
+ :timeout => 2, :hosts_file => File.expand_path('~/.ssh/known_hosts'), :keys_only => false }
20
23
 
21
24
  host_list = []
22
25
 
@@ -31,6 +34,9 @@ opts.on('-c <command>', '--command <command>', String, "Quoted string containing
31
34
  opts.on('-q', '--quiet', "Suppress stdout of commands. stderr will still be displayed") { |v| options[:quiet] = v }
32
35
  opts.on('-v', '--version', "Print what version of the command is in use") { |v| options[:version] = v}
33
36
  opts.on('-D', '--debug', "Print debug information") { |v| options[:debug] = v }
37
+ opts.on('--timeout Seconds', Integer, "Number of seconds to wait before timeing out the session") { |v| options[:timeout] = v }
38
+ opts.on('--hosts-file FILE', String, "Filename to use as the SSH hosts file (known_hosts)") { |v| options[:hosts_file] = File.file?(File.expand_path(v)) ? File.expand_path(v) : File.expand_path('~/.ssh/known_hosts') }
39
+ opts.on('--keys_only', "Use only ssh keys for authentication. (No Passwords)") { |v| options[:keys_only] = v }
34
40
  opts.separator " "
35
41
  opts.separator "Database Options"
36
42
  opts.on('-C', '--create-config', "Create template dbconfig file in ~/.rcmd") { |v| options[:config] = v}
@@ -122,6 +128,9 @@ Rcmd.user= options[:user]
122
128
  Rcmd.quiet= options[:quiet]
123
129
  Rcmd.command= options[:command]
124
130
  Rcmd.debug= options[:debug]
131
+ Rcmd.timeout = options[:timeout]
132
+ Rcmd.keys_only = options[:keys_only]
133
+ Rcmd.hosts_file = options[:host_file]
125
134
 
126
135
  # Execute command on provided hosts
127
136
  Rcmd.run_command
@@ -42,6 +42,15 @@ Self class for setting up accessors
42
42
 
43
43
  # Boolean for debug output
44
44
  attr_accessor :debug
45
+
46
+ # Boolean for using only ssh-keys or not
47
+ attr_accessor :keys_only
48
+
49
+ # Integer for ssh sesison timeout value
50
+ attr_accessor :timeout
51
+
52
+ # String fo path to user_known_hosts_file
53
+ attr_accessor :hosts_file
45
54
  end
46
55
 
47
56
  # Main method for this module which should be called after the correct variables have been set.
@@ -95,7 +104,7 @@ Self class for setting up accessors
95
104
  num_threads.times do |i|
96
105
  @threads[i] = Thread.new {
97
106
  begin
98
- conn_options = { :user => @user, :host => @queue.pop, :password => nil, :quiet => @quiet, :debug => @debug }
107
+ conn_options = { :user => @user, :host => @queue.pop, :password => nil, :quiet => @quiet, :debug => @debug, :timeout => @timeout, :keys_only => @keys_only, :user_known_hosts_file => @hosts_file}
99
108
  STDERR.print "DEBUG :: Connecting to #{conn_options[:host]}\n" if conn_options[:debug]
100
109
  Net::SSH.start(conn_options[:host], conn_options[:user], :password => conn_options[:passwd]) do |session|
101
110
  # Open channel for input/output control
@@ -1,4 +1,4 @@
1
1
  module Rcmd # :notnew:
2
2
  # +VERSION+ - Version number string
3
- VERSION = "1.6.4"
3
+ VERSION = "1.6.5"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rcmd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.4
4
+ version: 1.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Rose
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-10 00:00:00.000000000 Z
11
+ date: 2018-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh
@@ -265,7 +265,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
265
265
  version: '0'
266
266
  requirements: []
267
267
  rubyforge_project:
268
- rubygems_version: 2.6.13
268
+ rubygems_version: 2.7.6
269
269
  signing_key:
270
270
  specification_version: 4
271
271
  summary: Parellel command execution through ssh