[chef] Should this code go in a new recipe for java cookbook or into default.rb?


Chronological Thread 
  • From: Bryan Berry < >
  • To:
  • Subject: [chef] Should this code go in a new recipe for java cookbook or into default.rb?
  • Date: Thu, 24 Nov 2011 08:48:17 +0100

I have written a new recipe for installing java from the rpm provided by oracle. It assumes that you have a private repository where you have placed the rpm

Should I try to put this in the java::sun recipe or a new recipe? 

# java::oracle-yum recipe

package 'jdk' do
        action :install
end

ruby_block "update_alternatives" do
  block do
    jdk_home = %x[ rpm -qi jdk | grep 'Relocations:' ].split(/\s/)[-1] + "/default"
    %x[ update-alternatives --install /usr/bin/java java #{jdk_home}/bin/java 1 ]
    %x[ update-alternatives --set java #{jdk_home}/bin/java ]
  end
end




Archive powered by MHonArc 2.6.16.

§