Module: ForemanFogProxmox::ProxmoxOperatingSystems
- Included in:
- Proxmox
- Defined in:
- app/models/foreman_fog_proxmox/proxmox_operating_systems.rb
Instance Method Summary collapse
- #available_linux_operating_systems ⇒ Object
- #available_operating_systems ⇒ Object
- #available_other_operating_systems ⇒ Object
- #available_windows_operating_systems ⇒ Object
- #compute_os_types(host) ⇒ Object
- #os_linux_types_mapping(host) ⇒ Object
- #os_other_types_mapping(host) ⇒ Object
- #os_windows_types_mapping(host) ⇒ Object
Instance Method Details
#available_linux_operating_systems ⇒ Object
37 38 39 |
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 37 def ['l24', 'l26', 'debian', 'ubuntu', 'centos', 'fedora', 'opensuse', 'archlinux', 'gentoo', 'alpine'] end |
#available_operating_systems ⇒ Object
26 27 28 29 30 31 |
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 26 def = += += end |
#available_other_operating_systems ⇒ Object
33 34 35 |
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 33 def ['other', 'solaris'] end |
#available_windows_operating_systems ⇒ Object
41 42 43 |
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 41 def ['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), os_windows_types_mapping(host), os_other_types_mapping(host)].find(&:any?) || [] end |
#os_linux_types_mapping(host) ⇒ Object
45 46 47 48 49 50 51 52 |
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 45 def os_linux_types_mapping(host) if ['Debian', 'Redhat', 'Suse', 'Altlinux', 'Archlinux', 'Coreos', 'Rancheros', 'Gentoo'].include?(host..type) else [] end end |
#os_other_types_mapping(host) ⇒ Object
58 59 60 61 62 63 |
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 58 def os_other_types_mapping(host) { 'Freebsd' => ['other'], 'Solaris' => ['solaris'], }.fetch(host..type, []) end |
#os_windows_types_mapping(host) ⇒ Object
54 55 56 |
# File 'app/models/foreman_fog_proxmox/proxmox_operating_systems.rb', line 54 def os_windows_types_mapping(host) ['Windows'].include?(host..type) ? : [] end |