Sha256: a00bb51b3ff5f6b5807af3c2acb00f53390ee9ac1afd8ed4ebc5f7c3ab615ff6

Contents?: true

Size: 917 Bytes

Versions: 6

Compression:

Stored size: 917 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

      Bootdisk::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 = Bootdisk::Renderer.new.generic_template_render

      Bootdisk::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

6 entries across 6 versions & 1 rubygems

Version Path
foreman_bootdisk-2.0.8 lib/tasks/bootdisk.rake
foreman_bootdisk-2.0.7 lib/tasks/bootdisk.rake
foreman_bootdisk-2.0.6 lib/tasks/bootdisk.rake
foreman_bootdisk-2.0.5 lib/tasks/bootdisk.rake
foreman_bootdisk-2.0.4 lib/tasks/bootdisk.rake
foreman_bootdisk-2.0.3 lib/tasks/bootdisk.rake