Skip to content

Commit 6d3282e

Browse files
committed
added support for RedHat distributions family and for openjdk-8
1 parent e160150 commit 6d3282e

5 files changed

Lines changed: 42 additions & 23 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
##2016-11-07 - Release - 1.1.0
1+
##2016-11-10 - Release - 1.1.0
22
###Summary
33
Added support for RedHat and CentOS distributions.
4+
Removed support fo Ubuntu 10.04.
5+
Removed restriction on specific Ubuntu versions.
6+
Added java_8.
47

58
##2015-07-12 - Release - 1.0.3
69
###Summary

README.markdown

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This is the java module. It allows to install Java OpenJDK and configure the def
1919

2020
##Module Description
2121

22-
The module provides classes and defines to install Java OpenJDK and configure the java alternative on Ubuntu platforms.
22+
The module provides classes and defines to install Java OpenJDK and configure the java alternative on Debian and RedHat family distributions.
2323
It allows to install multiple Java versions on the same node.
2424

2525
##Setup
@@ -36,7 +36,7 @@ The module has no special requirements.
3636

3737
###Beginning with java
3838

39-
The module provides two classes to install Java OpenJDK 6 and 7 respectively. This is done, for example, by declarations as the following:
39+
The module provides three classes to install Java OpenJDK 6, 7 and 8 respectively. This is done, for example, by declarations as the following:
4040

4141
```
4242
include java_7
@@ -64,6 +64,7 @@ It is possible to install multiple versions of Java on a single node and to spec
6464

6565
* [`java::java_6`](#javajava_6): Installs open-jdk-6.
6666
* [`java::java_7`](#javajava_7): Installs open-jdk-7.
67+
* [`java::java_8`](#javajava_8): Installs open-jdk-8.
6768

6869
###Defines
6970

@@ -81,6 +82,9 @@ Installs OpenJDK-6 from the repositories.
8182
###`java::java_7`
8283
Installs OpenJDK-7 from the repositories.
8384

85+
###`java::java_8`
86+
Installs OpenJDK-8 from the repositories.
87+
8488
###`java::java`
8589
Install a specific version of java jdk and possibly sets update-alternative default.
8690
If hiera defines a value for the parameter `java::java_default_version` on
@@ -92,16 +96,16 @@ Declares all other defines in the java module needed for installing Java. Curren
9296
####Parameters
9397

9498
#####`java_version`
95-
Specifies the java version to install. Valid options: '6' or '7'. Defaults to the resource title.
99+
Specifies the java version to install. Valid options: '6', '7' or '8'. Defaults to the resource title.
96100

97101
#####`java_default_version`
98-
Specifies the default java in case multiple versions are installed. Valid options: '6' or '7'. Defaults to the hiera defined key `java::java_default_version`.
102+
Specifies the default java in case multiple versions are installed. Valid options: '6', '7' or '8'. Defaults to the hiera defined key `java::java_default_version`.
99103

100104
##Limitations
101105

102-
At the moment the module targets only OpenJDK 6 and 7 on Ubuntu, RedHat and CentOS platforms. Specifically, it is tested only on Ubuntu 10.04 and 12.04, CentOS 6.6 distributions; although probably it will work also on more recent versions.
106+
At the moment the module targets only OpenJDK 6, 7 and 8 on Debian, Ubuntu, RedHat and CentOS platforms. Specifically, it is tested only on Ubuntu 12.04 and CentOS 6.6 distributions; although probably it will work also on different versions.
103107

104108
##Development
105109

106-
If you need some feature please send me a (pull) request or send me an email at: dsestero 'at' gmail 'dot' com.
110+
If you need some feature please send me a (pull) request and send me an email at: dsestero 'at' gmail 'dot' com.
107111

manifests/install_config.pp

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,12 @@
1212
# none
1313
#
1414
define java::install_config ($java_default_version, $java_version = $title,) {
15-
case $::operatingsystem {
16-
'Ubuntu' : {
17-
case $::operatingsystemrelease {
18-
'10.04' : {
19-
$javapkg = "openjdk-${java_version}-jdk"
20-
$javadir = "/usr/lib/jvm/java-${java_version}-openjdk/jre/bin/java"
21-
}
22-
'12.04' : {
15+
case osfamily {
16+
'Debian' : {
2317
$javapkg = "openjdk-${java_version}-jdk"
2418
$javadir = "/usr/lib/jvm/java-${java_version}-openjdk-${::architecture}/jre/bin/java"
25-
}
26-
default : {
27-
fail("The ${module_name} module is not supported on ${::operatingsystem} release ${::operatingsystemrelease}")
28-
}
29-
}
3019
}
31-
'CentOS', 'RedHat' : {
20+
'RedHat' : {
3221
$javapkg = "java-1.${java_version}.0-openjdk"
3322
$javadir = "/usr/lib/jvm/jre-1.${java_version}.0-openjdk.${::architecture}/bin/java"
3423
}

manifests/java_8.pp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Class: java::java_8
2+
#
3+
# This class installs Java-8.
4+
#
5+
# Parameters:
6+
#
7+
# none
8+
#
9+
# Actions:
10+
#
11+
# Installs Java-8 by declaring the +java+ define.
12+
#
13+
# Requires: see Modulefile
14+
#
15+
# Sample Usage:
16+
#
17+
# include java::java_8
18+
class java::java_8 {
19+
20+
java {'8': }
21+
}

metadata.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010
"requirements": [{"name": "puppet", "version_requirement": ">= 3.0.0"}],
1111
"operatingsystem_support": [
1212
{
13-
"operatingsystem": "Ubuntu",
14-
"operatingsystemrelease": ["10.04", "12.04"]
13+
"operatingsystem": "Ubuntu"
14+
},
15+
{
16+
"operatingsystem": "Debian"
1517
},
1618
{
1719
"operatingsystem": "RedHat"

0 commit comments

Comments
 (0)