Module: ForemanFogProxmox::ProxmoxOperatingSystems

Included in:
Proxmox
Defined in:
app/models/foreman_fog_proxmox/proxmox_operating_systems.rb

Instance Method Summary collapse

Instance Method Details

#available_linux_operating_systemsObject



33
34
35
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 33

def available_linux_operating_systems
  ['l24', 'l26', 'debian', 'ubuntu', 'centos', 'fedora', 'opensuse', 'archlinux', 'gentoo', 'alpine']
end

#available_operating_systemsObject



26
27
28
29
30
31
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 26

def available_operating_systems
  operating_systems = ['other', 'solaris']
  operating_systems += available_linux_operating_systems
  operating_systems += available_windows_operating_systems
  operating_systems
end

#available_windows_operating_systemsObject



37
38
39
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 37

def available_windows_operating_systems
  ['wxp', 'w2k', 'w2k3', 'w2k8', 'wvista', 'win7', 'win8', 'win10']
end

#compute_os_types(host) ⇒ Object



22
23
24
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 22

def compute_os_types(host)
  os_linux_types_mapping(host).empty? ? os_windows_types_mapping(host) : os_linux_types_mapping(host)
end

#os_linux_types_mapping(host) ⇒ Object



41
42
43
44
45
46
47
48
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 41

def os_linux_types_mapping(host)
  if ['Debian', 'Redhat', 'Suse', 'Altlinux', 'Archlinux', 'Coreos', 'Rancheros',
      'Gentoo'].include?(host.operatingsystem.type)
    available_linux_operating_systems
  else
    []
  end
end

#os_windows_types_mapping(host) ⇒ Object



50
51
52
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 50

def os_windows_types_mapping(host)
  ['Windows'].include?(host.operatingsystem.type) ? available_windows_operating_systems : []
end