Class: BeakerHostGenerator::Hypervisor::Interface

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

Direct Known Subclasses

ABS, Docker, Hcloud, Unknown, Vagrant, Vmpooler

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Interface

Returns a new instance of Interface.



56
57
58
# File 'lib/beaker-hostgenerator/hypervisor.rb', line 56

def initialize(name)
  @name = name
end

Instance Method Details

#generate_node(_node_info, _base_config, _bhg_version) ⇒ Object

Returns a map of host configuration for a single node.

This will be called for each individual node requested in the hosts specification input.

Any configuration that is required by this hypervisor but is not specific to each node can be put in the ‘global_config` map.

Parameters:

  • node_info (Hash{String=>String})

    General info about the given node, such as the ostype, nodeid, and bits.

  • base_config (Hash{String=>Object})

    The node definition so far, which serves a starting point for this hypervisor to build upon. It is expected that this map will be merged into the map returned by this method.

  • bhg_version (Integer)

    The version of OS info to use when building up the node definition.



91
92
93
# File 'lib/beaker-hostgenerator/hypervisor.rb', line 91

def generate_node(_node_info, _base_config, _bhg_version)
  raise "Method 'generate_node' not implemented!"
end

#global_configObject

Returns a map containing any general configuration required by this hypervisor. This map will be merged into the ‘CONFIG’ section of the final hosts configuration output.

This will only be called if the hypervisor is used for a node, in which case the returned map will be merged in with global configuration from other hypervisors.



67
68
69
# File 'lib/beaker-hostgenerator/hypervisor.rb', line 67

def global_config
  {}
end