Class: BeakerHostGenerator::Hypervisor::Interface

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

Direct Known Subclasses

ABS, Docker, Unknown, Vagrant, Vmpooler

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Interface

Returns a new instance of Interface.



53
54
55
# File 'lib/beaker-hostgenerator/hypervisor.rb', line 53

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.



88
89
90
# File 'lib/beaker-hostgenerator/hypervisor.rb', line 88

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.



64
65
66
# File 'lib/beaker-hostgenerator/hypervisor.rb', line 64

def global_config()
  {}
end