Skip to content

Commit

Permalink
Merge pull request #140 from cantenesse/control_default
Browse files Browse the repository at this point in the history
added support to determine whether to set installed java version to defa...
  • Loading branch information
carmstrong committed Feb 24, 2014
2 parents c076f8c + 9d6d4b9 commit 3258352
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
default['java']['arch'] = kernel['machine'] =~ /x86_64/ ? "x86_64" : "i586"
default['java']['openjdk_packages'] = []
default['java']['accept_license_agreement'] = false
default['java']['set_default'] = true

case node['platform_family']
when "windows"
Expand Down
1 change: 1 addition & 0 deletions recipes/ibm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

java_alternatives 'set-java-alternatives' do
java_location node['java']['java_home']
default node['java']['set_default']
case node['java']['jdk_version'].to_s
when "6"
bin_cmds node['java']['ibm']['6']['bin_cmds']
Expand Down
1 change: 1 addition & 0 deletions recipes/ibm_tar.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@

java_alternatives 'set-java-alternatives' do
java_location node['java']['java_home']
default node['java']['set_default']
case node['java']['jdk_version'].to_s
when "6"
bin_cmds node['java']['ibm']['6']['bin_cmds']
Expand Down
1 change: 1 addition & 0 deletions recipes/openjdk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
if platform_family?('debian', 'rhel', 'fedora')
java_alternatives 'set-java-alternatives' do
java_location jdk.java_home
default node['java']['set_default']
priority jdk.alternatives_priority
case node['java']['jdk_version'].to_s
when "6"
Expand Down
1 change: 1 addition & 0 deletions recipes/oracle.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

java_ark "jdk" do
url tarball_url
default node['java']['set_default']
checksum tarball_checksum
app_home java_home
bin_cmds bin_cmds
Expand Down
1 change: 1 addition & 0 deletions recipes/oracle_i386.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@

java_ark "jdk-alt" do
url tarball_url
default node['java']['set_default']
checksum tarball_checksum
app_home java_home
bin_cmds bin_cmds
Expand Down
4 changes: 2 additions & 2 deletions recipes/oracle_rpm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
Chef::Application.fatal "Unsupported oracle RPM type (#{node['java']['oracle_rpm']['type']})"
end

if platform_family?('rhel', 'fedora')
if platform_family?('rhel', 'fedora') and node['java']['set_default']

bash 'update-java-alternatives' do
java_home = node['java']['java_home']
Expand All @@ -52,5 +52,5 @@

package node['java']['oracle_rpm']['type'] do
action :upgrade
notifies :run, 'bash[update-java-alternatives]', :immediately if platform_family?('rhel', 'fedora')
notifies :run, 'bash[update-java-alternatives]', :immediately if platform_family?('rhel', 'fedora') and node['java']['set_default']
end

0 comments on commit 3258352

Please sign in to comment.