Class: KnifeESX::DeployScript
- Inherits:
-
Object
- Object
- KnifeESX::DeployScript
- Defined in:
- lib/chef/knife/esx_vm_create.rb
Instance Attribute Summary collapse
-
#job_count ⇒ Object
readonly
Returns the value of attribute job_count.
Instance Method Summary collapse
- #each_job(&block) ⇒ Object
-
#initialize(batch_file) ⇒ DeployScript
constructor
Sample job — :test1: ‘vm-memory’: ‘extra-args’: ‘esx-host’: ‘template-file’: ‘vm-disk’: ‘ssh-user’: ‘ssh-password’: ‘run-list’: ‘network-interface’:.
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':
41 42 43 44 45 46 47 48 49 |
# File 'lib/chef/knife/esx_vm_create.rb', line 41 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_count ⇒ Object (readonly)
Returns the value of attribute job_count.
27 28 29 |
# File 'lib/chef/knife/esx_vm_create.rb', line 27 def job_count @job_count end |
Instance Method Details
#each_job(&block) ⇒ Object
51 52 53 54 55 |
# File 'lib/chef/knife/esx_vm_create.rb', line 51 def each_job(&block) @jobs.each do |j| yield j end end |