Class: Debian

Inherits:
Operatingsystem show all
Defined in:
app/models/operatingsystems/debian.rb

Constant Summary collapse

PXEFILES =
{:kernel => "linux", :initrd => "initrd.gz"}

Constants inherited from Operatingsystem

Operatingsystem::FAMILIES

Constants included from PxeLoaderSupport

PxeLoaderSupport::PREFERRED_KINDS, PxeLoaderSupport::PXE_KINDS

Instance Method Summary collapse

Methods inherited from Operatingsystem

#additional_media, #boot_filename, #boot_files_uri, #bootfile, #deduce_family, deduce_family, #dhcp_record_type, families, families_as_collection, #family, #family=, find_by_to_label, #fullname, #image_extension, inherited, #initrd, #kernel, #mediumpath, #pxe_files, #pxe_kernel_options, #pxe_prefix, #release, require_nfs_access_to_medium, #supports_image, #template_kinds, #template_kinds_for_tftp, title_name, #to_label, #to_label=, #to_param, #to_s, #url_for_boot

Methods included from ParameterValidators

#parameters_symbol, #validate_parameters_names

Methods included from PxeLoaderSupport

#default_boot_filename, #preferred_loader, #pxe_loader_kind

Methods included from Authorizable

#authorized?, #check_permissions_after_save

Methods included from PermissionName

#permission_name

Methods inherited from ApplicationRecord

graphql_type, #logger, logger

Methods included from AuditAssociations::AssociationsDefinitions

#audit_associations, #audited, #configure_dirty_associations, #normalize_associations

Instance Method Details

#available_loadersObject


29
30
31
# File 'app/models/operatingsystems/debian.rb', line 29

def available_loaders
  self.class.all_loaders
end

#boot_file_sources(medium_provider, &block) ⇒ Object


21
22
23
24
25
26
27
# File 'app/models/operatingsystems/debian.rb', line 21

def boot_file_sources(medium_provider, &block)
  super do |vars|
    vars = yield(vars) if block_given?

    transform_vars(vars)
  end
end

#display_familyObject


42
43
44
# File 'app/models/operatingsystems/debian.rb', line 42

def display_family
  "Debian"
end

#preseed_path(medium_provider) ⇒ Object


17
18
19
# File 'app/models/operatingsystems/debian.rb', line 17

def preseed_path(medium_provider)
  medium_provider.medium_uri.select(:path, :query).compact.join('?')
end

#preseed_server(medium_provider) ⇒ Object


13
14
15
# File 'app/models/operatingsystems/debian.rb', line 13

def preseed_server(medium_provider)
  medium_provider.medium_uri.select(:host, :port).compact.join(':')
end

#pxe_typeObject


33
34
35
# File 'app/models/operatingsystems/debian.rb', line 33

def pxe_type
  "preseed"
end

#pxedir(medium_provider = nil) ⇒ Object


4
5
6
7
8
9
10
11
# File 'app/models/operatingsystems/debian.rb', line 4

def pxedir(medium_provider = nil)
  # support ubuntu focal(20), which moved pxe files to legacy_image
  if (guess_os == 'ubuntu' && major.to_i >= 20)
    'dists/$release/main/installer-$arch/current/legacy-images/netboot/' + guess_os + '-installer/$arch'
  else
    'dists/$release/main/installer-$arch/current/images/netboot/' + guess_os + '-installer/$arch'
  end
end

#shorten_description(description) ⇒ Object


46
47
48
49
50
51
52
53
54
55
# File 'app/models/operatingsystems/debian.rb', line 46

def shorten_description(description)
  return "" if description.blank?
  s = description.dup
  s.gsub!('GNU/Linux', '')
  s.gsub!(/\(.+?\)/, '')
  s.squeeze! " "
  s.strip!
  s += '.' + minor unless s.include?('.')
  s.presence || description
end

#use_release_name?Boolean

Does this OS family use release_name in its naming scheme

Returns:

  • (Boolean)

38
39
40
# File 'app/models/operatingsystems/debian.rb', line 38

def use_release_name?
  true
end