[chef] Re: Re: Re: Tomcat Cookbook and Oracle JDK


Chronological Thread 
  • 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 :/


On Wed, Dec 10, 2014 at 1:06 PM, Eric Helgeson < "> > wrote:
Yep, you can, take a look at the examples in the readme - https://github.com/agileorbit-cookbooks/java/#examples

Just override some attributes and it will install that version.
 
Also be sure to mirror the oracle binary locally in production, as downloading directly can be troublesome at times https://github.com/agileorbit-cookbooks/java#production-deployment-with-oracle-java
 
-Eric
 

On Wed Dec 10 2014 at 2:32:05 PM Douglas Garstang < "> > wrote:
I was taking a look at the tomcat cookbook for chef, https://github.com/opscode-cookbooks/tomcat.

It installs the OpenJDK. It doesn't seem to have a facility to change that to the Oracle JDK. I look a look inside the tomcat recipe and yep, it's got:

include_recipe "java"

The java cookbook can install the Oracle JDK, but the defaut installs the OpenJDK. Is there a way I can override this without modifying the java or tomcat cookbooks?

Doug



--

 

 



Archive powered by MHonArc 2.6.16.

§