mofa 0.3.33 → 0.3.34
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/mofa/provision_cmd.rb +8 -3
- data/lib/mofa/version.rb +1 -1
- metadata +1 -1
data/lib/mofa/provision_cmd.rb
CHANGED
@@ -195,15 +195,20 @@ class ProvisionCmd < MofaCmd
|
|
195
195
|
chef_solo_runs[hostname].store('status', 'SUCCESS')
|
196
196
|
chef_solo_runs[hostname].store('status_msg', '')
|
197
197
|
end
|
198
|
+
snapshot_or_release = cookbook.is_a?(SourceCookbook) ? 'snapshot' : 'release'
|
198
199
|
out = ssh_exec!(ssh, "sudo chown -R #{Mofa::Config.config['ssh_user']}.#{Mofa::Config.config['ssh_user']} #{solo_dir}")
|
199
200
|
puts "ERROR (#{out[0]}): #{out[2]}" if out[0] != 0
|
200
|
-
out = ssh_exec!(ssh, "
|
201
|
+
out = ssh_exec!(ssh, "echo #{cookbook.pkg_name} | sudo tee /var/lib/mofa/last_cookbook_name")
|
201
202
|
puts "ERROR (#{out[0]}): #{out[2]}" if out[0] != 0
|
202
|
-
out = ssh_exec!(ssh, "echo #{
|
203
|
+
out = ssh_exec!(ssh, "echo '#{snapshot_or_release}' | sudo tee /var/lib/mofa/last_cookbook_snapshot_or_release")
|
204
|
+
puts "ERROR (#{out[0]}): #{out[2]}" if out[0] != 0
|
205
|
+
out = ssh_exec!(ssh, "echo #{cookbook.version} | sudo tee /var/lib/mofa/last_cookbook_version")
|
203
206
|
puts "ERROR (#{out[0]}): #{out[2]}" if out[0] != 0
|
204
207
|
out = ssh_exec!(ssh, "echo #{chef_solo_runs[hostname]['status']}| sudo tee /var/lib/mofa/last_status")
|
205
208
|
puts "ERROR (#{out[0]}): #{out[2]}" if out[0] != 0
|
206
|
-
out = ssh_exec!(ssh, "echo '#!/bin/bash' | sudo tee /usr/bin/mofalog && echo 'cat /
|
209
|
+
out = ssh_exec!(ssh, "echo '#!/bin/bash' | sudo tee /usr/bin/mofalog && echo 'cat #{solo_dir}/log' | sudo tee -a /usr/bin/mofa_log && sudo chmod 755 /usr/bin/mofa_log")
|
210
|
+
puts "ERROR (#{out[0]}): #{out[2]}" if out[0] != 0
|
211
|
+
out = ssh_exec!(ssh, "cat #{solo_dir}/log | sudo tee -a /var/log/mofa.log")
|
207
212
|
puts "ERROR (#{out[0]}): #{out[2]}" if out[0] != 0
|
208
213
|
end
|
209
214
|
end
|
data/lib/mofa/version.rb
CHANGED