Skip to content
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
16 changes: 16 additions & 0 deletions manifests/oracle.pp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@
# Whether to manage the basedir directory. Defaults to false.
# Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter.
#
# [*manage_symlink*]
# Whether to manage a symlink that points to the installation directory. Defaults to false.
#
# [*symlink_name*]
# The name for the optional symlink in the installation directory.
#
# ### Author
# mike@marseglia.org
#
Expand All @@ -117,6 +123,8 @@
$basedir = undef,
$manage_basedir = false,
$package_type = undef,
$manage_symlink = false,
$symlink_name = undef,
) {

# archive module is used to download the java package
Expand Down Expand Up @@ -344,6 +352,14 @@
require => $install_requires
}

if ($manage_symlink and $symlink_name) {
file { "${_basedir}/${symlink_name}":
ensure => link,
target => $creates_path,
require => Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"]
}
}

if ($jce and $jce_download != undef) {
$jce_path = $java_se ? {
'jre' => "${creates_path}/lib/security",
Expand Down
15 changes: 15 additions & 0 deletions spec/defines/oracle_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,21 @@

it { is_expected.to contain_file('/usr/java') }
end
context 'when manage_symlink is set to true' do
let(:params) do
{
ensure: 'present',
version: '6',
java_se: 'jdk',
basedir: '/usr/java',
manage_symlink: true,
symlink_name: 'java_home',
}
end
let(:title) { 'jdk6' }

it { is_expected.to contain_file('/usr/java/java_home') }
end
end

context 'when on CentOS 32-bit' do
Expand Down