Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added support to determine whether to set installed java version to defa... #140

Merged
merged 3 commits into from
Feb 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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