[chef-dev] Re: dependency spaghetti


Chronological Thread 
  • From: Peter Donald < >
  • To:
  • Subject: [chef-dev] Re: dependency spaghetti
  • Date: Thu, 3 Oct 2013 11:57:11 +1000

Hi,

On Thu, Oct 3, 2013 at 9:17 AM, Blake Irvin < " target="_blank"> > wrote:
For example, the 'java' cookbook includes a 'depends' for the 'windows' cookbook - this means that I'm forced to download the 'windows' cookbook to all of my *nix machines.  Messy at best.

It also tends to pollute the attribute namespace, possibly add all sorts of code via libraries etc. We hit problems with a dependency monkey patching things to broken-ness. Not fun. 

Thus we tend strip out all non essential cookbooks from depends flags and add suggests where there is an optional context specific dependency. The context is usually dependent on the environment or features used in the cookbook. i.e. The cookbook when run on ubuntu needs 'apt', while on windows it needs 'windows'. The cookbook needs the authbind cookbook if you are using authbind or the runit cookbook if the init system is set to runit. It then becomes the responsibility of the wrapper cookbook to depend on the required dependencies rather than the library cookbook.

The "add a depends for a any potential dependency" philosophy harks back to earlier patterns of chef usage before wrapper/library cookbook distinctions started to being used when cookbooks tended to be fairly tightly wedded to the initial context of use.

--
Cheers,

Peter Donald



Archive powered by MHonArc 2.6.16.

§