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 +5 -5
- data/Gemfile.lock +2 -2
- data/exe/rcmd +10 -1
- data/lib/rcmd.rb +10 -1
- data/lib/rcmd/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: ea6e23572cd12a902786b08ac638f760f083b2867d6a8cad0a87fb8fb8140032
|
4
|
+
data.tar.gz: a61eea7a7084a38fabe65e19c927e299ccb56738cfa96698530c28a36193af8f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 190605c6d4a1501d4d008f81f7291a0b005ee8e80f22bdae8b62342562be7915530cedc1bfc1cab43a97fcef08b8b2f91a3106f717c1d7b2b8c410c458b9d72b
|
7
|
+
data.tar.gz: 9e191ebe7771dc3b337b800db67335aef14613b7122643b44d6ef003ba6c4b3bfde6538eb205dfc9a0d078d4598265f0c4d660560b4e214765f731ea66ce0485
|
data/Gemfile.lock
CHANGED
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,
|
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
|
data/lib/rcmd.rb
CHANGED
@@ -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
|
data/lib/rcmd/version.rb
CHANGED
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
|
+
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:
|
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
|
268
|
+
rubygems_version: 2.7.6
|
269
269
|
signing_key:
|
270
270
|
specification_version: 4
|
271
271
|
summary: Parellel command execution through ssh
|