Re: attribute value availability + the implicit dependency graph and chef-deploy patch


Chronological Thread 
  • From: Ian Kallen <spidaman.list@gmail.com>
  • To: chef@lists.opscode.com
  • Subject: Re: attribute value availability + the implicit dependency graph and chef-deploy patch
  • Date: Thu, 23 Apr 2009 12:46:48 -0700
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; b=JcSzw5vZ1EwpqwmlGhJIlhTf74LtyCwvxv6sX4O21RAIul1EO5XS6fRXP7ShH6td/y VxESzF5lLBiooiAHaA35/LMXEB3ZOktSulCKliNC3A5cWWhb2uI6M/230BX0CDs6Gzdp B3FBhGfW2ENDh1/TsDb1wNXknPV3x0d5oVwWg=

Adam Jacob wrote:
http://wiki.opscode.com/display/chef/Anatomy+of+a+Chef+Run

Libraries are loaded first, then Attributes, then Definitions,
followed by Recipes.

(This is because you may have an Attribute that is set in one
cookbook, but utilized in another.
Great, thanks Adam. Let me make sure I'm following the semantics. Given N cookbooks, the order in which each of the respective attributes loaded is non-deterministic. Ergo a recipe can depend on values being set for attributes in *any* cookbook but having values from one cookbook's attributes depend on values set in another's is essentially a dice roll. Therefore in this case (assume elsewhere we've required another cookbook's recipe where that cookbook's attributes file sets "apache" but it doesn't matter, cookbook attribute processing isn't ordered in anyway)

passenger[:apache_load_path] = "#{apache[:dir]}/mods-available/passenger.load" if attribute?("apache")

whether node[:passenger][:apache_load_path] ever gets set is a matter of luck; the "apache" attribute may or may not be set when this is being processed. However, if the cookbook needs information from another, it must access it in the recipe to rely on it being set. Is that right?

--
Ian Kallen
blog: http://www.arachna.com/roller/spidaman
tweetz: http://twitter.com/spidaman
vox: 415.505.5208




Archive powered by MHonArc 2.6.16.

§