mofa 0.3.33 → 0.3.34

Sign up to get free protection for your applications and to get access to all the features.
@@ -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, "sudo mkdir -p /var/lib/mofa && sudo ln -s #{solo_dir} /var/lib/mofa/last_run")
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 #{cookbook.pkg_name} | sudo tee /var/lib/mofa/last_cookbook")
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 /var/lib/mofa/last_run/log' | sudo tee -a /usr/bin/mofalog && sudo chmod 755 /usr/bin/mofalog")
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
@@ -1,3 +1,3 @@
1
1
  module Mofa
2
- VERSION = "0.3.33"
2
+ VERSION = "0.3.34"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.33
4
+ version: 0.3.34
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: