Sha256: cbc230bef94a41722a19011bae72c0541a7a8888f25a6e54de846c05c3c47555

Contents?: true

Size: 1.26 KB

Versions: 16

Compression:

Stored size: 1.26 KB

Contents

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

module BeakerHostGenerator
  module Hypervisor
    class Vmpooler < BeakerHostGenerator::Hypervisor::Interface
      include BeakerHostGenerator::Data

      # default global configuration keys
      def global_config
        {
          'pooling_api' => 'https://vmpooler-prod.k8s.infracore.puppet.net/',
        }
      end

      def generate_node(node_info, base_config, bhg_version)
        base_config = base_generate_node(node_info, base_config, bhg_version, :vmpooler)

        case node_info['ostype']
        when /^(almalinux|centos|oracle|redhat|rocky|scientific)/
          base_config['template'] ||= base_config['platform']&.gsub(/^el/, ::Regexp.last_match(1))
        when /^fedora/, /^opensuse/, /^panos/
          base_config['template'] ||= base_config['platform']
        when /^(debian|ubuntu)/
          os = Regexp.last_match(1)
          arch = case node_info['bits']
                 when '64'
                   'x86_64'
                 when '32'
                   'i386'
                 end

          base_config['template'] ||= "#{node_info['ostype'].sub(os, "#{os}-")}-#{arch}" if arch
        end

        base_config
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
beaker-hostgenerator-2.18.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.17.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.16.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.15.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.14.2 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.14.1 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.14.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.13.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.11.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.10.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.9.1 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.9.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.8.2 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.8.1 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.8.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb
beaker-hostgenerator-2.7.0 lib/beaker-hostgenerator/hypervisor/vmpooler.rb