opswalrus 1.0.96 → 1.0.97
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/opswalrus/_bootstrap.ops +3 -1
- data/lib/opswalrus/_reboot.ops +3 -1
- data/lib/opswalrus/_run_remote.ops +3 -1
- data/lib/opswalrus/_shell.ops +3 -1
- data/lib/opswalrus/app.rb +4 -1
- data/lib/opswalrus/host.rb +1 -1
- data/lib/opswalrus/ops_file_script_dsl.rb +2 -0
- data/lib/opswalrus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ccf8e333c2a08306ce5afc14a557c69fe01d8681ffeb5e3957b80b09b68bcafa
|
4
|
+
data.tar.gz: b8d586b564c368d7e055746c515c7ea5883765b4a5ca3a9d389f89cd04e06e2c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d7a74e6e3872014452eaa8a19203e1da2b81c9af00c9a6e5f0499caff2a3309f18af2122e00097e7276d80bcd89fb937ab3de7e3b01373187611387e0e23b38
|
7
|
+
data.tar.gz: 5b24d54d03bbb5f9bdd03f2d5ddd1644f94819e54803b6d51f5812f5a8758c31f24a58b273c1d42600f00788c0b4e5777e8e3204a8c3a061e10e532c5a150ac9
|
data/Gemfile.lock
CHANGED
data/lib/opswalrus/_reboot.ops
CHANGED
@@ -10,7 +10,7 @@ timeout = params.timeout.integer!(default: 300)
|
|
10
10
|
|
11
11
|
delay = 1 if delay < 1
|
12
12
|
|
13
|
-
ssh_noprep in: :sequence do
|
13
|
+
host_to_value_map = ssh_noprep in: :sequence do
|
14
14
|
# ssh_noprep do
|
15
15
|
|
16
16
|
# survey of command options:
|
@@ -62,3 +62,5 @@ ssh_noprep in: :sequence do
|
|
62
62
|
# }
|
63
63
|
reboot(delay: delay, sync: sync, timeout: timeout)
|
64
64
|
end
|
65
|
+
|
66
|
+
host_to_value_map.transform_keys(&:to_s)
|
@@ -2,9 +2,11 @@ params:
|
|
2
2
|
ops_file: OpsFile
|
3
3
|
operation_kv_args: array string
|
4
4
|
...
|
5
|
-
ssh in: :sequence do
|
5
|
+
host_to_value_map = ssh in: :sequence do
|
6
6
|
# ssh_noprep do
|
7
7
|
# puts params.stringify_keys!
|
8
8
|
# desc "Running `#{params.ops_file.ops_file_path} #{params.operation_kv_args.join(' ')}` on #{to_s} (alias=#{self.alias})"
|
9
9
|
_invoke_remote(params.ops_file, *params.operation_kv_args)
|
10
10
|
end
|
11
|
+
|
12
|
+
host_to_value_map.transform_keys(&:to_s)
|
data/lib/opswalrus/_shell.ops
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
params:
|
2
2
|
command: string
|
3
3
|
...
|
4
|
-
ssh_noprep in: :sequence do
|
4
|
+
host_to_value_map = ssh_noprep in: :sequence do
|
5
5
|
# ssh_noprep do
|
6
6
|
command = params.command
|
7
7
|
desc "Running `#{command}` on #{to_s} (alias=#{self.alias})"
|
8
8
|
shell(command)
|
9
9
|
end
|
10
|
+
|
11
|
+
host_to_value_map.transform_keys(&:to_s)
|
data/lib/opswalrus/app.rb
CHANGED
@@ -231,7 +231,10 @@ module OpsWalrus
|
|
231
231
|
result = op.run([], params_json_hash: params)
|
232
232
|
# puts "result class=#{result.class}"
|
233
233
|
exit_status = result.exit_status
|
234
|
-
|
234
|
+
# when we are using the shell method
|
235
|
+
# puts result.value.class # EasyNavProxy
|
236
|
+
# puts result.value # Hash looking object
|
237
|
+
stdout = JSON.pretty_generate(result.value.to_h)
|
235
238
|
output = if exit_status == 0
|
236
239
|
Style.green(stdout)
|
237
240
|
else
|
data/lib/opswalrus/host.rb
CHANGED
@@ -178,7 +178,7 @@ module OpsWalrus
|
|
178
178
|
# 1. Net::SSH::Disconnect < Net::SSH::Exception with message: "connection closed by remote host"
|
179
179
|
# 2. Errno::ECONNRESET < SystemCallError with message: "Connection reset by peer"
|
180
180
|
# 3. Errno::ECONNREFUSED < SystemCallError with message: "Connection refused - connect(2) for 192.168.56.10:22"
|
181
|
-
rescue Net::SSH::Disconnect, Errno::ECONNRESET, Errno::ECONNREFUSED => e
|
181
|
+
rescue Net::SSH::Disconnect, Net::SSH::ConnectionTimeout, Errno::ECONNRESET, Errno::ECONNREFUSED => e
|
182
182
|
# noop; we expect these while we're trying to reconnect
|
183
183
|
rescue => e
|
184
184
|
puts "#{e.class} < #{e.class.superclass}"
|
@@ -118,6 +118,8 @@ module OpsWalrus
|
|
118
118
|
App.instance.error "[!] The host '#{host}' doesn't accept password authentication method."
|
119
119
|
rescue Errno::EHOSTUNREACH => e
|
120
120
|
App.instance.error "[!] The host '#{host}' is unreachable"
|
121
|
+
rescue RemoteInvocationError => e
|
122
|
+
results[host] = e
|
121
123
|
rescue => e
|
122
124
|
App.instance.error e.class
|
123
125
|
App.instance.error e.message
|
data/lib/opswalrus/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opswalrus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.97
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Ellis
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|