Class: ClcMachine::DataBag

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

Constant Summary collapse

TMP_DIR =
'/tmp/ClcMachine/data_bags'

Instance Method Summary collapse

Constructor Details

#initialize(stamp) ⇒ DataBag

Returns a new instance of DataBag.



6
7
8
# File 'lib/clc_machine/data_bag.rb', line 6

def initialize(stamp)
  @stamp = stamp
end

Instance Method Details

#rawObject



18
19
20
# File 'lib/clc_machine/data_bag.rb', line 18

def raw
  @raw ||= load_databag
end

#vsphere_datacenter(hypervisor_type = :standard) ⇒ Object



10
11
12
# File 'lib/clc_machine/data_bag.rb', line 10

def vsphere_datacenter(hypervisor_type = :standard)
  raw[:hypervisors][hypervisor_type][0]['datacenter']
end

#vsphere_server(hypervisor_type = :standard) ⇒ Object



14
15
16
# File 'lib/clc_machine/data_bag.rb', line 14

def vsphere_server(hypervisor_type = :standard)
  raw[:hypervisors][hypervisor_type][0]['vsphere_server']
end