-
-
Notifications
You must be signed in to change notification settings - Fork 479
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Supply an external package ( rpm/deb ) - Install java if its not managed externally
- Loading branch information
1 parent
1f84aee
commit 7ad74a3
Showing
3 changed files
with
86 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# == Class: elasticsearch::java | ||
# | ||
# This class exists to install java if its not managed from an other module | ||
# | ||
# | ||
# === Parameters | ||
# | ||
# This class does not provide any parameters. | ||
# | ||
# | ||
# === Examples | ||
# | ||
# This class may be imported by other classes to use its functionality: | ||
# class { 'elasticsearch::java': } | ||
# | ||
# It is not intended to be used directly by external resources like node | ||
# definitions or other modules. | ||
# | ||
# | ||
# === Authors | ||
# | ||
# * Richard Pijnenburg <mailto:richard@ispavailability.com> | ||
# | ||
class elasticsearch::java { | ||
|
||
if $elasticsearch::java_package == undef { | ||
# Default Java package | ||
case $::operatingsystem { | ||
'CentOS', 'Fedora', 'Scientific': { | ||
$package = 'java-1.6.0-openjdk' | ||
} | ||
'Debian', 'Ubuntu': { | ||
$package = 'openjdk-6-jre-headless' | ||
} | ||
default: { | ||
fail("\"${module_name}\" provides no java package | ||
for \"${::operatingsystem}\"") | ||
} | ||
} | ||
} else { | ||
$package = $elasticsearch::java_package | ||
} | ||
|
||
package { $package: | ||
ensure => present | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters