opswalrus 1.0.48 → 1.0.49
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 +1 -11
- data/lib/opswalrus/host.rb +18 -2
- data/lib/opswalrus/ops_file_script_dsl.rb +6 -2
- data/lib/opswalrus/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 90e3b3e2c7e0255ef069e30d31e2125c5bf6fd9c22a15e4aa2057f5265aa6873
|
4
|
+
data.tar.gz: 58346bbbcfe19a98add4a83b8936f75c911155f872cf35ecaf56ce32679c1123
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bde3099dff40f9f00add304bac22a5cf62521a68ed3c9481d7de9ae28f3d520c4457097c3be60fbb569e6c32de4fdc101e620fd5a2ad832d335b638245dcd93e
|
7
|
+
data.tar.gz: a1b4a440fd1d9512efe0cdef6110f3849afab3ad3253140dfa253bb30d7fac606a0de6b814f3611e0c063366a9478a2b4fc3ae5e3c962b02d6c76f2dd815dbb2
|
data/Gemfile.lock
CHANGED
data/lib/opswalrus/bootstrap.ops
CHANGED
@@ -1,15 +1,5 @@
|
|
1
1
|
# ssh_noprep in: :sequence do
|
2
2
|
ssh_noprep do
|
3
3
|
puts "Bootstrapping #{to_s} (alias=#{self.alias})"
|
4
|
-
|
5
|
-
if exit_status == 0
|
6
|
-
puts "Success - #{to_s} (alias=#{self.alias})"
|
7
|
-
else
|
8
|
-
stdout_report = stdout.lines.last(3).map {|line| " #{line}" }.join()
|
9
|
-
stderr_report = stderr.lines.last(3).map {|line| " #{line}" }.join()
|
10
|
-
report = "Failure - #{to_s} (alias=#{self.alias})"
|
11
|
-
report << "\n stdout:\n#{stdout_report}" unless stdout_report.empty?
|
12
|
-
report << "\n stderr:\n#{stderr_report}" unless stderr_report.empty?
|
13
|
-
puts report
|
14
|
-
end
|
4
|
+
_bootstrap_host(true)
|
15
5
|
end
|
data/lib/opswalrus/host.rb
CHANGED
@@ -82,7 +82,7 @@ module OpsWalrus
|
|
82
82
|
end
|
83
83
|
|
84
84
|
# returns [stdout, stderr, exit_status]
|
85
|
-
def _bootstrap_host
|
85
|
+
def _bootstrap_host(print_report = true)
|
86
86
|
# copy over bootstrap shell script
|
87
87
|
# io = StringIO.new(bootstrap_shell_script)
|
88
88
|
io = File.open(__FILE__.to_pathname.dirname.join("bootstrap.sh"))
|
@@ -91,7 +91,23 @@ module OpsWalrus
|
|
91
91
|
raise Error, "Unable to upload bootstrap shell script to remote host #{to_s} (alias=#{self.alias})" unless upload_success
|
92
92
|
@_host.execute(:chmod, "755", "tmpopsbootstrap.sh")
|
93
93
|
sshkit_cmd = @_host.execute_cmd(:sh, "tmpopsbootstrap.sh")
|
94
|
-
|
94
|
+
|
95
|
+
stdout, stderr, exit_status = [sshkit_cmd.full_stdout, sshkit_cmd.full_stderr, sshkit_cmd.exit_status]
|
96
|
+
|
97
|
+
if print_report
|
98
|
+
if exit_status == 0
|
99
|
+
puts "Bootstrap success - #{to_s} (alias=#{self.alias})"
|
100
|
+
else
|
101
|
+
stdout_report = stdout.lines.last(3).map {|line| " #{line}" }.join()
|
102
|
+
stderr_report = stderr.lines.last(3).map {|line| " #{line}" }.join()
|
103
|
+
report = "Bootstrap failure - #{to_s} (alias=#{self.alias})"
|
104
|
+
report << "\n stdout:\n#{stdout_report}" unless stdout_report.empty?
|
105
|
+
report << "\n stderr:\n#{stderr_report}" unless stderr_report.empty?
|
106
|
+
puts report
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
[stdout, stderr, exit_status]
|
95
111
|
ensure
|
96
112
|
@_host.execute(:rm, "-f", "tmpopsbootstrap.sh") rescue nil
|
97
113
|
end
|
@@ -120,8 +120,12 @@ module OpsWalrus
|
|
120
120
|
host.set_ops_file_script(ops_file_script)
|
121
121
|
host.set_ssh_session_connection(self) # self is an instance of one of the subclasses of SSHKit::Backend::Abstract, e.g. SSHKit::Backend::Netssh
|
122
122
|
|
123
|
-
host._bootstrap_host
|
124
|
-
retval =
|
123
|
+
stdout, stderr, exit_status = host._bootstrap_host(false)
|
124
|
+
retval = if exit_status == 0
|
125
|
+
host._zip_copy_and_run_ops_bundle(local_host, block)
|
126
|
+
else
|
127
|
+
puts "Failed to bootstrap #{host}. Unable to run operation."
|
128
|
+
end
|
125
129
|
|
126
130
|
retval
|
127
131
|
rescue SSHKit::Command::Failed => e
|
data/lib/opswalrus/version.rb
CHANGED