Sha256: aea94192dd3ac248879bff0a62635465af16b5e402c3becf298c76a6a0df91ef

Contents?: true

Size: 1.04 KB

Versions: 12

Compression:

Stored size: 1.04 KB

Contents

class Setting::Bootdisk< ::Setting
  def self.load_defaults
    return unless ActiveRecord::Base.connection.table_exists?('settings')
    return unless super

    ipxe = ['/usr/lib/ipxe'].find { |p| File.exist?(p) } || '/usr/share/ipxe'
    syslinux = ['/usr/lib/syslinux'].find { |p| File.exist?(p) } || '/usr/share/syslinux'

    Setting.transaction do
      [
        self.set('bootdisk_ipxe_dir', N_('Path to directory containing iPXE images'), ipxe),
        self.set('bootdisk_syslinux_dir', N_('Path to directory containing syslinux images'), syslinux),
        self.set('bootdisk_host_template', N_('iPXE template to use for host-specific boot disks'), 'Boot disk iPXE - host'),
        self.set('bootdisk_generic_host_template', N_('iPXE template to use for generic host boot disks'), 'Boot disk iPXE - generic host'),
        self.set('bootdisk_mkiso_command', N_('Command to generate ISO image, use genisoimage or mkisofs'), 'genisoimage'),
      ].compact.each { |s| self.create s.update(:category => "Setting::Bootdisk") }
    end

    true

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
foreman_bootdisk-3.1.2 app/models/setting/bootdisk.rb
foreman_bootdisk-3.1.1 app/models/setting/bootdisk.rb
foreman_bootdisk-3.1.0 app/models/setting/bootdisk.rb
foreman_bootdisk-3.0.0 app/models/setting/bootdisk.rb
foreman_bootdisk-2.0.8 app/models/setting/bootdisk.rb
foreman_bootdisk-2.0.7 app/models/setting/bootdisk.rb
foreman_bootdisk-2.0.6 app/models/setting/bootdisk.rb
foreman_bootdisk-2.0.5 app/models/setting/bootdisk.rb
foreman_bootdisk-2.0.4 app/models/setting/bootdisk.rb
foreman_bootdisk-2.0.3 app/models/setting/bootdisk.rb
foreman_bootdisk-2.0.2 app/models/setting/bootdisk.rb
foreman_bootdisk-2.0.1 app/models/setting/bootdisk.rb