Class: BeakerHostGenerator::Hypervisor::Hcloud

Inherits:
Interface
  • Object
show all
Includes:
Data
Defined in:
lib/beaker-hostgenerator/hypervisor/hcloud.rb

Constant Summary

Constants included from Data

Data::BASE_CONFIG, Data::MAIN_PE_VERSION, Data::PE_TARBALL_SERVER, Data::PE_USE_WIN32

Instance Method Summary collapse

Methods included from Data

base_host_config, generate_osinfo, get_osinfo, get_platform_info, get_platforms, osinfo, osinfo_bhgv1, pe_dir, pe_upgrade_version, pe_version

Methods inherited from Interface

#global_config, #initialize

Constructor Details

This class inherits a constructor from BeakerHostGenerator::Hypervisor::Interface

Instance Method Details

#generate_node(node_info, base_config, bhg_version) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/beaker-hostgenerator/hypervisor/hcloud.rb', line 9

def generate_node(node_info, base_config, bhg_version)
  # split ostype into string and array
  # ostype is ubuntu2204, debian10, rocky9
  os, version = node_info['ostype'].split(/(\D+)/).reject!(&:empty?)
  base_config['image'] = case os
                         when 'ubuntu'
                           "#{os}-#{version[0, 2]}.#{version[2, 2]}"
                         when 'centos'
                           (version.to_i == 7) ? "#{os}-#{version}" : "#{os}-stream-#{version}"
                         else
                           "#{os}-#{version}"
                         end
  base_generate_node(node_info, base_config, bhg_version, :hcloud)
end