module Chef::DSL::Recipe
Part of a family of DSL
mixins.
Chef::DSL::Recipe
mixes into Recipes and LWRP Providers.
- this does not target core chef resources and providers. - this is restricted to recipe/resource/provider context where a resource collection exists. - cookbook authors should typically include modules into here.
Chef::DSL::Core
mixes into Recipes, LWRP Providers and Core
Providers
- this adds cores providers on top of the Recipe DSL. - this is restricted to recipe/resource/provider context where a resource collection exists. - core chef authors should typically include modules into here.
Chef::DSL::Universal
mixes into Recipes, LWRP Resources+Providers, Core
Resources+Providers, and Attributes files.
- this adds resources and attributes files. - do not add helpers which manipulate the resource collection. - this is for general-purpose stuff that is useful nearly everywhere. - it also pollutes the namespace of nearly every context, watch out.
Public Instance Methods
exec(args)
click to toggle source
# File lib/chef/dsl/recipe.rb, line 66 def exec(args) raise Chef::Exceptions::ResourceNotFound, "exec was called, but you probably meant to use an execute resource. If not, please call Kernel#exec explicitly. The exec block called was \"#{args}\"" end
have_resource_class_for?(snake_case_name)
click to toggle source
# File lib/chef/dsl/recipe.rb, line 60 def have_resource_class_for?(snake_case_name) not resource_class_for(snake_case_name).nil? rescue NameError false end
resource_class_for(snake_case_name)
click to toggle source
# File lib/chef/dsl/recipe.rb, line 56 def resource_class_for(snake_case_name) Chef::Resource.resource_for_node(snake_case_name, run_context.node) end