Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

change oracle url to example.com and add failure message instructing

user to set up private repository
  • Loading branch information...
commit f45610f66e3181c1ebf6462b9e2bd27fae9bd859 1 parent 8deff04
@bryanwb bryanwb authored
Showing with 16 additions and 4 deletions.
  1. +4 −4 attributes/default.rb
  2. +12 −0 recipes/oracle.rb
View
8 attributes/default.rb
@@ -35,18 +35,18 @@
# jdk6 attributes
# x86_64
-default['java']['jdk']['6']['x86_64']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-x64.bin'
+default['java']['jdk']['6']['x86_64']['url'] = 'http://download.example.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-x64.bin'
default['java']['jdk']['6']['x86_64']['checksum'] = '928220f4e46c5dabef0440791c48023945629d8a23998e072157e04960d8a759'
# i586
-default['java']['jdk']['6']['i586']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-i586.bin'
+default['java']['jdk']['6']['i586']['url'] = 'http://download.example.com/otn-pub/java/jdk/6u30-b12/jdk-6u30-linux-i586.bin'
default['java']['jdk']['6']['i586']['checksum'] = 'b551be83a690bc9fec0107d9aa4f828cd47e150fa54cbedbfa8f80c99e2f18b5'
# jdk7 attributes
# x86_64
-default['java']['jdk']['7']['x86_64']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-x64.tar.gz'
+default['java']['jdk']['7']['x86_64']['url'] = 'http://download.example.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-x64.tar.gz'
default['java']['jdk']['7']['x86_64']['checksum'] = '411a204122c5e45876d6edae1a031b718c01e6175833740b406e8aafc37bc82d'
# i586
-default['java']['jdk']['7']['i586']['url'] = 'http://download.oracle.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-i586.tar.gz'
+default['java']['jdk']['7']['i586']['url'] = 'http://download.example.com/otn-pub/java/jdk/7u2-b13/jdk-7u2-linux-i586.tar.gz'
default['java']['jdk']['7']['i586']['checksum'] = '74faad48fef2c368276dbd1fd6c02520b0e9ebdcb1621916c1af345fc3ba65d1'
View
12 recipes/oracle.rb
@@ -36,12 +36,24 @@
tarball_checksum = node['java']['jdk']['7'][arch]['checksum']
end
+if tarball_url =~ /example.com/
+ Chef::Application.fatal!("You must change the download link to your private repository. You can no longer download java directly from http://download.oracle.com without a web broswer")
+end
+
ruby_block "set-env-java-home" do
block do
ENV["JAVA_HOME"] = java_home
end
end
+file "/etc/profile.d/jdk.sh" do
+ content <<-EOS
+ export JAVA_HOME=#{node['java']["java_home"]}
+ EOS
+ mode 0755
+end
+
+
java_ark "jdk" do
url tarball_url
checksum tarball_checksum
Please sign in to comment.
Something went wrong with that request. Please try again.