Sha256: dc38eeab91e99c38093342d5b25c550c81e5925a7ca985cdcb741a3f48c56a54

Contents?: true

Size: 901 Bytes

Versions: 7

Compression:

Stored size: 901 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_#{Setting[:foreman_url]}.iso"
        FileUtils.cp image, output
        puts "Wrote #{output}"
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
foreman_bootdisk-2.0.2 lib/tasks/bootdisk.rake
foreman_bootdisk-2.0.1 lib/tasks/bootdisk.rake
foreman_bootdisk-2.0.0 lib/tasks/bootdisk.rake
foreman_bootdisk-1.2.3 lib/tasks/bootdisk.rake
foreman_bootdisk-1.2.2 lib/tasks/bootdisk.rake
foreman_bootdisk-1.2.1 lib/tasks/bootdisk.rake
foreman_bootdisk-1.2.0 lib/tasks/bootdisk.rake