Skip to content

Commit

Permalink
Merge pull request #15 from tylerwalts/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
tylerwalts committed Mar 24, 2014
2 parents b8a644a + 9531082 commit 9ef75ad
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This approach was inspired by: http://stackoverflow.com/questions/10268583/how-t

Currently Supported:
* RedHat Family (RedHat, Fedora, CentOS)
* Java 6, 7
* Java 6, 7, 8

* This may work on other linux flavors but more testing is needed. Please seend feedback!

Expand Down
8 changes: 6 additions & 2 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@
}

case $version {
'8': {
$javaDownloadURI = "http://download.oracle.com/otn-pub/java/jdk/8-b132/jdk-8-linux-${plat_filename}.tar.gz"
$java_home = "${install_dir}/jdk1.8.0"
}
'7': {
$javaDownloadURI = "http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-${plat_filename}.tar.gz"
$java_home = "${install_dir}/jdk1.7.0"
Expand Down Expand Up @@ -86,8 +90,8 @@
}
}

# Java 7 comes in a tarball so just extract it.
if ( $version == '7' ) {
# Java 7/8 comes in a tarball so just extract it.
if ( $version in [ '7', '8' ] ) {
exec { 'extract_jdk':
cwd => "${install_dir}/",
command => "tar -xf ${installerFilename}",
Expand Down
19 changes: 19 additions & 0 deletions spec/classes/jdk_oracle_init_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,25 @@
}
end

context 'specifying version 8' do
let :params do {
:version => '8',
} end

it {
should contain_exec( 'get_jdk_installer').with_creates('/opt/jdk-8-linux-x64.tar.gz')
should contain_file('/opt/jdk-8-linux-x64.tar.gz')
should contain_exec('extract_jdk').with_creates('/opt/jdk1.8.0')
should contain_file('/etc/alternatives/java').with({
:ensure => 'link',
:target => '/opt/jdk1.8.0/bin/java',
})
should contain_file('/opt/jdk-8').with({
:ensure => 'link',
})
}
end

context 'using custom installation directory' do
let :params do {
:install_dir => '/my/path',
Expand Down

0 comments on commit 9ef75ad

Please sign in to comment.