Sha256: 710b11d0f238f2edddd33ccc71fddc0611cff056fbbdf433a38b55ec7397cdf5

Contents?: true

Size: 938 Bytes

Versions: 4

Compression:

Stored size: 938 Bytes

Contents

namespace :bootdisk do
  namespace :generate do
    desc 'Generate a static boot disk for a specific host.  NAME=fqdn, OUTPUT path'
    task :host => :environment do
      host = Host::Base.find_by_name(ENV['NAME']) || raise("cannot find host '#{ENV['NAME']}', specify NAME=fqdn")
      tmpl = host.bootdisk_template_render

      ForemanBootdisk::ISOGenerator.new(tmpl).generate do |image|
        output = ENV['OUTPUT'] || "#{host.name}.iso"
        FileUtils.cp image, output
        puts "Wrote #{output}"
      end
    end

    desc 'Generate a generic boot disk.  OUTPUT=path'
    task :generic => :environment do
      tmpl = ForemanBootdisk::Renderer.new.generic_template_render

      ForemanBootdisk::ISOGenerator.new(tmpl).generate do |image|
        output = ENV['OUTPUT'] || "bootdisk_#{URI.parse(Setting[:foreman_url]).host}.iso"
        FileUtils.cp image, output
        puts "Wrote #{output}"
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
foreman_bootdisk-3.1.2 lib/tasks/bootdisk.rake
foreman_bootdisk-3.1.1 lib/tasks/bootdisk.rake
foreman_bootdisk-3.1.0 lib/tasks/bootdisk.rake
foreman_bootdisk-3.0.0 lib/tasks/bootdisk.rake