Add option to manage symlink

This commit is contained in:
Frank Wall
2019-02-25 14:28:11 +01:00
parent 3d8f80e4d9
commit 343ad7c468
2 changed files with 31 additions and 0 deletions

View File

@@ -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
#
@@ -117,6 +123,8 @@ define java::oracle (
$basedir = undef,
$manage_basedir = false,
$package_type = undef,
$manage_symlink = false,
$symlink_name = undef,
) {
# archive module is used to download the java package
@@ -344,6 +352,14 @@ define java::oracle (
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",