Class: KnifeESX::DeployScript

Inherits:
Object
  • Object
show all
Defined in:
lib/chef/knife/esx_vm_create.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(batch_file) ⇒ DeployScript

Sample job


:test1:

'vm-memory':
'extra-args': 
'esx-host':
'template-file': 
'vm-disk': 
'ssh-user':
'ssh-password': 
'run-list': 
'network-interface':


42
43
44
45
46
47
48
49
50
# File 'lib/chef/knife/esx_vm_create.rb', line 42

def initialize(batch_file)
  @batch_file = batch_file
  @jobs = []
  @job_count = 0 
  (YAML.load_file batch_file).each do |i|
    @jobs << DeployJob.new(i)
    @job_count += 1
  end
end

Instance Attribute Details

#job_countObject (readonly)

Returns the value of attribute job_count.



28
29
30
# File 'lib/chef/knife/esx_vm_create.rb', line 28

def job_count
  @job_count
end

Instance Method Details

#each_job(&block) ⇒ Object



52
53
54
55
56
# File 'lib/chef/knife/esx_vm_create.rb', line 52

def each_job(&block)
  @jobs.each do |j|
    yield j
  end
end