- From: Noah Kantrowitz <
>
- To:
- Subject: [chef] Re: Recipes execution order
- Date: Tue, 10 Jun 2014 02:16:21 -0700
On Jun 10, 2014, at 1:18 AM, Carlos Camacho
<
>
wrote:
>
Hello!!!
>
>
I'm trying to do some research on how evaluate chef recipes when they
>
are executed.
>
>
For example:
>
>
I have a lot of recipes inside my Apache2 cookbook.
>
>
default.rb
>
god_monitor.rb
>
iptables.rb
>
logrotate.rb
>
...
>
...
>
...
>
>
Is there a way to establish a weight for the recipes order??..
>
>
A) default.rb -> god_monitor.rb -> iptables.rb -> logrotate.rb = 2.3
>
B) default.rb -> iptables.rb -> god_monitor.rb -> logrotate.rb = 3.6
>
C) logrotate.rb -> default.rb -> god_monitor.rb -> iptables.rb = 1
>
D) default.rb -> god_monitor.rb -> iptables.rb -> logrotate.rb = 6.1
>
>
In this case is better to execute D than, B than, A than C.
Recipes execute in the order you tell them to. First the run list is
recursively expanded so roles are replaced by their run list until you just
have a list of recipes. Then each is executed in order. If, while executing,
it hits an include_recipe, then it executes that recipe at that point. All
other file types where it loads all of them are executed is ASCII sort order.
--Noah
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
Archive powered by MHonArc 2.6.16.