Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0bab6cf38 | ||
|
|
8b451e161c | ||
|
|
afb5531a4a | ||
|
|
47a51b4490 | ||
|
|
b64e9a2f88 | ||
|
|
6f05978750 | ||
|
|
c477db3b59 | ||
|
|
00588d2b96 | ||
|
|
2ea5a4adb5 | ||
|
|
018de0aef6 | ||
|
|
74c5c27108 | ||
|
|
ee0e10dc12 | ||
|
|
4913dc0bef | ||
|
|
459757dd65 | ||
|
|
7ce9df174f | ||
|
|
b1ea376937 | ||
|
|
de79582baf | ||
|
|
ea006c0587 | ||
|
|
e57cbc84ec | ||
|
|
d4e5461c26 | ||
|
|
a5aad36b86 | ||
|
|
f70d15207a | ||
|
|
0b1f8df952 | ||
|
|
f83cf9fc38 | ||
|
|
074162d034 | ||
|
|
71b6a47798 | ||
|
|
b670aca0cc | ||
|
|
27fed78308 | ||
|
|
ba9a1dbe45 | ||
|
|
197213e517 | ||
|
|
21d39590b0 | ||
|
|
00c05a826f | ||
|
|
d277391efc | ||
|
|
ce34499671 | ||
|
|
b632db3a3e | ||
|
|
9c8d34f7e7 | ||
|
|
af9c6c1bbe |
@@ -1,9 +1,9 @@
|
||||
fixtures:
|
||||
repositories:
|
||||
archive: "git://github.com/voxpupuli/puppet-archive.git"
|
||||
facts: 'git://github.com/puppetlabs/puppetlabs-facts.git'
|
||||
stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git"
|
||||
puppet_agent: 'git://github.com/puppetlabs/puppetlabs-puppet_agent.git'
|
||||
provision: 'git://github.com/puppetlabs/provision.git'
|
||||
archive: "https://github.com/voxpupuli/puppet-archive.git"
|
||||
facts: 'https://github.com/puppetlabs/puppetlabs-facts.git'
|
||||
stdlib: "https://github.com/puppetlabs/puppetlabs-stdlib.git"
|
||||
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
|
||||
provision: 'https://github.com/puppetlabs/provision.git'
|
||||
symlinks:
|
||||
java: "#{source_dir}"
|
||||
|
||||
@@ -14,7 +14,6 @@ AllCops:
|
||||
- "**/Rakefile"
|
||||
- pkg/**/*
|
||||
- spec/fixtures/**/*
|
||||
- spec/**/*
|
||||
- vendor/**/*
|
||||
- "**/Puppetfile"
|
||||
- "**/Vagrantfile"
|
||||
@@ -28,6 +27,7 @@ GetText/DecorateString:
|
||||
Description: We don't want to decorate test output.
|
||||
Exclude:
|
||||
- spec/**/*
|
||||
Enabled: false
|
||||
RSpec/BeforeAfterAll:
|
||||
Description: Beware of using after(:all) as it may cause state to leak between tests.
|
||||
A necessary evil in acceptance testing.
|
||||
@@ -89,6 +89,12 @@ Style/MethodCalledOnDoEndBlock:
|
||||
Enabled: true
|
||||
Style/StringMethods:
|
||||
Enabled: true
|
||||
GetText/DecorateFunctionMessage:
|
||||
Enabled: false
|
||||
GetText/DecorateStringFormattingUsingInterpolation:
|
||||
Enabled: false
|
||||
GetText/DecorateStringFormattingUsingPercent:
|
||||
Enabled: false
|
||||
Layout/EndOfLine:
|
||||
Enabled: false
|
||||
Layout/IndentHeredoc:
|
||||
|
||||
60
.sync.yml
60
.sync.yml
@@ -7,7 +7,65 @@
|
||||
unmanaged: true
|
||||
|
||||
.travis.yml:
|
||||
unmanaged: true
|
||||
branches:
|
||||
- release
|
||||
includes:
|
||||
-
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=deb_puppet5
|
||||
rvm: 2.5.1
|
||||
before_script:
|
||||
- bundle exec rake 'litmus:provision_list[travis_deb]'
|
||||
- bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
|
||||
- bundle exec rake 'litmus:install_agent[puppet5]'
|
||||
- bundle exec rake litmus:install_module
|
||||
script:
|
||||
- bundle exec rake litmus:acceptance:parallel
|
||||
services: docker
|
||||
sudo: required
|
||||
stage: acceptance
|
||||
-
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=deb_puppet6
|
||||
rvm: 2.5.1
|
||||
before_script:
|
||||
- bundle exec rake 'litmus:provision_list[travis_deb]'
|
||||
- bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
|
||||
- bundle exec rake 'litmus:install_agent[puppet6]'
|
||||
- bundle exec rake litmus:install_module
|
||||
script:
|
||||
- bundle exec rake litmus:acceptance:parallel
|
||||
services: docker
|
||||
-
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=el_puppet5
|
||||
rvm: 2.5.1
|
||||
before_script:
|
||||
- bundle exec rake 'litmus:provision_list[travis_el]'
|
||||
- bundle exec rake 'litmus:install_agent[puppet5]'
|
||||
- bundle exec rake litmus:install_module
|
||||
script:
|
||||
- bundle exec rake litmus:acceptance:parallel
|
||||
services: docker
|
||||
sudo: required
|
||||
stage: acceptance
|
||||
-
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=el_puppet6
|
||||
rvm: 2.5.1
|
||||
before_script:
|
||||
- bundle exec rake 'litmus:provision_list[travis_el]'
|
||||
- bundle exec rake 'litmus:install_agent[puppet6]'
|
||||
- bundle exec rake litmus:install_module
|
||||
script:
|
||||
- bundle exec rake litmus:acceptance:parallel
|
||||
services: docker
|
||||
sudo: required
|
||||
stage: acceptance
|
||||
|
||||
appveyor.yml:
|
||||
delete: true
|
||||
|
||||
91
.travis.yml
91
.travis.yml
@@ -23,59 +23,6 @@ stages:
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
-
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=deb_puppet5
|
||||
rvm: 2.5.1
|
||||
before_script:
|
||||
- bundle exec rake 'litmus:provision_list[travis_deb]'
|
||||
- bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
|
||||
- bundle exec rake 'litmus:install_agent[puppet5]'
|
||||
- bundle exec rake litmus:install_module
|
||||
script:
|
||||
- bundle exec rake litmus:acceptance:parallel
|
||||
services: docker
|
||||
sudo: required
|
||||
-
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=deb_puppet6
|
||||
rvm: 2.5.1
|
||||
before_script:
|
||||
- bundle exec rake 'litmus:provision_list[travis_deb]'
|
||||
- bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'
|
||||
- bundle exec rake 'litmus:install_agent[puppet6]'
|
||||
- bundle exec rake litmus:install_module
|
||||
script:
|
||||
- bundle exec rake litmus:acceptance:parallel
|
||||
services: docker
|
||||
-
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=el_puppet5
|
||||
rvm: 2.5.1
|
||||
before_script:
|
||||
- bundle exec rake 'litmus:provision_list[travis_el]'
|
||||
- bundle exec rake 'litmus:install_agent[puppet5]'
|
||||
- bundle exec rake litmus:install_module
|
||||
script:
|
||||
- bundle exec rake litmus:acceptance:parallel
|
||||
services: docker
|
||||
sudo: required
|
||||
-
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=el_puppet6
|
||||
rvm: 2.5.1
|
||||
before_script:
|
||||
- bundle exec rake 'litmus:provision_list[travis_el]'
|
||||
- bundle exec rake 'litmus:install_agent[puppet6]'
|
||||
- bundle exec rake litmus:install_module
|
||||
script:
|
||||
- bundle exec rake litmus:acceptance:parallel
|
||||
services: docker
|
||||
sudo: required
|
||||
-
|
||||
env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint"
|
||||
stage: static
|
||||
@@ -90,6 +37,44 @@ matrix:
|
||||
-
|
||||
env: DEPLOY_TO_FORGE=yes
|
||||
stage: deploy
|
||||
-
|
||||
before_script: ["bundle exec rake 'litmus:provision_list[travis_deb]'", "bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'", "bundle exec rake 'litmus:install_agent[puppet5]'", "bundle exec rake litmus:install_module"]
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=deb_puppet5
|
||||
rvm: 2.5.1
|
||||
script: ["bundle exec rake litmus:acceptance:parallel"]
|
||||
services: docker
|
||||
stage: acceptance
|
||||
sudo: required
|
||||
-
|
||||
before_script: ["bundle exec rake 'litmus:provision_list[travis_deb]'", "bundle exec bolt command run 'apt-get install wget -y' --inventoryfile inventory.yaml --nodes='localhost*'", "bundle exec rake 'litmus:install_agent[puppet6]'", "bundle exec rake litmus:install_module"]
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=deb_puppet6
|
||||
rvm: 2.5.1
|
||||
script: ["bundle exec rake litmus:acceptance:parallel"]
|
||||
services: docker
|
||||
-
|
||||
before_script: ["bundle exec rake 'litmus:provision_list[travis_el]'", "bundle exec rake 'litmus:install_agent[puppet5]'", "bundle exec rake litmus:install_module"]
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=el_puppet5
|
||||
rvm: 2.5.1
|
||||
script: ["bundle exec rake litmus:acceptance:parallel"]
|
||||
services: docker
|
||||
stage: acceptance
|
||||
sudo: required
|
||||
-
|
||||
before_script: ["bundle exec rake 'litmus:provision_list[travis_el]'", "bundle exec rake 'litmus:install_agent[puppet6]'", "bundle exec rake litmus:install_module"]
|
||||
bundler_args:
|
||||
dist: trusty
|
||||
env: PLATFORMS=el_puppet6
|
||||
rvm: 2.5.1
|
||||
script: ["bundle exec rake litmus:acceptance:parallel"]
|
||||
services: docker
|
||||
stage: acceptance
|
||||
sudo: required
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
|
||||
23
CHANGELOG.md
23
CHANGELOG.md
@@ -2,6 +2,29 @@
|
||||
|
||||
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.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.0.0) (2019-11-11)
|
||||
|
||||
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v5.0.1...v6.0.0)
|
||||
|
||||
### Changed
|
||||
|
||||
- pdksync - FM-8499 - remove ubuntu14 support [\#398](https://github.com/puppetlabs/puppetlabs-java/pull/398) ([lionce](https://github.com/lionce))
|
||||
|
||||
### Added
|
||||
|
||||
- \(FM-8676\) - Support added for CentOS 8 [\#399](https://github.com/puppetlabs/puppetlabs-java/pull/399) ([david22swan](https://github.com/david22swan))
|
||||
- FM-8403 - add support Debain10 [\#387](https://github.com/puppetlabs/puppetlabs-java/pull/387) ([lionce](https://github.com/lionce))
|
||||
|
||||
### Fixed
|
||||
|
||||
- MODULES-10062 - fix acceptance tests on sles [\#397](https://github.com/puppetlabs/puppetlabs-java/pull/397) ([lionce](https://github.com/lionce))
|
||||
- we need to check if java\_default\_home has a value before we attempt t… [\#391](https://github.com/puppetlabs/puppetlabs-java/pull/391) ([robmbrooks](https://github.com/robmbrooks))
|
||||
- Add support for java 11, the default in debian buster 10 [\#386](https://github.com/puppetlabs/puppetlabs-java/pull/386) ([jhooyberghs](https://github.com/jhooyberghs))
|
||||
|
||||
## [v5.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v5.0.1) (2019-08-05)
|
||||
|
||||
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v5.0.0...v5.0.1)
|
||||
|
||||
## [v5.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v5.0.0) (2019-07-29)
|
||||
|
||||
[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v4.1.0...v5.0.0)
|
||||
|
||||
2
CODEOWNERS
Normal file
2
CODEOWNERS
Normal file
@@ -0,0 +1,2 @@
|
||||
# Setting ownership to the modules team
|
||||
* @puppetlabs/modules
|
||||
2
Gemfile
2
Gemfile
@@ -1,4 +1,5 @@
|
||||
source ENV['GEM_SOURCE'] || 'https://rubygems.org'
|
||||
gem 'pdk', git: 'https://github.com/puppetlabs/pdk.git', branch: 'master'
|
||||
|
||||
def location_for(place_or_version, fake_version = nil)
|
||||
git_url_regex = %r{\A(?<url>(https?|git)[:@][^#]*)(#(?<branch>.*))?}
|
||||
@@ -23,6 +24,7 @@ group :development do
|
||||
gem "json", '= 1.8.1', require: false if Gem::Version.new(RUBY_VERSION.dup) == Gem::Version.new('2.1.9')
|
||||
gem "json", '= 2.0.4', require: false if Gem::Requirement.create('~> 2.4.2').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
||||
gem "json", '= 2.1.0', require: false if Gem::Requirement.create(['>= 2.5.0', '< 2.7.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
|
||||
gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||
gem "puppet-module-posix-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
|
||||
gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:ruby]
|
||||
gem "puppet-module-win-default-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw]
|
||||
|
||||
48
REFERENCE.md
48
REFERENCE.md
@@ -18,8 +18,7 @@ options, even though those are not in the package repositories.
|
||||
|
||||
**Defined types**
|
||||
|
||||
* [`java::oracle`](#javaoracle): Installs Oracle Java. By using this module you agree to the Oracle licensing
|
||||
agreement.
|
||||
* [`java::download`](#javadownload): Installs Java from a url location.
|
||||
|
||||
## Classes
|
||||
|
||||
@@ -102,23 +101,13 @@ Default value: `undef`
|
||||
|
||||
## Defined types
|
||||
|
||||
### java::oracle
|
||||
### java::download
|
||||
|
||||
Defined Type java::oracle
|
||||
|
||||
Install one or more versions of Oracle Java.
|
||||
|
||||
Uses the following to download the package and automatically accept
|
||||
the licensing terms:
|
||||
```
|
||||
wget --no-cookies --no-check-certificate --header \
|
||||
"Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" \
|
||||
"http://download.oracle.com/otn-pub/java/jdk/8u131-b11/d54c1d3a095b4ff2b6607d096fa80163/jdk-8u131-linux-x64.tar.gz"
|
||||
```
|
||||
Defined Type java::download
|
||||
|
||||
#### Parameters
|
||||
|
||||
The following parameters are available in the `java::oracle` defined type.
|
||||
The following parameters are available in the `java::download` defined type.
|
||||
|
||||
##### `ensure`
|
||||
|
||||
@@ -160,14 +149,6 @@ Type of Java Standard Edition to install, jdk or jre.
|
||||
|
||||
Default value: 'jdk'
|
||||
|
||||
##### `oracle_url`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Official Oracle URL to download binaries from.
|
||||
|
||||
Default value: 'http://download.oracle.com/otn-pub/java/jdk/'
|
||||
|
||||
##### `proxy_server`
|
||||
|
||||
Data type: `Any`
|
||||
@@ -188,18 +169,7 @@ Default value: `undef`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Full URL, including oracle_url, release_major, release_minor and package_name, to
|
||||
download the Oracle java_se installer. Originally present but not used, activated
|
||||
to workaround MODULES-5058.
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
##### `url_hash`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Directory hash used by the download.oracle.com site. This value is a 32 character string
|
||||
which is part of the file URL returned by the JDK download site.
|
||||
Full URL
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
@@ -211,6 +181,14 @@ Install Oracles Java Cryptographic Extensions into the JRE or JDK
|
||||
|
||||
Default value: `false`
|
||||
|
||||
##### `jce_url`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
Full URL to the jce zip file
|
||||
|
||||
Default value: `undef`
|
||||
|
||||
##### `basedir`
|
||||
|
||||
Data type: `Any`
|
||||
|
||||
13
Rakefile
13
Rakefile
@@ -15,8 +15,17 @@ end
|
||||
|
||||
def changelog_project
|
||||
return unless Rake.application.top_level_tasks.include? "changelog"
|
||||
returnVal = nil || JSON.load(File.read('metadata.json'))['source'].match(%r{.*/([^/]*)})[1]
|
||||
raise "unable to find the changelog_project in .sync.yml or the name in metadata.json" if returnVal.nil?
|
||||
|
||||
returnVal = nil
|
||||
returnVal ||= begin
|
||||
metadata_source = JSON.load(File.read('metadata.json'))['source']
|
||||
metadata_source_match = metadata_source && metadata_source.match(%r{.*\/([^\/]*?)(?:\.git)?\Z})
|
||||
|
||||
metadata_source_match && metadata_source_match[1]
|
||||
end
|
||||
|
||||
raise "unable to find the changelog_project in .sync.yml or calculate it from the source in metadata.json" if returnVal.nil?
|
||||
|
||||
puts "GitHubChangelogGenerator project:#{returnVal}"
|
||||
returnVal
|
||||
end
|
||||
|
||||
@@ -14,7 +14,9 @@ Facter.add(:java_libjvm_path) do
|
||||
confine kernel: ['Linux', 'OpenBSD']
|
||||
setcode do
|
||||
java_default_home = Facter.value(:java_default_home)
|
||||
java_libjvm_file = Dir.glob("#{java_default_home}/jre/lib/**/libjvm.so")
|
||||
if java_default_home
|
||||
java_libjvm_file = Dir.glob("#{java_default_home}/**/lib/**/libjvm.so")
|
||||
end
|
||||
if java_libjvm_file.nil? || java_libjvm_file.empty?
|
||||
nil
|
||||
else
|
||||
|
||||
@@ -16,7 +16,15 @@ Facter.add(:java_major_version) do
|
||||
java_major_version = nil
|
||||
setcode do
|
||||
java_version = Facter.value(:java_version)
|
||||
java_major_version = java_version.strip.split('_')[0].split('.')[1] unless java_version.nil?
|
||||
unless java_version.nil?
|
||||
# First part > 1, use the first part as major version
|
||||
java_version_first_number = java_version.strip.split('.')[0]
|
||||
java_major_version = if java_version_first_number.to_i > 1
|
||||
java_version_first_number
|
||||
else
|
||||
java_version.strip.split('_')[0].split('.')[1]
|
||||
end
|
||||
end
|
||||
end
|
||||
java_major_version
|
||||
end
|
||||
|
||||
@@ -14,7 +14,15 @@ Facter.add(:java_patch_level) do
|
||||
java_patch_level = nil
|
||||
setcode do
|
||||
java_version = Facter.value(:java_version)
|
||||
java_patch_level = java_version.strip.split('_')[1] unless java_version.nil?
|
||||
unless java_version.nil?
|
||||
# First part > 1, use . as seperator to get patch level
|
||||
java_version_first_number = java_version.strip.split('.')[0]
|
||||
java_patch_level = if java_version_first_number.to_i > 1
|
||||
java_version.strip.split('.')[2]
|
||||
else
|
||||
java_version.strip.split('_')[1]
|
||||
end
|
||||
end
|
||||
end
|
||||
java_patch_level
|
||||
end
|
||||
|
||||
@@ -24,7 +24,8 @@ Facter.add(:java_version) do
|
||||
unless ['darwin'].include? Facter.value(:operatingsystem).downcase
|
||||
version = nil
|
||||
if Facter::Util::Resolution.which('java')
|
||||
Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = $LAST_MATCH_INFO[1] if %r{^.+ version \"(.+)\"$} =~ line }
|
||||
Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = $LAST_MATCH_INFO[1] if %r{^.+ version \"(.+)\".*$} =~ line }
|
||||
|
||||
end
|
||||
version
|
||||
end
|
||||
|
||||
@@ -98,7 +98,7 @@ define java::download(
|
||||
# Required for CentOS systems where Java8 update number is >= 171 to ensure
|
||||
# the package is visible to Puppet. This is only true for installations that
|
||||
# don't use the tar.gz package type.
|
||||
if $facts['os']['family'] == 'RedHat' and $2 >= '171' and $package_type != 'tar.gz' {
|
||||
if $facts['os']['family'] == 'RedHat' and Numeric($2) >= 171 and $package_type != 'tar.gz' {
|
||||
$install_path = "${java_se}1.${1}.0_${2}-amd64"
|
||||
} else {
|
||||
$install_path = "${java_se}1.${1}.0_${2}"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "puppetlabs-java",
|
||||
"version": "5.0.0",
|
||||
"version": "6.0.0",
|
||||
"author": "puppetlabs",
|
||||
"summary": "Installs the correct Java package on various platforms.",
|
||||
"license": "Apache-2.0",
|
||||
@@ -32,7 +32,8 @@
|
||||
"operatingsystemrelease": [
|
||||
"5",
|
||||
"6",
|
||||
"7"
|
||||
"7",
|
||||
"8"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -52,13 +53,13 @@
|
||||
"operatingsystem": "Debian",
|
||||
"operatingsystemrelease": [
|
||||
"8",
|
||||
"9"
|
||||
"9",
|
||||
"10"
|
||||
]
|
||||
},
|
||||
{
|
||||
"operatingsystem": "Ubuntu",
|
||||
"operatingsystemrelease": [
|
||||
"14.04",
|
||||
"16.04",
|
||||
"18.04"
|
||||
]
|
||||
@@ -79,6 +80,6 @@
|
||||
}
|
||||
],
|
||||
"template-url": "https://github.com/puppetlabs/pdk-templates/#master",
|
||||
"template-ref": "heads/master-0-gb096033",
|
||||
"pdk-version": "1.11.1"
|
||||
"template-ref": "1.14.1-0-g0b5b39b",
|
||||
"pdk-version": "1.14.0"
|
||||
}
|
||||
|
||||
@@ -4,10 +4,13 @@ default:
|
||||
images: ['waffleimage/debian8']
|
||||
travis_deb:
|
||||
provisioner: docker
|
||||
images: ['debian:8', 'debian:9', 'ubuntu:14.04', 'ubuntu:16.04', 'ubuntu:18.04']
|
||||
images: ['debian:8', 'debian:9', 'ubuntu:16.04', 'ubuntu:18.04']
|
||||
travis_el:
|
||||
provisioner: docker_exp
|
||||
images: ['centos:6', 'centos:7', 'oraclelinux:6', 'oraclelinux:7', 'scientificlinux/sl:6', 'scientificlinux/sl:7']
|
||||
vagrant:
|
||||
provisioner: vagrant
|
||||
images: ['centos/7', 'generic/ubuntu1804']
|
||||
release_checks:
|
||||
provisioner: vmpooler
|
||||
images: ['redhat-6-x86_64', 'redhat-7-x86_64', 'redhat-8-x86_64', 'centos-6-x86_64', 'centos-7-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', '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-1604-x86_64', 'ubuntu-1804-x86_64', 'sles-11-x86_64', 'sles-12-x86_64', 'sles-15-x86_64']
|
||||
|
||||
@@ -71,10 +71,10 @@ context 'with failure cases' do
|
||||
end
|
||||
|
||||
it 'fails on debian or RHEL when passed fake java_alternative and path' do
|
||||
if os[:family] == 'debian' || os[:family] == 'redhat'
|
||||
apply_manifest(bogus_alternative, expect_failures: true)
|
||||
else
|
||||
if os[:family] == 'sles'
|
||||
apply_manifest(bogus_alternative, catch_failures: true)
|
||||
else
|
||||
apply_manifest(bogus_alternative, expect_failures: true)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -53,6 +53,22 @@ describe 'java', type: :class do
|
||||
it { is_expected.not_to contain_exec('update-java-alternatives') }
|
||||
end
|
||||
|
||||
context 'when select jdk for Debian Buster (10.0)' do
|
||||
let(:facts) { { osfamily: 'Debian', operatingsystem: 'Debian', lsbdistcodename: 'buster', operatingsystemmajrelease: '10', architecture: 'amd64' } }
|
||||
let(:params) { { 'distribution' => 'jdk' } }
|
||||
|
||||
it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') }
|
||||
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') }
|
||||
end
|
||||
|
||||
context 'when select jre for Debian Buster (10.0)' do
|
||||
let(:facts) { { osfamily: 'Debian', operatingsystem: 'Debian', lsbdistcodename: 'buster', operatingsystemmajrelease: '10', architecture: 'amd64' } }
|
||||
let(:params) { { 'distribution' => 'jre' } }
|
||||
|
||||
it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') }
|
||||
it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64/') }
|
||||
end
|
||||
|
||||
context 'when select jdk for Ubuntu Trusty (14.04)' do
|
||||
let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'trusty', operatingsystemmajrelease: '14.04', architecture: 'amd64' } }
|
||||
let(:params) { { 'distribution' => 'jdk' } }
|
||||
|
||||
@@ -3,5 +3,6 @@
|
||||
# Facts specified here will override the values provided by rspec-puppet-facts.
|
||||
---
|
||||
ipaddress: "172.16.254.254"
|
||||
ipaddress6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA"
|
||||
is_pe: false
|
||||
macaddress: "AA:AA:AA:AA:AA:AA"
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
require 'spec_helper'
|
||||
|
||||
url = 'http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz'
|
||||
|
||||
describe 'java::download', type: :define do
|
||||
let(:url) { 'http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz' }
|
||||
|
||||
context 'with CentOS 64-bit' do
|
||||
let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'x86_64', name: 'CentOS', release: { full: '6.0' } } } }
|
||||
|
||||
@@ -13,7 +13,7 @@ describe 'java::download', type: :define do
|
||||
version_major: '8u201',
|
||||
version_minor: 'b09',
|
||||
java_se: 'jdk',
|
||||
url: $url,
|
||||
url: url,
|
||||
}
|
||||
end
|
||||
let(:title) { 'jdk8' }
|
||||
@@ -48,7 +48,7 @@ describe 'java::download', type: :define do
|
||||
basedir: '/usr/java',
|
||||
manage_symlink: true,
|
||||
symlink_name: 'java_home',
|
||||
url: $url,
|
||||
url: url,
|
||||
}
|
||||
end
|
||||
let(:title) { 'jdk6' }
|
||||
@@ -61,12 +61,24 @@ describe 'java::download', type: :define do
|
||||
let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '16.04' } } } }
|
||||
|
||||
context 'when passing URL to url parameter' do
|
||||
let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: $url } }
|
||||
let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: url } }
|
||||
let(:title) { 'jdk8' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.tar.gz') }
|
||||
end
|
||||
end
|
||||
|
||||
context 'with Debian 64-bit' do
|
||||
let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Debian', release: { full: '10.0' } } } }
|
||||
|
||||
context 'when passing URL to url parameter' do
|
||||
let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: url } }
|
||||
let(:title) { 'jdk8' }
|
||||
|
||||
it { is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.tar.gz') }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'incompatible OSes' do
|
||||
[
|
||||
{
|
||||
|
||||
@@ -28,7 +28,30 @@ else
|
||||
options[:port] = node_config.dig('ssh', 'port') unless node_config.dig('ssh', 'port').nil?
|
||||
options[:keys] = node_config.dig('ssh', 'private-key') unless node_config.dig('ssh', 'private-key').nil?
|
||||
options[:password] = node_config.dig('ssh', 'password') unless node_config.dig('ssh', 'password').nil?
|
||||
options[:verify_host_key] = Net::SSH::Verifiers::Null.new unless node_config.dig('ssh', 'host-key-check').nil?
|
||||
# Support both net-ssh 4 and 5.
|
||||
# rubocop:disable Metrics/BlockNesting
|
||||
options[:verify_host_key] = if node_config.dig('ssh', 'host-key-check').nil?
|
||||
# Fall back to SSH behavior. This variable will only be set in net-ssh 5.3+.
|
||||
if @strict_host_key_checking.nil? || @strict_host_key_checking
|
||||
Net::SSH::Verifiers::Always.new
|
||||
else
|
||||
# SSH's behavior with StrictHostKeyChecking=no: adds new keys to known_hosts.
|
||||
# If known_hosts points to /dev/null, then equivalent to :never where it
|
||||
# accepts any key beacuse they're all new.
|
||||
Net::SSH::Verifiers::AcceptNewOrLocalTunnel.new
|
||||
end
|
||||
elsif node_config.dig('ssh', 'host-key-check')
|
||||
if defined?(Net::SSH::Verifiers::Always)
|
||||
Net::SSH::Verifiers::Always.new
|
||||
else
|
||||
Net::SSH::Verifiers::Secure.new
|
||||
end
|
||||
elsif defined?(Net::SSH::Verifiers::Never)
|
||||
Net::SSH::Verifiers::Never.new
|
||||
else
|
||||
Net::SSH::Verifiers::Null.new
|
||||
end
|
||||
# rubocop:enable Metrics/BlockNesting
|
||||
host = if ENV['TARGET_HOST'].include?(':')
|
||||
ENV['TARGET_HOST'].split(':').first
|
||||
else
|
||||
|
||||
@@ -11,14 +11,14 @@ describe 'java_libjvm_path' do
|
||||
|
||||
context 'when libjvm exists' do
|
||||
it do
|
||||
allow(Dir).to receive(:glob).with("#{java_default_home}/jre/lib/**/libjvm.so").and_return(['/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so'])
|
||||
allow(Dir).to receive(:glob).with("#{java_default_home}/**/lib/**/libjvm.so").and_return(['/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server/libjvm.so'])
|
||||
expect(Facter.value(:java_libjvm_path)).to eql '/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when libjvm does not exist' do
|
||||
it do
|
||||
allow(Dir).to receive(:glob).with("#{java_default_home}/jre/lib/**/libjvm.so").and_return([])
|
||||
allow(Dir).to receive(:glob).with("#{java_default_home}/**/lib/**/libjvm.so").and_return([])
|
||||
expect(Facter.value(:java_libjvm_path)).to be nil
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user