Sha256: c02f64751a30bd86846f029fac0fe0c44d35a36c0833fc7f5fd2d3d10984ae06

Contents?: true

Size: 1.04 KB

Versions: 24

Compression:

Stored size: 1.04 KB

Contents

require 'beaker-hostgenerator/data'
require 'beaker-hostgenerator/roles'
require 'beaker-hostgenerator/hypervisor/vmpooler'
require 'deep_merge/rails_compat'

module BeakerHostGenerator
  module Utils
    module_function

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

    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

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

    def get_roles
      BeakerHostGenerator::Roles.ROLES
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
beaker-hostgenerator-2.18.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.17.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.16.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.15.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.14.2 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.14.1 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.14.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.13.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.11.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.10.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.9.1 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.9.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.8.2 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.8.1 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.8.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.7.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.6.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.5.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.4.0 lib/beaker-hostgenerator/util.rb
beaker-hostgenerator-2.3.0 lib/beaker-hostgenerator/util.rb