Module: BeakerHostGenerator::Utils

Defined in:
lib/beaker-hostgenerator/util.rb

Class Method Summary collapse

Class Method Details

.dump_hosts(hosts, path) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/beaker-hostgenerator/util.rb', line 14

def dump_hosts(hosts, path)
  vmpooler_hypervisor = BeakerHostGenerator::Hypervisor::Vmpooler.new
  config = {}
  config.deeper_merge! BeakerHostGenerator::Data.BASE_CONFIG
  config['CONFIG'].deeper_merge! vmpooler_hypervisor.global_config

  hosts.each do |host|
    config['HOSTS'][host.node_name] = {
      'roles' => host['roles'],
      'hypervisor' => "#{host['hypervisor']}",
      'platform' => "#{host['platform']}",
    }
  end

  File.write(path, config.to_yaml)
end

.get_platforms(_hypervisor_type = 'vmpooler', bhg_version = 0) ⇒ Object



31
32
33
# File 'lib/beaker-hostgenerator/util.rb', line 31

def get_platforms(_hypervisor_type = 'vmpooler', bhg_version = 0)
  BeakerHostGenerator::Data.get_platforms(bhg_version)
end

.get_rolesObject



35
36
37
# File 'lib/beaker-hostgenerator/util.rb', line 35

def get_roles
  BeakerHostGenerator::Roles.ROLES
end

.pe_dir(version, _family = nil) ⇒ Object



10
11
12
# File 'lib/beaker-hostgenerator/util.rb', line 10

def pe_dir(version, _family = nil)
  BeakerHostGenerator::Data.pe_dir(version)
end