Class: HostDefinition

Inherits:
Object
  • Object
show all
Defined in:
lib/sshotgun.rb

Overview

Class to contain information about each server

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname, category = "", os = "", desc = "") ⇒ HostDefinition

Returns a new instance of HostDefinition.



40
41
42
43
44
45
46
# File 'lib/sshotgun.rb', line 40

def initialize(hostname, category = "", os = "", desc = "")
  @hostname = hostname
  @category = category
  @os = os
  @desc = desc
  @status = ""
end

Instance Attribute Details

#categoryObject

category is a freeform identifier for the type of the host. e.g. “production”, “devint”, “qaint”, “staging” (optional)



29
30
31
# File 'lib/sshotgun.rb', line 29

def category
  @category
end

#descObject

desc is a one sentence string describing main purpose of the host (optional)



35
36
37
# File 'lib/sshotgun.rb', line 35

def desc
  @desc
end

#hostnameObject

hostname is the primary hostname or fqdn (NOT an alias). It is better to only refer to the primary DNS entry for a machine or VM.



26
27
28
# File 'lib/sshotgun.rb', line 26

def hostname
  @hostname
end

#osObject

os is a freeform string indicating os name + server/workstation + version. e.g. ubuntu_server_7.10 (optional)



32
33
34
# File 'lib/sshotgun.rb', line 32

def os
  @os
end

#statusObject

status is freeform text field that the script programmer can set. Generally set to “started”, “finished”, “aborted”, etc.



38
39
40
# File 'lib/sshotgun.rb', line 38

def status
  @status
end