Class: Foreman::Export::Bluepill
- Defined in:
- lib/foreman/export/bluepill.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from Foreman::Export::Base
Instance Method Details
#export(location, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/foreman/export/bluepill.rb', line 6 def export(location, ={}) error("Must specify a location") unless location FileUtils.mkdir_p location app = [:app] || File.basename(engine.directory) user = [:user] || app log_root = [:log] || "/var/log/#{app}" template_root = [:template] Dir["#{location}/#{app}.pill"].each do |file| say "cleaning up: #{file}" FileUtils.rm(file) end concurrency = Foreman::Utils.parse_concurrency([:concurrency]) master_template = export_template("bluepill", "master.pill.erb", template_root) master_config = ERB.new(master_template).result(binding) write_file "#{location}/#{app}.pill", master_config end |