Module: Chef::DSL::Recipe
- Defined in:
- lib/chef/provisioning/recipe_dsl.rb
Constant Summary collapse
- NOT_PASSED =
Object.new
- @@next_machine_batch_index =
0
Instance Method Summary collapse
- #add_machine_options(options, &block) ⇒ Object
- #current_image_options ⇒ Object
- #current_machine_options ⇒ Object
- #machine_batch(name = nil, &block) ⇒ Object
- #machine_batch_default_name ⇒ Object
- #with_driver(driver, options = nil, &block) ⇒ Object
- #with_image_options(image_options, &block) ⇒ Object
- #with_machine_options(machine_options, &block) ⇒ Object
Instance Method Details
#add_machine_options(options, &block) ⇒ Object
34 35 36 |
# File 'lib/chef/provisioning/recipe_dsl.rb', line 34 def (, &block) run_context.chef_provisioning.(, &block) end |
#current_image_options ⇒ Object
42 43 44 |
# File 'lib/chef/provisioning/recipe_dsl.rb', line 42 def run_context.chef_provisioning. end |
#current_machine_options ⇒ Object
30 31 32 |
# File 'lib/chef/provisioning/recipe_dsl.rb', line 30 def run_context.chef_provisioning. end |
#machine_batch(name = nil, &block) ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/chef/provisioning/recipe_dsl.rb', line 59 def machine_batch(name = nil, &block) name ||= machine_batch_default_name recipe = self declare_resource(:machine_batch, name) do from_recipe recipe instance_eval(&block) end end |
#machine_batch_default_name ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/chef/provisioning/recipe_dsl.rb', line 50 def machine_batch_default_name @@next_machine_batch_index += 1 if @@next_machine_batch_index > 1 "default#{@@next_machine_batch_index}" else "default" end end |
#with_driver(driver, options = nil, &block) ⇒ Object
22 23 24 |
# File 'lib/chef/provisioning/recipe_dsl.rb', line 22 def with_driver(driver, = nil, &block) run_context.chef_provisioning.with_driver(driver, , &block) end |
#with_image_options(image_options, &block) ⇒ Object
38 39 40 |
# File 'lib/chef/provisioning/recipe_dsl.rb', line 38 def (, &block) run_context.chef_provisioning.(, &block) end |
#with_machine_options(machine_options, &block) ⇒ Object
26 27 28 |
# File 'lib/chef/provisioning/recipe_dsl.rb', line 26 def (, &block) run_context.chef_provisioning.(, &block) end |