Class: Debian

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

Constant Summary collapse

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

Constants inherited from Operatingsystem

Operatingsystem::FAMILIES

Instance Method Summary collapse

Methods inherited from Operatingsystem

#as_json, #boot_filename, #bootfile, families, families_as_collection, #family, #family=, #fullname, #image_extension, #initrd, #interpolate_medium_vars, #kernel, #medium_uri, #medium_vars_to_uri, #pxe_files, #pxe_prefix, #pxe_variant, #release, #repos, #require_nfs_access_to_medium, #supports_image, #template_kind, #to_label, #to_s

Methods included from Authorization

#enforce_create_permissions, #enforce_destroy_permissions, #enforce_edit_permissions, #enforce_permissions, included, #permission_failed?

Instance Method Details

#boot_files_uri(medium, architecture) ⇒ Object


18
19
20
21
22
23
24
25
26
27
28
29
# File 'app/models/debian.rb', line 18

def boot_files_uri(medium, architecture)
  raise ::Foreman::Exception.new(N_("invalid medium for %s"), to_s) unless media.include?(medium)
  raise ::Foreman::Exception.new(N_("invalid architecture for %s"), to_s) unless architectures.include?(architecture)

  # Debian stores x86_64 arch is amd64
  arch = architecture.to_s.gsub("x86_64","amd64")
  pxe_dir = "dists/#{release_name}/main/installer-#{arch}/current/images/netboot/#{guess_os}-installer/#{arch}"

  PXEFILES.values.collect do |img|
    URI.parse("#{medium_vars_to_uri(medium.path, architecture.name, self)}/#{pxe_dir}/#{img}").normalize
  end
end

#classObject

Override the class representation, as this breaks many rails helpers


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

def class
  Operatingsystem
end

#preseed_path(host) ⇒ Object


9
10
11
# File 'app/models/debian.rb', line 9

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

#preseed_server(host) ⇒ Object


5
6
7
# File 'app/models/debian.rb', line 5

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

#pxe_typeObject


31
32
33
# File 'app/models/debian.rb', line 31

def pxe_type
  "preseed"
end

#use_release_name?Boolean

Does this OS family use release_name in its naming scheme


36
37
38
# File 'app/models/debian.rb', line 36

def use_release_name?
  true
end