Module: FogExtensions::Proxmox::ServerConfig

Extended by:
ActiveSupport::Concern
Defined in:
app/models/concerns/fog_extensions/proxmox/server_config.rb

Instance Method Summary collapse

Instance Method Details

#cloud_init?Boolean

Returns:

  • (Boolean)


44
45
46
# File 'app/models/concerns/fog_extensions/proxmox/server_config.rb', line 44

def cloud_init?
  disks.any?(&:cloud_init?)
end

#cpu_typeObject



26
27
28
# File 'app/models/concerns/fog_extensions/proxmox/server_config.rb', line 26

def cpu_type
  Fog::Proxmox::CpuHelper.extract_cputype(cpu)
end

#rootfs_fileObject



40
41
42
# File 'app/models/concerns/fog_extensions/proxmox/server_config.rb', line 40

def rootfs_file
  disks.rootfs&.volid
end

#rootfs_storageObject



36
37
38
# File 'app/models/concerns/fog_extensions/proxmox/server_config.rb', line 36

def rootfs_storage
  disks.rootfs&.storage
end

#secure_boot?Boolean

Returns:

  • (Boolean)


48
49
50
51
52
53
54
55
# File 'app/models/concerns/fog_extensions/proxmox/server_config.rb', line 48

def secure_boot?
  attrs = attributes.with_indifferent_access
  secure_boot = attrs[:is_secure_boot]
  return Foreman::Cast.to_bool(secure_boot) ? '1' : '0' if attrs.key?(:is_secure_boot)

  secure_boot = bios == 'ovmf' && Foreman::Cast.to_bool(efidisk&.pre_enrolled_keys)
  Foreman::Cast.to_bool(secure_boot) ? '1' : '0'
end