- From: Jesse Nelson <
>
- To:
- Subject: [chef] Re: including recipes vs normal ruby require/include
- Date: Thu, 16 Feb 2012 08:26:35 -0800
you totally can build out your own modules in cookbook/libraries and
mix into the various chef resources as you need.
include_recipe provides you with a way to pull in and execute other
recipes at that point in the current recipe. As well as make sure any
defines etc are available. Tho i think the latter is better handled in
the metadata with depends clauses.
On Thu, Feb 16, 2012 at 7:09 AM,
<
>
wrote:
>
>
Chef folks,
>
>
I have a question about code reuse in Chef.
>
>
I know it’s not unusual for a recipe to include another recipe using the
>
“include recipe” construct. But why is this better than using the normal
>
Ruby mechanisms for code reuse? Couldn’t I organize my reusable bits of
>
Chef
>
code into ordinary Ruby modules, and then use the ordinary Ruby require and
>
include tools to pull in the reusable bits as needed? My prejudice is to
>
stick
>
to the normal Ruby way unless there's a compelling reason not to.
>
>
Jeff
Archive powered by MHonArc 2.6.16.