(MODULES-2971) Add java_home to all operating systems

This patch adds the java_home variable to all supported
operating systemd, and gives the user the option to
set it themselves. It also updates config.pp to
ensure that the JAVA_HOME variable is set to
the desired java_home.
This commit is contained in:
Nate Potter
2016-07-15 18:19:03 -07:00
parent 71a8bed51d
commit dd8f85a2fa
4 changed files with 136 additions and 22 deletions

View File

@@ -9,6 +9,11 @@ class java::config ( ) {
unless => "test /etc/alternatives/java -ef '${java::use_java_alternative_path}'",
}
}
if $java::use_java_home != undef {
file { '/etc/environment':
content => inline_template("JAVA_HOME=${$java::use_java_home}"),
}
}
}
'RedHat': {
if $java::use_java_alternative != undef and $java::use_java_alternative_path != undef {
@@ -29,6 +34,39 @@ class java::config ( ) {
unless => "test /etc/alternatives/java -ef '${java::use_java_alternative_path}'",
}
}
if $java::use_java_home != undef {
file { '/etc/environment':
content => inline_template("JAVA_HOME=${$java::use_java_home}"),
}
}
}
'OpenBSD': {
if $java::use_java_home != undef {
file { '/etc/environment':
content => inline_template("JAVA_HOME=${$java::use_java_home}"),
}
}
}
'FreeBSD': {
if $java::use_java_home != undef {
file { '/etc/environment':
content => inline_template("JAVA_HOME=${$java::use_java_home}"),
}
}
}
'Suse': {
if $java::use_java_home != undef {
file { '/etc/environment':
content => inline_template("JAVA_HOME=${$java::use_java_home}"),
}
}
}
'Solaris': {
if $java::use_java_home != undef {
file { '/etc/environment':
content => inline_template("JAVA_HOME=${$java::use_java_home}"),
}
}
}
default: {
# Do nothing.