Module: Chef::DSL::Recipe
- Defined in:
- lib/chef_metal/recipe_dsl.rb
Instance Method Summary collapse
- #add_provisioner_options(options, &block) ⇒ Object
- #current_provisioner_options ⇒ Object
-
#machine(name, &block) ⇒ Object
When the machine resource is first declared, create a machine_batch (if there isn’t one already).
- #with_machine_batch(the_machine_batch, options = {}, &block) ⇒ Object
- #with_provisioner(provisioner, &block) ⇒ Object
- #with_provisioner_options(provisioner_options, &block) ⇒ Object
Instance Method Details
#add_provisioner_options(options, &block) ⇒ Object
33 34 35 |
# File 'lib/chef_metal/recipe_dsl.rb', line 33 def (, &block) run_context..(, &block) end |
#current_provisioner_options ⇒ Object
29 30 31 |
# File 'lib/chef_metal/recipe_dsl.rb', line 29 def run_context.. end |
#machine(name, &block) ⇒ Object
When the machine resource is first declared, create a machine_batch (if there isn’t one already)
39 40 41 42 43 44 |
# File 'lib/chef_metal/recipe_dsl.rb', line 39 def machine(name, &block) if !run_context..current_machine_batch run_context..with_machine_batch declare_resource(:machine_batch, 'default', caller[0]) end declare_resource(:machine, name, caller[0], &block) end |
#with_machine_batch(the_machine_batch, options = {}, &block) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/chef_metal/recipe_dsl.rb', line 15 def with_machine_batch(the_machine_batch, = {}, &block) if the_machine_batch.is_a?(String) the_machine_batch = machine_batch the_machine_batch do if [:action] action [:action] end if [:max_simultaneous] max_simultaneous [:max_simultaneous] end end end run_context..with_machine_batch(the_machine_batch, &block) end |
#with_provisioner(provisioner, &block) ⇒ Object
7 8 9 |
# File 'lib/chef_metal/recipe_dsl.rb', line 7 def with_provisioner(provisioner, &block) run_context..with_provisioner(provisioner, &block) end |
#with_provisioner_options(provisioner_options, &block) ⇒ Object
11 12 13 |
# File 'lib/chef_metal/recipe_dsl.rb', line 11 def (, &block) run_context..(, &block) end |