Class: MotherBrain::Bootstrap::Worker::Host Private

Inherits:
Object
  • Object
show all
Defined in:
lib/mb/bootstrap/worker.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Used internally within the MotherBrain::Bootstrap::Worker to identify hosts which should be partially or fully bootstrapped.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname) ⇒ Host

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Host.

Parameters:

  • hostname (String)

    A fully qualified hostname for a machine



20
21
22
# File 'lib/mb/bootstrap/worker.rb', line 20

def initialize(hostname)
  @hostname = hostname
end

Instance Attribute Details

#hostnameString (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The fully qualified hostname of the machine

Examples:

"reset.riotgames.com"

Returns:

  • (String)


16
17
18
# File 'lib/mb/bootstrap/worker.rb', line 16

def hostname
  @hostname
end

Instance Method Details

#full_bootstrap?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


25
26
27
# File 'lib/mb/bootstrap/worker.rb', line 25

def full_bootstrap?
  node_name.nil?
end

#node_nameString

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

The name of the machine as seen in Chef

Examples:

"reset"

Returns:

  • (String)


35
36
37
# File 'lib/mb/bootstrap/worker.rb', line 35

def node_name
  @node_name ||= NodeQuerier.instance.registered_as(hostname)
end

#partial_bootstrap?Boolean

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns:

  • (Boolean)


40
41
42
# File 'lib/mb/bootstrap/worker.rb', line 40

def partial_bootstrap?
  node_name.present?
end

#to_sObject

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



44
45
46
# File 'lib/mb/bootstrap/worker.rb', line 44

def to_s
  "#{node_name}(#{hostname})"
end