Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d1f9c50fc | ||
|
|
15b317e2ef | ||
|
|
b0cb998506 | ||
|
|
9ef2748ef3 | ||
|
|
3358b47dc7 | ||
|
|
f90756d87c | ||
|
|
82bf74b42a | ||
|
|
11dc1f4c26 | ||
|
|
d26dc21d11 | ||
|
|
f991317131 | ||
|
|
24ca4a662a | ||
|
|
cb1632ab17 | ||
|
|
875d5c4205 | ||
|
|
5730588e55 | ||
|
|
cf2ce99452 | ||
|
|
a38ae55c7f |
6
.github/workflows/release.yml
vendored
6
.github/workflows/release.yml
vendored
@@ -21,7 +21,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Litmus Parallel
|
||||
uses: puppetlabs/action-litmus_parallel@master
|
||||
uses: puppetlabs/action-litmus_parallel@main
|
||||
with:
|
||||
platform: ${{ matrix.platform }}
|
||||
agent_family: ${{ matrix.agent_family }}
|
||||
@@ -40,7 +40,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Litmus Parallel
|
||||
uses: puppetlabs/action-litmus_parallel@master
|
||||
uses: puppetlabs/action-litmus_parallel@main
|
||||
with:
|
||||
platform: ${{ matrix.platform }}
|
||||
agent_family: ${{ matrix.agent_family }}
|
||||
@@ -65,7 +65,7 @@ jobs:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- name: Spec Tests
|
||||
uses: puppetlabs/action-litmus_spec@master
|
||||
uses: puppetlabs/action-litmus_spec@main
|
||||
with:
|
||||
puppet_gem_versionm: ${{ matrix.puppet_gem_version }}
|
||||
check: ${{ matrix.check }}
|
||||
|
||||
6
.github/workflows/weekly.yml
vendored
6
.github/workflows/weekly.yml
vendored
@@ -20,7 +20,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Litmus Parallel
|
||||
uses: puppetlabs/action-litmus_parallel@master
|
||||
uses: puppetlabs/action-litmus_parallel@main
|
||||
with:
|
||||
platform: ${{ matrix.platform }}
|
||||
agent_family: ${{ matrix.agent_family }}
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Litmus Parallel
|
||||
uses: puppetlabs/action-litmus_parallel@master
|
||||
uses: puppetlabs/action-litmus_parallel@main
|
||||
with:
|
||||
platform: ${{ matrix.platform }}
|
||||
agent_family: ${{ matrix.agent_family }}
|
||||
@@ -58,7 +58,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
- name: Spec Tests
|
||||
uses: puppetlabs/action-litmus_spec@master
|
||||
uses: puppetlabs/action-litmus_spec@main
|
||||
with:
|
||||
puppet_gem_version: ${{ matrix.puppet_gem_version }}
|
||||
check: ${{ matrix.check }}
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
- travis_deb
|
||||
- travis_el6
|
||||
- travis_el7
|
||||
- travis_el8
|
||||
complex:
|
||||
- collection:
|
||||
puppet_collection:
|
||||
|
||||
24
.travis.yml
24
.travis.yml
@@ -82,6 +82,17 @@ jobs:
|
||||
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
|
||||
services: docker
|
||||
stage: acceptance
|
||||
-
|
||||
before_script:
|
||||
- "bundle exec rake 'litmus:provision_list[travis_el8]'"
|
||||
- "bundle exec rake 'litmus:install_agent[puppet5]'"
|
||||
- "bundle exec rake litmus:install_module"
|
||||
bundler_args:
|
||||
env: PLATFORMS=travis_el8_puppet5
|
||||
rvm: 2.5.7
|
||||
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
|
||||
services: docker
|
||||
stage: acceptance
|
||||
-
|
||||
before_script:
|
||||
- "bundle exec rake 'litmus:provision_list[travis_deb]'"
|
||||
@@ -115,6 +126,17 @@ jobs:
|
||||
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
|
||||
services: docker
|
||||
stage: acceptance
|
||||
-
|
||||
before_script:
|
||||
- "bundle exec rake 'litmus:provision_list[travis_el8]'"
|
||||
- "bundle exec rake 'litmus:install_agent[puppet6]'"
|
||||
- "bundle exec rake litmus:install_module"
|
||||
bundler_args:
|
||||
env: PLATFORMS=travis_el8_puppet6
|
||||
rvm: 2.5.7
|
||||
script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"]
|
||||
services: docker
|
||||
stage: acceptance
|
||||
-
|
||||
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
|
||||
stage: static
|
||||
@@ -128,7 +150,7 @@ jobs:
|
||||
stage: spec
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- main
|
||||
- /^v\d/
|
||||
- release
|
||||
notifications:
|
||||
|
||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -2,9 +2,22 @@
|
||||
|
||||
All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org).
|
||||
|
||||
## [v6.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.2.0) (2020-05-27)
|
||||
## [v6.4.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.3.0) (2020-11-09)
|
||||
|
||||
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.2.0...v6.2.0)
|
||||
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.3.0...v6.3.0)
|
||||
|
||||
### Added
|
||||
|
||||
- Add support for SAP Java \(sapjvm / sapmachine\) [\#433](https://github.com/puppetlabs/puppetlabs-java/pull/433) ([timdeluxe](https://github.com/timdeluxe))
|
||||
|
||||
### Fixed
|
||||
|
||||
- \[IAC-1208\] - Add the good links for solving the 404 error and exclude sles [\#443](https://github.com/puppetlabs/puppetlabs-java/pull/443) ([daianamezdrea](https://github.com/daianamezdrea))
|
||||
- \(IAC-993\) - Removal of inappropriate terminology [\#439](https://github.com/puppetlabs/puppetlabs-java/pull/439) ([david22swan](https://github.com/david22swan))
|
||||
|
||||
## [v6.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.3.0) (2020-05-27)
|
||||
|
||||
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.2.0...v6.3.0)
|
||||
|
||||
### Added
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ process as easy as possible.
|
||||
|
||||
To submit your changes via a GitHub pull request, we _highly_
|
||||
recommend that you have them on a topic branch, instead of
|
||||
directly on "master".
|
||||
directly on "main".
|
||||
It makes things much easier to keep track of, especially if
|
||||
you decide to work on another thing before your first change
|
||||
is merged in.
|
||||
|
||||
2
Gemfile
2
Gemfile
@@ -29,8 +29,6 @@ group :development do
|
||||
gem "puppet-module-win-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||
gem "puppet-module-win-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||
gem "github_changelog_generator", require: false, git: 'https://github.com/skywinder/github-changelog-generator', ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')
|
||||
gem 'ed25519', '>= 1.2', '< 2.0'
|
||||
gem 'bcrypt_pbkdf', '>= 1.0', '< 2.0'
|
||||
end
|
||||
|
||||
puppet_version = ENV['PUPPET_GEM_VERSION']
|
||||
|
||||
73
README.md
73
README.md
@@ -55,6 +55,8 @@ java::download { 'jdk8' :
|
||||
}
|
||||
```
|
||||
|
||||
## AdoptOpenJDK
|
||||
|
||||
The defined type `java::adopt` installs one or more versions of AdoptOpenJDK Java. `java::adopt` depends on [puppet/archive](https://github.com/voxpupuli/puppet-archive).
|
||||
|
||||
```puppet
|
||||
@@ -70,7 +72,7 @@ java::adopt { 'jdk11' :
|
||||
java => 'jdk',
|
||||
}
|
||||
```
|
||||
#TODO
|
||||
|
||||
To install a specific release of a AdoptOpenJDK Java version, e.g. 8u202-b08, provide both parameters `version_major` and `version_minor` as follows:
|
||||
|
||||
```puppet
|
||||
@@ -105,9 +107,61 @@ java::adopt { 'jdk8' :
|
||||
}
|
||||
```
|
||||
|
||||
## SAP Java (sapjvm / sapmachine)
|
||||
|
||||
SAP also offers JVM distributions. They are mostly required for their SAP products. In earlier versions it is called "sapjvm", in newer versions they call it "sapmachine".
|
||||
|
||||
The defined type `java::sap` installs one or more versions of sapjvm (if version 7 or 8) or sapmachine (if version > 8) Java. `java::sap` depends on [puppet/archive](https://github.com/voxpupuli/puppet-archive).
|
||||
By using this defined type with versions 7 or 8 you agree with the EULA presented at https://tools.hana.ondemand.com/developer-license-3_1.txt!
|
||||
|
||||
```puppet
|
||||
java::sap { 'sapjvm8' :
|
||||
ensure => 'present',
|
||||
version => '8',
|
||||
java => 'jdk',
|
||||
}
|
||||
|
||||
java::sap { 'sapmachine11' :
|
||||
ensure => 'present',
|
||||
version => '11',
|
||||
java => 'jdk',
|
||||
}
|
||||
```
|
||||
|
||||
To install a specific release of a SAP Java version, e.g. sapjvm 8.1.063, provide parameter `version_full`:
|
||||
|
||||
```puppet
|
||||
java::sap { 'jdk8' :
|
||||
ensure => 'present',
|
||||
version_full => '8.1.063',
|
||||
java => 'jdk',
|
||||
}
|
||||
```
|
||||
|
||||
To install SAP Java to a non-default basedir (defaults: /usr/lib/jvm for Debian; /usr/java for RedHat):
|
||||
```puppet
|
||||
java::adopt { 'sapjvm8' :
|
||||
ensure => 'present',
|
||||
version_full => '8.1.063',
|
||||
java => 'jdk',
|
||||
basedir => '/custom/java',
|
||||
}
|
||||
```
|
||||
|
||||
To ensure that a custom basedir is a directory before SAP Java is installed (note: manage separately for custom ownership or perms):
|
||||
```puppet
|
||||
java::adopt { 'sapjvm8' :
|
||||
ensure => 'present',
|
||||
version_full => '8.1.063',
|
||||
java => 'jdk',
|
||||
manage_basedir => true,
|
||||
basedir => '/custom/java',
|
||||
}
|
||||
```
|
||||
|
||||
## Reference
|
||||
|
||||
For information on the classes and types, see the [REFERENCE.md](https://github.com/puppetlabs/puppetlabs-java/blob/master/REFERENCE.md). For information on the facts, see below.
|
||||
For information on the classes and types, see the [REFERENCE.md](https://github.com/puppetlabs/puppetlabs-java/blob/main/REFERENCE.md). For information on the facts, see below.
|
||||
|
||||
### Facts
|
||||
|
||||
@@ -123,7 +177,7 @@ The java module includes a few facts to describe the version of Java installed o
|
||||
|
||||
## Limitations
|
||||
|
||||
For an extensive list of supported operating systems, see [metadata.json](https://github.com/puppetlabs/puppetlabs-java/blob/master/metadata.json)
|
||||
For an extensive list of supported operating systems, see [metadata.json](https://github.com/puppetlabs/puppetlabs-java/blob/main/metadata.json)
|
||||
|
||||
This module cannot guarantee installation of Java versions that are not available on platform repositories.
|
||||
|
||||
@@ -140,7 +194,7 @@ OpenJDK is supported on:
|
||||
* Oracle Linux 6, 7
|
||||
* Scientific Linux 6
|
||||
* Debian 8, 9
|
||||
* Ubuntu 14.04, 16.04, 18.04
|
||||
* Ubuntu 14.04, 16.04, 18.04, 20.04
|
||||
* Solaris 11
|
||||
* SLES 11, 12
|
||||
|
||||
@@ -161,6 +215,17 @@ AdoptOpenJDK Java is supported on:
|
||||
* Amazon Linux
|
||||
* Debian
|
||||
|
||||
SAP Java 7 and 8 (=sapjvm) are supported (by SAP) on:
|
||||
|
||||
* SLES 12, 15
|
||||
* Oracle Linux 7, 8
|
||||
* Red Hat Enterprise Linux (RHEL) 7, 8
|
||||
|
||||
(however installations on other distributions mostly also work well)
|
||||
|
||||
For SAP Java > 8 (=sapmachine) please refer to the OpenJDK list as it is based on OpenJDK and has no special requirements.
|
||||
|
||||
|
||||
### Known issues
|
||||
|
||||
Where Oracle change the format of the URLs to different installer packages, the curl to fetch the package may fail with a HTTP/404 error. In this case, passing a full known good URL using the `url` parameter will allow the module to still be able to install specific versions of the JRE/JDK. Note the `version_major` and `version_minor` parameters must be passed and must match the version downloaded using the known URL in the `url` parameter.
|
||||
|
||||
91
REFERENCE.md
91
REFERENCE.md
@@ -20,6 +20,7 @@ options, even though those are not in the package repositories.
|
||||
|
||||
* [`java::adopt`](#javaadopt): Install one or more versions of AdoptOpenJDK Java.
|
||||
* [`java::download`](#javadownload): Installs Java from a url location.
|
||||
* [`java::sap`](#javasap): Install one or more versions of SAPJVM or Sapmachine
|
||||
|
||||
## Classes
|
||||
|
||||
@@ -342,3 +343,93 @@ The name for the optional symlink in the installation directory.
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
### java::sap
|
||||
|
||||
Defined Type java::sap
|
||||
|
||||
#### Parameters
|
||||
|
||||
The following parameters are available in the `java::sap` defined type.
|
||||
|
||||
##### `ensure`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Install or remove the package.
|
||||
|
||||
Default value: 'present'
|
||||
|
||||
##### `version`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Version of Java to install, e.g. '8' or '9'. Default values for full versions will be used.
|
||||
|
||||
Default value: '8'
|
||||
|
||||
##### `version_full`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Major version which should be installed, e.g. '8.1.063' or '11.0.7'. If used, "version" parameter is ignored.
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
##### `java`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Type of Java Edition to install, jdk or jre.
|
||||
|
||||
Default value: 'jdk'
|
||||
|
||||
##### `proxy_server`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive)
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
##### `proxy_type`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Proxy server type (none|http|https|ftp). (passed to archive)
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
##### `basedir`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Directory under which the installation will occur. If not set, defaults to
|
||||
/usr/lib/jvm for Debian and /usr/java for RedHat.
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
##### `manage_basedir`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Whether to manage the basedir directory. Defaults to false.
|
||||
Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter.
|
||||
|
||||
Default value: `true`
|
||||
|
||||
##### `manage_symlink`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Whether to manage a symlink that points to the installation directory. Defaults to false.
|
||||
|
||||
Default value: `false`
|
||||
|
||||
##### `symlink_name`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
The name for the optional symlink in the installation directory.
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
|
||||
13
Rakefile
13
Rakefile
@@ -52,7 +52,7 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
|
||||
config.header = "# Change log\n\nAll notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org)."
|
||||
config.add_pr_wo_labels = true
|
||||
config.issues = false
|
||||
config.merge_prefix = "### UNCATEGORIZED PRS; GO LABEL THEM"
|
||||
config.merge_prefix = "### UNCATEGORIZED PRS; LABEL THEM ON GITHUB"
|
||||
config.configure_sections = {
|
||||
"Changed" => {
|
||||
"prefix" => "### Changed",
|
||||
@@ -60,11 +60,11 @@ if Bundler.rubygems.find_name('github_changelog_generator').any?
|
||||
},
|
||||
"Added" => {
|
||||
"prefix" => "### Added",
|
||||
"labels" => ["feature", "enhancement"],
|
||||
"labels" => ["enhancement", "feature"],
|
||||
},
|
||||
"Fixed" => {
|
||||
"prefix" => "### Fixed",
|
||||
"labels" => ["bugfix"],
|
||||
"labels" => ["bug", "documentation", "bugfix"],
|
||||
},
|
||||
}
|
||||
end
|
||||
@@ -72,16 +72,15 @@ else
|
||||
desc 'Generate a Changelog from GitHub'
|
||||
task :changelog do
|
||||
raise <<EOM
|
||||
The changelog tasks depends on unreleased features of the github_changelog_generator gem.
|
||||
The changelog tasks depends on recent features of the github_changelog_generator gem.
|
||||
Please manually add it to your .sync.yml for now, and run `pdk update`:
|
||||
---
|
||||
Gemfile:
|
||||
optional:
|
||||
':development':
|
||||
- gem: 'github_changelog_generator'
|
||||
git: 'https://github.com/skywinder/github-changelog-generator'
|
||||
ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018'
|
||||
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')"
|
||||
version: '~> 1.15'
|
||||
condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')"
|
||||
EOM
|
||||
end
|
||||
end
|
||||
|
||||
227
manifests/sap.pp
Normal file
227
manifests/sap.pp
Normal file
@@ -0,0 +1,227 @@
|
||||
# Defined Type java::sap
|
||||
#
|
||||
# @summary
|
||||
# Install one or more versions of SAPJVM or Sapmachine
|
||||
#
|
||||
# @param ensure
|
||||
# Install or remove the package.
|
||||
#
|
||||
# @param version
|
||||
# Version of Java to install, e.g. '8' or '9'. Default values for full versions will be used.
|
||||
#
|
||||
# @param version_full
|
||||
# Major version which should be installed, e.g. '8.1.063' or '11.0.7'. If used, "version" parameter is ignored.
|
||||
#
|
||||
# @param java
|
||||
# Type of Java Edition to install, jdk or jre.
|
||||
#
|
||||
# @param proxy_server
|
||||
# Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive)
|
||||
#
|
||||
# @param proxy_type
|
||||
# Proxy server type (none|http|https|ftp). (passed to archive)
|
||||
#
|
||||
# @param basedir
|
||||
# Directory under which the installation will occur. If not set, defaults to
|
||||
# /usr/lib/jvm for Debian and /usr/java for RedHat.
|
||||
#
|
||||
# @param manage_basedir
|
||||
# Whether to manage the basedir directory. Defaults to false.
|
||||
# Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter.
|
||||
#
|
||||
# @param manage_symlink
|
||||
# Whether to manage a symlink that points to the installation directory. Defaults to false.
|
||||
#
|
||||
# @param symlink_name
|
||||
# The name for the optional symlink in the installation directory.
|
||||
#
|
||||
define java::sap (
|
||||
$ensure = 'present',
|
||||
$version = '8',
|
||||
$version_full = undef,
|
||||
$java = 'jdk',
|
||||
$proxy_server = undef,
|
||||
$proxy_type = undef,
|
||||
$basedir = undef,
|
||||
$manage_basedir = true,
|
||||
$manage_symlink = false,
|
||||
$symlink_name = undef,
|
||||
) {
|
||||
|
||||
# archive module is used to download the java package
|
||||
include ::archive
|
||||
|
||||
# validate java edition to download
|
||||
if $java !~ /(jre|jdk)/ {
|
||||
fail('java must be either jre or jdk.')
|
||||
}
|
||||
|
||||
# determine version and installation path
|
||||
if $version_full {
|
||||
|
||||
$_version_array = $version_full.scanf('%i')
|
||||
$_version_int = $_version_array[0]
|
||||
|
||||
$_version_full = $version_full
|
||||
|
||||
} else {
|
||||
$_version = $version
|
||||
$_version_int = Numeric($_version)
|
||||
# use default versions if full version parameter is not provided
|
||||
case $version {
|
||||
'7' : {
|
||||
$_version_full = '7.1.072'
|
||||
if ($java != 'jdk') {
|
||||
fail('java parameter is not jdk. jre is not supported on version 7')
|
||||
}
|
||||
}
|
||||
'8' : {
|
||||
$_version_full = '8.1.065'
|
||||
if ($java != 'jdk') {
|
||||
fail('java parameter is not jdk. jre is not supported on version 8')
|
||||
}
|
||||
}
|
||||
'11' : {
|
||||
$_version_full = '11.0.7'
|
||||
}
|
||||
'14' : {
|
||||
$_version_full = '14.0.1'
|
||||
}
|
||||
default : {
|
||||
fail("${version} not yet supported by module")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# extracted folders look like this:
|
||||
# sapjvm_8
|
||||
# sapmachine-jdk-11.0.7
|
||||
if ($_version_int == 7 or $_version_int == 8) {
|
||||
$_creates_folder = "sapjvm_${_version_int}"
|
||||
} else {
|
||||
$_creates_folder = "sapmachine-${java}-${_version_full}"
|
||||
}
|
||||
|
||||
# determine destination directory based on OS
|
||||
case $facts['kernel'] {
|
||||
'Linux' : {
|
||||
case $facts['os']['family'] {
|
||||
'RedHat', 'Amazon' : {
|
||||
if $basedir {
|
||||
$_basedir = $basedir
|
||||
} else {
|
||||
$_basedir = '/usr/java'
|
||||
}
|
||||
}
|
||||
'Debian' : {
|
||||
if $basedir {
|
||||
$_basedir = $basedir
|
||||
} else {
|
||||
$_basedir = '/usr/lib/jvm'
|
||||
}
|
||||
}
|
||||
default : {
|
||||
fail ("unsupported os family ${$facts['os']['name']}") }
|
||||
}
|
||||
|
||||
$creates_path = "${_basedir}/${_creates_folder}"
|
||||
}
|
||||
default : {
|
||||
fail ( "unsupported platform ${$facts['kernel']}" ) }
|
||||
}
|
||||
|
||||
$_os_architecture = $facts['os']['architecture'] ? {
|
||||
undef => $facts['architecture'],
|
||||
default => $facts['os']['architecture']
|
||||
}
|
||||
|
||||
if ($_os_architecture != 'x86_64' and $_os_architecture != 'amd64') {
|
||||
fail ("unsupported platform ${_os_architecture}")
|
||||
}
|
||||
|
||||
# download links look like this (examples):
|
||||
# https://tools.hana.ondemand.com/additional/sapjvm-8.1.065-linux-x64.zip
|
||||
# https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.7/sapmachine-jre-11.0.7_linux-x64_bin.tar.gz
|
||||
# https://github.com/SAP/SapMachine/releases/download/sapmachine-11.0.7/sapmachine-jdk-11.0.7_linux-x64_bin.tar.gz
|
||||
# https://github.com/SAP/SapMachine/releases/download/sapmachine-14.0.1/sapmachine-jdk-14.0.1_linux-x64_bin.tar.gz
|
||||
|
||||
# cookie is currently at version 3.1, but may be changed one day. It is only required for download at SAP.
|
||||
# by using this module you agree with the EULA presented at tools.hana.ondemand.com download page!
|
||||
# Github does not require it
|
||||
|
||||
if ( $_version_int == 7 or $_version_int == 8 ) {
|
||||
# sapjvm download
|
||||
$archive_filename = "sapjvm-${_version_full}-linux-x64.zip"
|
||||
$source = "https://tools.hana.ondemand.com/additional/${archive_filename}"
|
||||
$cookie = 'eula_3_1_agreed=tools.hana.ondemand.com/developer-license-3_1.txt'
|
||||
|
||||
if (!defined(Package['unzip'])) {
|
||||
package { 'unzip':
|
||||
ensure => 'present',
|
||||
before => Archive["/tmp/${archive_filename}"],
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$archive_filename = "sapmachine-${java}-${_version_full}_linux-x64_bin.tar.gz"
|
||||
$source = "https://github.com/SAP/SapMachine/releases/download/sapmachine-${_version_full}/${archive_filename}"
|
||||
$cookie = undef
|
||||
|
||||
if (!defined(Package['tar'])) {
|
||||
package { 'tar':
|
||||
ensure => 'present',
|
||||
before => Archive["/tmp/${archive_filename}"],
|
||||
}
|
||||
}
|
||||
if (!defined(Package['gzip'])) {
|
||||
package { 'gzip':
|
||||
ensure => 'present',
|
||||
before => Archive["/tmp/${archive_filename}"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
case $ensure {
|
||||
'present' : {
|
||||
case $facts['kernel'] {
|
||||
'Linux' : {
|
||||
if ($manage_basedir or $facts['os']['family'] == 'Debian'){
|
||||
if (!defined(File[$_basedir])) {
|
||||
file { $_basedir:
|
||||
ensure => 'directory',
|
||||
before => Archive["/tmp/${archive_filename}"],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
archive { "/tmp/${archive_filename}" :
|
||||
ensure => present,
|
||||
source => $source,
|
||||
extract => true,
|
||||
extract_path => $_basedir,
|
||||
cleanup => false,
|
||||
creates => $creates_path,
|
||||
cookie => $cookie,
|
||||
proxy_server => $proxy_server,
|
||||
proxy_type => $proxy_type,
|
||||
}
|
||||
|
||||
if ($manage_symlink and $symlink_name) {
|
||||
file { "${_basedir}/${symlink_name}":
|
||||
ensure => link,
|
||||
target => $creates_path,
|
||||
require => Archive["/tmp/${archive_filename}"],
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
default : {
|
||||
fail ("unsupported platform ${$facts['kernel']}")
|
||||
}
|
||||
}
|
||||
}
|
||||
default : {
|
||||
notice ("Action ${ensure} not supported.")
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "puppetlabs-java",
|
||||
"version": "6.3.0",
|
||||
"version": "6.4.0",
|
||||
"author": "puppetlabs",
|
||||
"summary": "Installs the correct Java package on various platforms.",
|
||||
"license": "Apache-2.0",
|
||||
@@ -81,7 +81,7 @@
|
||||
"version_requirement": ">= 5.5.10 < 7.0.0"
|
||||
}
|
||||
],
|
||||
"template-url": "https://github.com/puppetlabs/pdk-templates#master",
|
||||
"template-ref": "heads/master-0-g88b05c7",
|
||||
"pdk-version": "1.17.0"
|
||||
"template-url": "https://github.com/puppetlabs/pdk-templates#main",
|
||||
"template-ref": "heads/main-0-gd610ead",
|
||||
"pdk-version": "1.18.1"
|
||||
}
|
||||
|
||||
@@ -20,10 +20,13 @@ travis_el6:
|
||||
travis_el7:
|
||||
provisioner: docker
|
||||
images: ['litmusimage/centos:7', 'litmusimage/oraclelinux:7', 'litmusimage/scientificlinux:7']
|
||||
travis_el8:
|
||||
provisioner: docker
|
||||
images: ['litmusimage/centos:8']
|
||||
release_checks_5:
|
||||
provisioner: abs
|
||||
images: ['redhat-6-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'centos-6-x86_64', 'centos-7-x86_64', 'centos-8-x86_64', 'oracle-6-x86_64', 'oracle-7-x86_64', 'scientific-6-x86_64', 'scientific-7-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64', 'sles-11-x86_64', 'sles-12-x86_64', 'sles-15-x86_64']
|
||||
images: ['redhat-6-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'centos-6-x86_64', 'centos-7-x86_64', 'centos-8-x86_64', 'oracle-6-x86_64', 'oracle-7-x86_64', 'scientific-6-x86_64', 'scientific-7-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64', 'sles-12-x86_64', 'sles-15-x86_64']
|
||||
release_checks_6:
|
||||
provisioner: abs
|
||||
images: ['redhat-6-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'centos-6-x86_64', 'centos-7-x86_64', 'centos-8-x86_64', 'oracle-6-x86_64', 'oracle-7-x86_64', 'scientific-6-x86_64', 'scientific-7-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64', 'ubuntu-2004-x86_64', 'sles-11-x86_64', 'sles-12-x86_64', 'sles-15-x86_64']
|
||||
|
||||
images: ['redhat-6-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'centos-6-x86_64', 'centos-7-x86_64', 'centos-8-x86_64', 'oracle-6-x86_64', 'oracle-7-x86_64', 'scientific-6-x86_64', 'scientific-7-x86_64', 'debian-8-x86_64', 'debian-9-x86_64', 'debian-10-x86_64', 'ubuntu-1404-x86_64', 'ubuntu-1604-x86_64', 'ubuntu-1804-x86_64', 'ubuntu-2004-x86_64', 'sles-12-x86_64', 'sles-15-x86_64']
|
||||
|
||||
|
||||
@@ -138,6 +138,55 @@ install_adopt_jdk_jre = <<EOL
|
||||
}
|
||||
EOL
|
||||
|
||||
sap_enabled = true
|
||||
sap_version7 = '7'
|
||||
sap_version7_full = '7.1.072'
|
||||
sap_version8 = '8'
|
||||
sap_version8_full = '8.1.065'
|
||||
sap_version11 = '11'
|
||||
sap_version11_full = '11.0.7'
|
||||
sap_version14 = '14'
|
||||
sap_version14_full = '14.0.1'
|
||||
|
||||
install_sap_jdk_jre = <<EOL
|
||||
java::sap {
|
||||
'test_sap_jdk_version7':
|
||||
version => '#{sap_version7}',
|
||||
version_full => '#{sap_version7_full}',
|
||||
java => 'jdk',
|
||||
}
|
||||
java::sap {
|
||||
'test_sap_jdk_version8':
|
||||
version => '#{sap_version8}',
|
||||
version_full => '#{sap_version8_full}',
|
||||
java => 'jdk',
|
||||
}
|
||||
java::sap {
|
||||
'test_sap_jre_version11':
|
||||
version => '#{sap_version11}',
|
||||
version_full => '#{sap_version11_full}',
|
||||
java => 'jre',
|
||||
}
|
||||
java::sap {
|
||||
'test_sap_jdk_version11':
|
||||
version => '#{sap_version11}',
|
||||
version_full => '#{sap_version11_full}',
|
||||
java => 'jdk',
|
||||
}
|
||||
java::sap {
|
||||
'test_sap_jre_version14':
|
||||
version => '#{sap_version14}',
|
||||
version_full => '#{sap_version14_full}',
|
||||
java => 'jre',
|
||||
}
|
||||
java::sap {
|
||||
'test_sap_jdk_version14':
|
||||
version => '#{sap_version14}',
|
||||
version_full => '#{sap_version14_full}',
|
||||
java => 'jdk',
|
||||
}
|
||||
EOL
|
||||
|
||||
context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do
|
||||
it 'installs jre' do
|
||||
idempotent_apply(java_class_jre)
|
||||
@@ -219,3 +268,13 @@ context 'java::adopt', if: adopt_enabled, unless: UNSUPPORTED_PLATFORMS.include?
|
||||
idempotent_apply(install_adopt_jdk_jre)
|
||||
end
|
||||
end
|
||||
|
||||
context 'java::adopt', if: sap_enabled && ['Sles'].include?(os[:family]), unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do
|
||||
let(:install_path) do
|
||||
(os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm'
|
||||
end
|
||||
|
||||
it 'installs adopt jdk and jre' do
|
||||
idempotent_apply(install_sap_jdk_jre)
|
||||
end
|
||||
end
|
||||
|
||||
255
spec/defines/sap_spec.rb
Normal file
255
spec/defines/sap_spec.rb
Normal file
@@ -0,0 +1,255 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'java::sap', type: :define do
|
||||
context 'with CentOS 64-bit' do
|
||||
let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'x86_64', name: 'CentOS', release: { full: '6.0' } } } }
|
||||
|
||||
context 'when manage_symlink is set to true' do
|
||||
let(:params) do
|
||||
{
|
||||
ensure: 'present',
|
||||
version: '11',
|
||||
java: 'jdk',
|
||||
basedir: '/usr/java',
|
||||
manage_symlink: true,
|
||||
symlink_name: 'java_home',
|
||||
}
|
||||
end
|
||||
let(:title) { 'jdk11_symlink' }
|
||||
|
||||
it { is_expected.to contain_file('/usr/java/java_home') }
|
||||
end
|
||||
|
||||
context 'when manage_symlink is not set' do
|
||||
let(:params) { { ensure: 'present', version: '11', java: 'jdk' } }
|
||||
let(:title) { 'jdk11_nosymlink' }
|
||||
|
||||
it { is_expected.not_to contain_file('/usr/java/java_home') }
|
||||
end
|
||||
|
||||
context 'when sapjvm 7' do
|
||||
let(:params) { { ensure: 'present', version: '7', java: 'jdk' } }
|
||||
let(:title) { 'jdk7' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapjvm-7.1.072-linux-x64.zip') }
|
||||
end
|
||||
|
||||
context 'when sapjvm 8' do
|
||||
let(:params) { { ensure: 'present', version: '8', java: 'jdk' } }
|
||||
let(:title) { 'jdk8' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapjvm-8.1.065-linux-x64.zip') }
|
||||
end
|
||||
|
||||
context 'when sapmachine 11 jdk' do
|
||||
let(:params) { { ensure: 'present', version: '11', java: 'jdk' } }
|
||||
let(:title) { 'jdk11' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapmachine-jdk-11.0.7_linux-x64_bin.tar.gz') }
|
||||
end
|
||||
|
||||
context 'when sapmachine 11 jre' do
|
||||
let(:params) { { ensure: 'present', version: '11', java: 'jre' } }
|
||||
let(:title) { 'jre11' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapmachine-jre-11.0.7_linux-x64_bin.tar.gz') }
|
||||
end
|
||||
|
||||
context 'when sapmachine 14 jdk' do
|
||||
let(:params) { { ensure: 'present', version: '14', java: 'jdk' } }
|
||||
let(:title) { 'jdk14' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapmachine-jdk-14.0.1_linux-x64_bin.tar.gz') }
|
||||
end
|
||||
|
||||
context 'when sapmachine 14 jre' do
|
||||
let(:params) { { ensure: 'present', version: '14', java: 'jre' } }
|
||||
let(:title) { 'jre14' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapmachine-jre-14.0.1_linux-x64_bin.tar.gz') }
|
||||
end
|
||||
|
||||
context 'when installing multiple versions' do
|
||||
let(:params) do
|
||||
{
|
||||
ensure: 'present',
|
||||
version_full: '11.0.7',
|
||||
java: 'jdk',
|
||||
}
|
||||
end
|
||||
let(:title) { 'jdk1107' }
|
||||
|
||||
let(:pre_condition) do
|
||||
<<-EOL
|
||||
java::sap {
|
||||
'jdk1106':
|
||||
ensure => 'present',
|
||||
version_full => '11.0.6',
|
||||
java => 'jdk',
|
||||
}
|
||||
EOL
|
||||
end
|
||||
|
||||
it { is_expected.to compile }
|
||||
end
|
||||
|
||||
context 'when specifying basedir' do
|
||||
let(:params) do
|
||||
{
|
||||
ensure: 'present',
|
||||
version: '8',
|
||||
java: 'jdk',
|
||||
basedir: '/usr/java',
|
||||
}
|
||||
end
|
||||
let(:title) { 'jdk8' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapjvm-8.1.065-linux-x64.zip') }
|
||||
end
|
||||
context 'when manage_basedir is set to true' do
|
||||
let(:params) do
|
||||
{
|
||||
ensure: 'present',
|
||||
version: '8',
|
||||
java: 'jdk',
|
||||
basedir: '/usr/java',
|
||||
manage_basedir: true,
|
||||
}
|
||||
end
|
||||
let(:title) { 'jdk8' }
|
||||
|
||||
it { is_expected.to contain_file('/usr/java') }
|
||||
end
|
||||
end
|
||||
|
||||
context 'with Ubuntu 64-bit' do
|
||||
let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '16.04' } } } }
|
||||
|
||||
context 'when sapjvm 7' do
|
||||
let(:params) { { ensure: 'present', version: '7', java: 'jdk' } }
|
||||
let(:title) { 'jdk7' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapjvm-7.1.072-linux-x64.zip') }
|
||||
end
|
||||
|
||||
context 'when sapjvm 8' do
|
||||
let(:params) { { ensure: 'present', version: '8', java: 'jdk' } }
|
||||
let(:title) { 'jdk8' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapjvm-8.1.065-linux-x64.zip') }
|
||||
end
|
||||
|
||||
context 'when sapmachine 11 jdk' do
|
||||
let(:params) { { ensure: 'present', version: '11', java: 'jdk' } }
|
||||
let(:title) { 'jdk11' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapmachine-jdk-11.0.7_linux-x64_bin.tar.gz') }
|
||||
end
|
||||
|
||||
context 'when sapmachine 11 jre' do
|
||||
let(:params) { { ensure: 'present', version: '11', java: 'jre' } }
|
||||
let(:title) { 'jre11' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapmachine-jre-11.0.7_linux-x64_bin.tar.gz') }
|
||||
end
|
||||
|
||||
context 'when sapmachine 14 jdk' do
|
||||
let(:params) { { ensure: 'present', version: '14', java: 'jdk' } }
|
||||
let(:title) { 'jdk14' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapmachine-jdk-14.0.1_linux-x64_bin.tar.gz') }
|
||||
end
|
||||
|
||||
context 'when sapmachine 14 jre' do
|
||||
let(:params) { { ensure: 'present', version: '14', java: 'jre' } }
|
||||
let(:title) { 'jre14' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/sapmachine-jre-14.0.1_linux-x64_bin.tar.gz') }
|
||||
end
|
||||
|
||||
context 'when installing multiple versions' do
|
||||
let(:params) do
|
||||
{
|
||||
ensure: 'present',
|
||||
version_full: '11.0.7',
|
||||
java: 'jdk',
|
||||
}
|
||||
end
|
||||
let(:title) { 'jdk1107' }
|
||||
|
||||
let(:pre_condition) do
|
||||
<<-EOL
|
||||
java::sap {
|
||||
'jdk1106':
|
||||
ensure => 'present',
|
||||
version_full => '11.0.6',
|
||||
java => 'jdk',
|
||||
}
|
||||
EOL
|
||||
end
|
||||
|
||||
it { is_expected.to compile }
|
||||
end
|
||||
end
|
||||
describe 'incompatible OSes' do
|
||||
[
|
||||
{
|
||||
kernel: 'Windows',
|
||||
os: {
|
||||
family: 'Windows',
|
||||
name: 'Windows',
|
||||
release: {
|
||||
full: '8.1',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
kernel: 'Darwin',
|
||||
os: {
|
||||
family: 'Darwin',
|
||||
name: 'Darwin',
|
||||
release: {
|
||||
full: '13.3.0',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
kernel: 'AIX',
|
||||
os: {
|
||||
family: 'AIX',
|
||||
name: 'AIX',
|
||||
release: {
|
||||
full: '7100-02-00-000',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
kernel: 'AIX',
|
||||
os: {
|
||||
family: 'AIX',
|
||||
name: 'AIX',
|
||||
release: {
|
||||
full: '6100-07-04-1216',
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
kernel: 'AIX',
|
||||
os: {
|
||||
family: 'AIX',
|
||||
name: 'AIX',
|
||||
release: {
|
||||
full: '5300-12-01-1016',
|
||||
},
|
||||
},
|
||||
},
|
||||
].each do |facts|
|
||||
let(:facts) { facts }
|
||||
let(:title) { 'jdk' }
|
||||
|
||||
it "is_expected.to fail on #{facts[:os][:name]} #{facts[:os][:release][:full]}" do
|
||||
expect { catalogue }.to raise_error Puppet::Error, %r{unsupported platform}
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user