- From: Tensibai <
>
- To:
- Subject: [chef] Re: Re: Re: Tomcat Cookbook and Oracle JDK
- Date: Thu, 11 Dec 2014 09:47:08 +0100
Le 2014-12-11 00:10, Douglas Garstang a écrit :
Well, this is weird.
Someone else replied before Eric and now that reply has disappeared. His suggestion, well I was going to follow it, and it's gone poof. Where did it go?
I'm confused. The java cookbook in one place says if you want the oracle java to include the 'oracle' recipe. Further down, it says to use attributes. Which is it?
It's also not clear now, and never has been, if setting default['java']['install_flavor'] = 'oracle' in my wrapper cookbook will have an effect on a cookbook two levels away in the stack. Ie if I have A -> B -> C and cookbook A has default['java']['install_flavor'] = 'oracle'... will that affect how cookbook B operates?
Doug.
To answer on the 2 levels away: yes.
I'll try to give an exemple: Cookbook A depends on cookbook B wich in turns edpends on cookbook C. Chef run will load attributes (which is a common hash for all cookbooks) from C then B then A, so values in A will override thoose in C.
After that the recipe will be compiled. For the Java cookbook it will do (from default.rb): include_recipe "java::#{node['java']['install_flavor']}"
So it will include the correct recipe from the attribute value.
Once the compilation is done, chef will enter the converge phase and act on resources, setting them in the desired state (downloading jave, etc)
Hope it helps understanding how it works ;)
More details on the chef run phases here: http://docs.chef.io/chef_client.html#the-chef-client-title-run One of the ticket about this ordering is solved by https://github.com/opscode/chef/pull/508 I can't find doc or a blog post about how the run_list is expanded :/
|
Archive powered by MHonArc 2.6.16.