From 92a9700ad392855b22073dbf38749e33635fc5e6 Mon Sep 17 00:00:00 2001 From: Tom Ritserveldt Date: Mon, 27 May 2019 11:11:48 +0200 Subject: [PATCH 001/259] Add support for Debian buster --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 29b66bce..d7d76314 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -154,7 +154,7 @@ }, } } - 'stretch', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful': { + 'stretch', 'buster', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful': { $java = { 'jdk' => { 'package' => 'openjdk-8-jdk', From 9d0301b1ef0121c66df00e37dea077b439c87cf2 Mon Sep 17 00:00:00 2001 From: Martin Jackson Date: Tue, 18 Jun 2019 20:57:32 -0500 Subject: [PATCH 002/259] Add buster support, default to 11 --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index dd19a0ba..449dc5dc 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -170,7 +170,7 @@ } } } - 'bionic', 'cosmic', 'disco', 'eoan': { + 'bionic', 'cosmic', 'disco', 'buster', 'eoan': { $java = { 'jdk' => { 'package' => 'openjdk-11-jdk', From 68e1d7681d618aa9f935ee4f99583eb0098e61c7 Mon Sep 17 00:00:00 2001 From: TP Honey Date: Wed, 10 Jul 2019 16:24:09 +0100 Subject: [PATCH 003/259] (maint) Remove BSD section for puppet < 4 --- README.markdown | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/README.markdown b/README.markdown index 93e6dd29..c140e78a 100644 --- a/README.markdown +++ b/README.markdown @@ -153,18 +153,6 @@ the binaries to a standard directory. Because of that, the path to this location is hardcoded in the `java_version` fact. Whenever you upgrade Java to a newer version, you have to update the path in this fact. -#### FreeBSD - -By default on FreeBSD, Puppet versions prior to 4.0 throw an error saying `pkgng` is not the default provider. To fix this, install the [zleslie/pkgng module](https://forge.puppetlabs.com/zleslie/pkgng) and set it as the default package provider: - -```puppet -Package { - provider => 'pkgng', -} -``` - -On Puppet 4.0 and later, `pkgng` is included within Puppet and is the default package provider. - ## Development Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. To contribute to Puppet projects, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html) From 77c18be58bd8dd227d1b7bf944ff3ecac53ea1f1 Mon Sep 17 00:00:00 2001 From: lionce Date: Tue, 16 Jul 2019 10:05:15 +0300 Subject: [PATCH 004/259] pdksync_heads/master-0-gb096033 --- .rubocop.yml | 2 +- .travis.yml | 1 + Rakefile | 1 + metadata.json | 4 ++-- spec/spec_helper.rb | 5 +++++ 5 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index b46c8599..3cd2b0e5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -26,7 +26,7 @@ GetText: GetText/DecorateString: Description: We don't want to decorate test output. Exclude: - - spec/* + - spec/**/* RSpec/BeforeAfterAll: Description: Beware of using after(:all) as it may cause state to leak between tests. A necessary evil in acceptance testing. diff --git a/.travis.yml b/.travis.yml index bf22cd04..b6064dd0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ --- +dist: xenial language: ruby cache: bundler before_install: diff --git a/Rakefile b/Rakefile index 597f494c..d9b223c6 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,4 @@ +require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? diff --git a/metadata.json b/metadata.json index 9a526cc5..9b3d8631 100644 --- a/metadata.json +++ b/metadata.json @@ -79,6 +79,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-g7827fc2", - "pdk-version": "1.10.0" + "template-ref": "heads/master-0-gb096033", + "pdk-version": "1.11.1" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 9ee43737..c09e0024 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -29,6 +29,11 @@ end end +# read default_facts and merge them over what is provided by facterdb +default_facts.each do |fact, value| + add_custom_fact fact, value +end + RSpec.configure do |c| c.default_facts = default_facts c.before :each do From 48b5d0209da117304649a6d8a0b8218054ca0b59 Mon Sep 17 00:00:00 2001 From: TP Honey Date: Wed, 17 Jul 2019 12:14:28 +0100 Subject: [PATCH 005/259] Revert "Add support for debian buster" --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 318fedc5..dd19a0ba 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -154,7 +154,7 @@ }, } } - 'stretch', 'buster', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful': { + 'stretch', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful': { $java = { 'jdk' => { 'package' => 'openjdk-8-jdk', From 7b73f579c0b6c4c78d9b3d5c9044aaac67ec5dc8 Mon Sep 17 00:00:00 2001 From: tphoney Date: Thu, 25 Jul 2019 10:46:05 +0100 Subject: [PATCH 006/259] (FM-8343) use release numbers not lsbdistcodename --- manifests/params.pp | 38 +++++--------------------------------- spec/classes/java_spec.rb | 10 +++++----- 2 files changed, 10 insertions(+), 38 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 449dc5dc..ddf97f4c 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -73,36 +73,8 @@ 'armv7l' => 'armhf', default => $::architecture } - case $::lsbdistcodename { - 'lenny', 'squeeze', 'lucid', 'natty': { - $java = { - 'jdk' => { - 'package' => 'openjdk-6-jdk', - 'alternative' => "java-6-openjdk-${openjdk_architecture}", - 'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java', - 'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/', - }, - 'jre' => { - 'package' => 'openjdk-6-jre-headless', - 'alternative' => "java-6-openjdk-${openjdk_architecture}", - 'alternative_path' => '/usr/lib/jvm/java-6-openjdk/jre/bin/java', - 'java_home' => '/usr/lib/jvm/java-6-openjdk/jre/', - }, - 'sun-jre' => { - 'package' => 'sun-java6-jre', - 'alternative' => 'java-6-sun', - 'alternative_path' => '/usr/lib/jvm/java-6-sun/jre/bin/java', - 'java_home' => '/usr/lib/jvm/java-6-sun/jre/', - }, - 'sun-jdk' => { - 'package' => 'sun-java6-jdk', - 'alternative' => 'java-6-sun', - 'alternative_path' => '/usr/lib/jvm/java-6-sun/jre/bin/java', - 'java_home' => '/usr/lib/jvm/java-6-sun/jre/', - }, - } - } - 'wheezy', 'jessie', 'precise', 'quantal', 'raring', 'saucy', 'trusty', 'utopic': { + case $::operatingsystemmajrelease { + '7', '8', '14.04': { $java = { 'jdk' => { 'package' => 'openjdk-7-jdk', @@ -154,7 +126,7 @@ }, } } - 'stretch', 'vivid', 'wily', 'xenial', 'yakkety', 'zesty', 'artful': { + '9', '15.04', '15.10', '16.04', '16.10', '17.04', '17.10': { $java = { 'jdk' => { 'package' => 'openjdk-8-jdk', @@ -170,7 +142,7 @@ } } } - 'bionic', 'cosmic', 'disco', 'buster', 'eoan': { + '10', '18.04', '18.10', '19.04', '19.10': { $java = { 'jdk' => { 'package' => 'openjdk-11-jdk', @@ -186,7 +158,7 @@ } } } - default: { fail("unsupported release ${::lsbdistcodename}") } + default: { fail("unsupported release ${::operatingsystemmajrelease}") } } } 'OpenBSD': { diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 8befd55f..95d8fe8e 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -54,7 +54,7 @@ end context 'when select jdk for Ubuntu Trusty (14.04)' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'trusty', operatingsystemrelease: '14.04', architecture: 'amd64' } } + let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'trusty', operatingsystemmajrelease: '14.04', architecture: 'amd64' } } let(:params) { { 'distribution' => 'jdk' } } it { is_expected.to contain_package('java').with_name('openjdk-7-jdk') } @@ -62,7 +62,7 @@ end context 'when select jre for Ubuntu Trusty (14.04)' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'trusty', operatingsystemrelease: '14.04', architecture: 'amd64' } } + let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'trusty', operatingsystemmajrelease: '14.04', architecture: 'amd64' } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('openjdk-7-jre-headless') } @@ -70,7 +70,7 @@ end context 'when select jdk for Ubuntu xenial (16.04) on ARM' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'xenial', operatingsystemrelease: '16.04', architecture: 'armv7l' } } + let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'xenial', operatingsystemmajrelease: '16.04', architecture: 'armv7l' } } let(:params) { { 'distribution' => 'jdk' } } it { is_expected.to contain_package('java').with_name('openjdk-8-jdk') } @@ -78,7 +78,7 @@ end context 'when select jdk for Ubuntu xenial (16.04) on ARM64' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'xenial', operatingsystemrelease: '16.04', architecture: 'aarch64' } } + let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'xenial', operatingsystemmajrelease: '16.04', architecture: 'aarch64' } } let(:params) { { 'distribution' => 'jdk' } } it { is_expected.to contain_package('java').with_name('openjdk-8-jdk') } @@ -156,7 +156,7 @@ end describe 'custom java package' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Debian', lsbdistcodename: 'jessie', operatingsystemrelease: '8.6', architecture: 'amd64' } } + let(:facts) { { osfamily: 'Debian', operatingsystem: 'Debian', lsbdistcodename: 'jessie', operatingsystemmajrelease: '8', architecture: 'amd64' } } context 'when all params provided' do let(:params) do From b9564626d39cb7bc7fed5ce35b3be7dafffc6125 Mon Sep 17 00:00:00 2001 From: tphoney Date: Thu, 25 Jul 2019 14:41:19 +0100 Subject: [PATCH 007/259] (FM-8223) converted to use litmus --- .fixtures.yml | 5 +- .sync.yml | 18 +-- .travis.yml | 55 ++++++-- distelli-manifest.yml | 25 ++++ metadata.json | 2 +- provision.yaml | 13 ++ spec/acceptance/install_spec.rb | 123 +----------------- spec/acceptance/nodesets/centos-7-x64.yml | 10 -- spec/acceptance/nodesets/debian-8-x64.yml | 10 -- spec/acceptance/nodesets/default.yml | 10 -- spec/acceptance/nodesets/docker/centos-7.yml | 12 -- spec/acceptance/nodesets/docker/debian-8.yml | 11 -- .../nodesets/docker/ubuntu-14.04.yml | 12 -- spec/spec_helper_acceptance.rb | 80 +++++++----- spec/spec_helper_acceptance_local.rb | 1 + 15 files changed, 146 insertions(+), 241 deletions(-) create mode 100644 distelli-manifest.yml create mode 100644 provision.yaml delete mode 100644 spec/acceptance/nodesets/centos-7-x64.yml delete mode 100644 spec/acceptance/nodesets/debian-8-x64.yml delete mode 100644 spec/acceptance/nodesets/default.yml delete mode 100644 spec/acceptance/nodesets/docker/centos-7.yml delete mode 100644 spec/acceptance/nodesets/docker/debian-8.yml delete mode 100644 spec/acceptance/nodesets/docker/ubuntu-14.04.yml create mode 100644 spec/spec_helper_acceptance_local.rb diff --git a/.fixtures.yml b/.fixtures.yml index 2f664f7e..514466cf 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -1,6 +1,9 @@ fixtures: repositories: - stdlib: "git://github.com/puppetlabs/puppetlabs-stdlib.git" 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' symlinks: java: "#{source_dir}" diff --git a/.sync.yml b/.sync.yml index 23bd6a2b..b9f29ab0 100644 --- a/.sync.yml +++ b/.sync.yml @@ -7,14 +7,7 @@ unmanaged: true .travis.yml: - docker_sets: - - set: docker/centos-7 - - set: docker/ubuntu-14.04 - docker_defaults: - bundler_args: "" - secure: "" - branches: - - release + unmanaged: true appveyor.yml: delete: true @@ -26,15 +19,6 @@ Gemfile: git: 'https://github.com/skywinder/github-changelog-generator' ref: '20ee04ba1234e9e83eb2ffb5056e23d641c7a018' condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2')" - required: - ':system_tests': - - gem: 'puppet-module-posix-system-r#{minor_version}' - platforms: ruby - - gem: 'puppet-module-win-system-r#{minor_version}' - platforms: - - mswin - - mingw - - x64_mingw spec/spec_helper.rb: mock_with: ':rspec' diff --git a/.travis.yml b/.travis.yml index b6064dd0..8c3980ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,22 +24,57 @@ matrix: fast_finish: true include: - - bundler_args: + bundler_args: dist: trusty - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/centos-7 BEAKER_TESTMODE=apply - rvm: 2.5.3 - script: bundle exec rake beaker + 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 - stage: acceptance sudo: required - - bundler_args: + bundler_args: dist: trusty - env: PUPPET_INSTALL_TYPE=agent BEAKER_debug=true BEAKER_PUPPET_COLLECTION=puppet6 BEAKER_set=docker/ubuntu-14.04 BEAKER_TESTMODE=apply - rvm: 2.5.3 - script: bundle exec rake beaker + 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 - stage: acceptance sudo: required - env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" diff --git a/distelli-manifest.yml b/distelli-manifest.yml new file mode 100644 index 00000000..34b3a2f9 --- /dev/null +++ b/distelli-manifest.yml @@ -0,0 +1,25 @@ +team-modules/puppetlabs-java: + PreBuild: + - source /opt/rh/rh-ruby25/enable + - echo "--- LETS update BUNDLER ---" + - bundle install --path vendor/bundle --jobs 3 + Build: + - echo "--- PROVISIONING ---" + - source /opt/rh/rh-ruby25/enable + - bundle exec rake litmus:provision_list[release_checks] + - cat inventory.yaml + - echo "--- AGENT INSTALLATION ---" + - bundle exec rake litmus:install_agent + - echo "--- MODULE INSTALLATION ---" + - bundle exec rake litmus:install_module + - echo "--- TESTS RUNNING ---" + - bundle exec rake litmus:acceptance:parallel + AfterBuildSuccess: + - source /opt/rh/rh-ruby25/enable + - bundle exec rake litmus:tear_down + AfterBuildFailure: + - source /opt/rh/rh-ruby25/enable + - bundle exec rake litmus:tear_down + CommitData: + - RepoType: Git + - RepoPath: . diff --git a/metadata.json b/metadata.json index 9b3d8631..2c0868f3 100644 --- a/metadata.json +++ b/metadata.json @@ -78,7 +78,7 @@ "version_requirement": ">= 5.5.10 < 7.0.0" } ], - "template-url": "https://github.com/puppetlabs/pdk-templates#master", + "template-url": "https://github.com/puppetlabs/pdk-templates/#master", "template-ref": "heads/master-0-gb096033", "pdk-version": "1.11.1" } diff --git a/provision.yaml b/provision.yaml new file mode 100644 index 00000000..346c9d16 --- /dev/null +++ b/provision.yaml @@ -0,0 +1,13 @@ +--- +default: + provisioner: docker + images: ['waffleimage/debian8'] +travis_deb: + provisioner: docker + images: ['debian:8', 'debian:9', 'ubuntu:14.04', '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'] +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'] diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 54411fb0..03469805 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -1,7 +1,5 @@ require 'spec_helper_acceptance' -include Unix::File - java_class_jre = "class { 'java':\n"\ " distribution => 'jre',\n"\ '}' @@ -22,14 +20,6 @@ " distribution => 'sun-jdk',\n"\ '}' -oracle_jre = "class { 'java':\n"\ - " distribution => 'oracle-jre',\n"\ - '}' - -oracle_jdk = "class { 'java':\n"\ - " distribution => 'oracle-jdk',\n"\ - '}' - blank_version = "class { 'java':\n"\ " version => '',\n"\ '}' @@ -51,88 +41,15 @@ " java_alternative_path => '/whatever',\n"\ '}' -# Oracle installs are disabled by default, because the links to valid oracle installations -# change often. Look the parameters up from the Oracle download URLs at https://java.oracle.com and -# enable the tests: - -oracle_enabled = false -oracle_version_major = '8' -oracle_version_minor = '201' -oracle_version_build = '09' -oracle_hash = '42970487e3af4f5aa5bca3f542482c60' - -install_oracle_jdk_jre = < '#{oracle_version_major}', - version_major => '#{oracle_version_major}u#{oracle_version_minor}', - version_minor => 'b#{oracle_version_build}', - url_hash => '#{oracle_hash}', - java_se => 'jre', - } - java::oracle { - 'test_oracle_jdk': - version => '#{oracle_version_major}', - version_major => '#{oracle_version_major}u#{oracle_version_minor}', - version_minor => 'b#{oracle_version_build}', - url_hash => '#{oracle_hash}', - java_se => 'jdk', - } -EOL - -install_oracle_jre_jce = < '#{oracle_version_major}', - version_major => '#{oracle_version_major}u#{oracle_version_minor}', - version_minor => 'b#{oracle_version_build}', - url_hash => '#{oracle_hash}', - java_se => 'jre', - jce => true, - } - -EOL - -install_oracle_jdk_jce = < '#{oracle_version_major}', - version_major => '#{oracle_version_major}u#{oracle_version_minor}', - version_minor => 'b#{oracle_version_build}', - url_hash => '#{oracle_hash}', - java_se => 'jdk', - jce => true, - } -EOL - -context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do +context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do it 'installs jre' do - idempotent_apply(default, java_class_jre) + idempotent_apply(java_class_jre) end end -context 'installing java jdk', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do +context 'installing java jdk', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do it 'installs jdk' do - idempotent_apply(default, java_class) - end -end - -context 'oracle', if: ( - (fact('operatingsystem') == 'Ubuntu') && fact('operatingsystemrelease').match(%r{^14\.04}) -) do - # not supported - # The package is not available from any sources, but if a customer - # custom-builds the package using java-package and adds it to a local - # repository, that is the intention of this version ability - describe 'jre' do - it 'installs oracle-jre' do - apply_manifest(oracle_jre, expect_failures: true) - end - end - describe 'jdk' do - it 'installs oracle-jdk' do - apply_manifest(oracle_jdk, expect_failures: true) - end + idempotent_apply(java_class) end end @@ -154,40 +71,10 @@ end it 'fails on debian or RHEL when passed fake java_alternative and path' do - if fact('osfamily') == 'Debian' || fact('osfamily') == 'RedHat' + if os[:family] == 'debian' || os[:family] == 'redhat' apply_manifest(bogus_alternative, expect_failures: true) else apply_manifest(bogus_alternative, catch_failures: true) end end end - -context 'java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do - let(:install_path) do - (fact('osfamily') == 'RedHat') ? '/usr/java' : '/usr/lib/jvm' - end - - let(:version_suffix) do - (fact('osfamily') == 'RedHat') ? '-amd64' : '' - end - - it 'installs oracle jdk and jre' do - idempotent_apply(default, install_oracle_jdk_jre) - jdk_result = shell("test ! -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") - jre_result = shell("test ! -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") - expect(jdk_result.exit_code).to eq(0) - expect(jre_result.exit_code).to eq(0) - end - - it 'installs oracle jdk with jce' do - idempotent_apply(default, install_oracle_jdk_jce) - result = shell("test -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") - expect(result.exit_code).to eq(0) - end - - it 'installs oracle jre with jce' do - idempotent_apply(default, install_oracle_jre_jce) - result = shell("test -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") - expect(result.exit_code).to eq(0) - end -end diff --git a/spec/acceptance/nodesets/centos-7-x64.yml b/spec/acceptance/nodesets/centos-7-x64.yml deleted file mode 100644 index 5eebdefb..00000000 --- a/spec/acceptance/nodesets/centos-7-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - centos-7-x64: - roles: - - agent - - default - platform: el-7-x86_64 - hypervisor: vagrant - box: puppetlabs/centos-7.2-64-nocm -CONFIG: - type: foss diff --git a/spec/acceptance/nodesets/debian-8-x64.yml b/spec/acceptance/nodesets/debian-8-x64.yml deleted file mode 100644 index fef6e63c..00000000 --- a/spec/acceptance/nodesets/debian-8-x64.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - debian-8-x64: - roles: - - agent - - default - platform: debian-8-amd64 - hypervisor: vagrant - box: puppetlabs/debian-8.2-64-nocm -CONFIG: - type: foss diff --git a/spec/acceptance/nodesets/default.yml b/spec/acceptance/nodesets/default.yml deleted file mode 100644 index dba339c4..00000000 --- a/spec/acceptance/nodesets/default.yml +++ /dev/null @@ -1,10 +0,0 @@ -HOSTS: - ubuntu-1404-x64: - roles: - - agent - - default - platform: ubuntu-14.04-amd64 - hypervisor: vagrant - box: puppetlabs/ubuntu-14.04-64-nocm -CONFIG: - type: foss diff --git a/spec/acceptance/nodesets/docker/centos-7.yml b/spec/acceptance/nodesets/docker/centos-7.yml deleted file mode 100644 index a3333aac..00000000 --- a/spec/acceptance/nodesets/docker/centos-7.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - centos-7-x64: - platform: el-7-x86_64 - hypervisor: docker - image: centos:7 - docker_preserve_image: true - docker_cmd: '["/usr/sbin/init"]' - # install various tools required to get the image up to usable levels - docker_image_commands: - - 'yum install -y crontabs tar wget openssl sysvinit-tools iproute which initscripts' -CONFIG: - trace_limit: 200 diff --git a/spec/acceptance/nodesets/docker/debian-8.yml b/spec/acceptance/nodesets/docker/debian-8.yml deleted file mode 100644 index df5c3194..00000000 --- a/spec/acceptance/nodesets/docker/debian-8.yml +++ /dev/null @@ -1,11 +0,0 @@ -HOSTS: - debian-8-x64: - platform: debian-8-amd64 - hypervisor: docker - image: debian:8 - docker_preserve_image: true - docker_cmd: '["/sbin/init"]' - docker_image_commands: - - 'apt-get update && apt-get install -y net-tools wget locales strace lsof && echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && locale-gen' -CONFIG: - trace_limit: 200 diff --git a/spec/acceptance/nodesets/docker/ubuntu-14.04.yml b/spec/acceptance/nodesets/docker/ubuntu-14.04.yml deleted file mode 100644 index b1efa583..00000000 --- a/spec/acceptance/nodesets/docker/ubuntu-14.04.yml +++ /dev/null @@ -1,12 +0,0 @@ -HOSTS: - ubuntu-1404-x64: - platform: ubuntu-14.04-amd64 - hypervisor: docker - image: ubuntu:14.04 - docker_preserve_image: true - docker_cmd: '["/sbin/init"]' - docker_image_commands: - # ensure that upstart is booting correctly in the container - - 'rm /usr/sbin/policy-rc.d && rm /sbin/initctl && dpkg-divert --rename --remove /sbin/initctl && apt-get update && apt-get install -y net-tools wget && locale-gen en_US.UTF-8' -CONFIG: - trace_limit: 200 diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index db02d651..745d46e1 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,37 +1,59 @@ -require 'beaker-pe' -require 'beaker-puppet' -require 'beaker-rspec' -require 'beaker/puppet_install_helper' -require 'beaker/module_install_helper' +# frozen_string_literal: true -run_puppet_install_helper -configure_type_defaults_on(hosts) -install_module_on(hosts) -install_module_dependencies_on(hosts) +require 'serverspec' +require 'puppet_litmus' +require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb')) +include PuppetLitmus -UNSUPPORTED_PLATFORMS = ['Darwin', 'windows'].freeze - -unless ENV['RS_PROVISION'] == 'no' || ENV['BEAKER_provision'] == 'no' - hosts.each do |host| - install_puppet_module_via_pmt_on(host, module_name: 'puppetlabs-apt') +if ENV['TARGET_HOST'].nil? || ENV['TARGET_HOST'] == 'localhost' + puts 'Running tests against this machine !' + if Gem.win_platform? + set :backend, :cmd + else + set :backend, :exec end -end +else + # load inventory + inventory_hash = inventory_hash_from_inventory_file + node_config = config_from_node(inventory_hash, ENV['TARGET_HOST']) -RSpec.configure do |c| - # Readable test descriptions - c.formatter = :documentation -end + if target_in_group(inventory_hash, ENV['TARGET_HOST'], 'docker_nodes') + host = ENV['TARGET_HOST'] + set :backend, :docker + set :docker_container, host + elsif target_in_group(inventory_hash, ENV['TARGET_HOST'], 'ssh_nodes') + set :backend, :ssh + options = Net::SSH::Config.for(host) + options[:user] = node_config.dig('ssh', 'user') unless node_config.dig('ssh', 'user').nil? + 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? + host = if ENV['TARGET_HOST'].include?(':') + ENV['TARGET_HOST'].split(':').first + else + ENV['TARGET_HOST'] + end + set :host, options[:host_name] || host + set :ssh_options, options + set :request_pty, true + elsif target_in_group(inventory_hash, ENV['TARGET_HOST'], 'winrm_nodes') + require 'winrm' + + set :backend, :winrm + set :os, family: 'windows' + user = node_config.dig('winrm', 'user') unless node_config.dig('winrm', 'user').nil? + pass = node_config.dig('winrm', 'password') unless node_config.dig('winrm', 'password').nil? + endpoint = "http://#{ENV['TARGET_HOST']}:5985/wsman" -def idempotent_apply(hosts, manifest, opts = {}, &block) - block_on hosts, opts do |host| - file_path = host.tmpfile('apply_manifest.pp') - create_remote_file(host, file_path, manifest + "\n") + opts = { + user: user, + password: pass, + endpoint: endpoint, + operation_timeout: 300, + } - puppet_apply_opts = { :verbose => nil, 'detailed-exitcodes' => nil } - on_options = { acceptable_exit_codes: [0, 2] } - on host, puppet('apply', file_path, puppet_apply_opts), on_options, &block - puppet_apply_opts2 = { :verbose => nil, 'detailed-exitcodes' => nil } - on_options2 = { acceptable_exit_codes: [0] } - on host, puppet('apply', file_path, puppet_apply_opts2), on_options2, &block + winrm = WinRM::Connection.new opts + Specinfra.configuration.winrm = winrm end end diff --git a/spec/spec_helper_acceptance_local.rb b/spec/spec_helper_acceptance_local.rb new file mode 100644 index 00000000..3c3b4020 --- /dev/null +++ b/spec/spec_helper_acceptance_local.rb @@ -0,0 +1 @@ +UNSUPPORTED_PLATFORMS = ['darwin', 'windows'].freeze From ab9efa8405e410fdc51e82ed124a3d9833ab625e Mon Sep 17 00:00:00 2001 From: tphoney Date: Thu, 25 Jul 2019 17:20:07 +0100 Subject: [PATCH 008/259] (maint) rerun pdk convert,remove systemtests gems --- Gemfile | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Gemfile b/Gemfile index 60f245f4..030b78b7 100644 --- a/Gemfile +++ b/Gemfile @@ -29,10 +29,6 @@ group :development do gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', 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') end -group :system_tests do - gem "puppet-module-posix-system-r#{minor_version}", require: false, platforms: [:ruby] - gem "puppet-module-win-system-r#{minor_version}", require: false, platforms: [:mswin, :mingw, :x64_mingw] -end puppet_version = ENV['PUPPET_GEM_VERSION'] facter_version = ENV['FACTER_GEM_VERSION'] From a7f5b4940401f1f7386b32382af289acad5b370e Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Fri, 12 Jul 2019 11:30:22 +0300 Subject: [PATCH 009/259] Remove Oracle download support --- .rubocop.yml | 1 + README.markdown | 46 +-- manifests/{oracle.pp => download.pp} | 56 +--- spec/defines/download_spec.rb | 131 ++++++++ spec/defines/oracle_spec.rb | 474 --------------------------- 5 files changed, 145 insertions(+), 563 deletions(-) rename manifests/{oracle.pp => download.pp} (80%) create mode 100644 spec/defines/download_spec.rb delete mode 100644 spec/defines/oracle_spec.rb diff --git a/.rubocop.yml b/.rubocop.yml index 3cd2b0e5..f17c5ddd 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -14,6 +14,7 @@ AllCops: - "**/Rakefile" - pkg/**/* - spec/fixtures/**/* + - spec/**/* - vendor/**/* - "**/Puppetfile" - "**/Vagrantfile" diff --git a/README.markdown b/README.markdown index c140e78a..c3e0ab3d 100644 --- a/README.markdown +++ b/README.markdown @@ -43,52 +43,14 @@ class { 'java' : } ``` -The defined type `java::oracle` installs one or more versions of Oracle Java SE. `java::oracle` depends on [puppet/archive](https://github.com/voxpupuli/puppet-archive). By using `java::oracle` you agree to Oracle's licensing terms for Java SE. +The defined type `java::download` installs one or more versions of Java SE from a remote url. `java::download` depends on [puppet/archive](https://github.com/voxpupuli/puppet-archive). +To install Java to a non-default basedir (defaults: /usr/lib/jvm for Debian; /usr/java for RedHat): ```puppet -java::oracle { 'jdk6' : +java::download { 'jdk8' : ensure => 'present', - version => '6', java_se => 'jdk', -} - -java::oracle { 'jdk8' : - ensure => 'present', - version => '8', - java_se => 'jdk', -} -``` - -To install a specific release of a Java version, e.g. 8u101-b13, provide both parameters `version_major` and `version_minor` as follows: - -```puppet -java::oracle { 'jdk8' : - ensure => 'present', - version_major => '8u101', - version_minor => 'b13', - java_se => 'jdk', -} -``` - -To install Oracle Java to a non-default basedir (defaults: /usr/lib/jvm for Debian; /usr/java for RedHat): -```puppet -java::oracle { 'jdk8' : - ensure => 'present', - version_major => '8u101', - version_minor => 'b13', - java_se => 'jdk', - basedir => '/custom/java', -} -``` - -To ensure that a custom basedir is a directory before Oracle Java is installed (note: manage separately for custom ownership or perms): -```puppet -java::oracle { 'jdk8' : - ensure => 'present', - version_major => '8u101', - version_minor => 'b13', - java_se => 'jdk', - manage_basedir => true, + url => 'http://myjava.repository/java.tgz", basedir => '/custom/java', } ``` diff --git a/manifests/oracle.pp b/manifests/download.pp similarity index 80% rename from manifests/oracle.pp rename to manifests/download.pp index f9580a14..c75966a2 100644 --- a/manifests/oracle.pp +++ b/manifests/download.pp @@ -1,18 +1,8 @@ -# Defined Type java::oracle +# Defined Type java::download # # @summary -# Installs Oracle Java. By using this module you agree to the Oracle licensing -# agreement. +# Installs Java from a url location. # -# 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" -#``` # # @param ensure # Install or remove the package. @@ -29,9 +19,6 @@ # @param java_se # Type of Java Standard Edition to install, jdk or jre. # -# @param oracle_url -# Official Oracle URL to download binaries from. -# # @param proxy_server # Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) # @@ -39,13 +26,7 @@ # Proxy server type (none|http|https|ftp). (passed to archive) # # @param url -# 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. -# -# @param url_hash -# 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 # # @param jce # Install Oracles Java Cryptographic Extensions into the JRE or JDK @@ -72,17 +53,15 @@ # @param symlink_name # The name for the optional symlink in the installation directory. # -define java::oracle ( +define java::download( $ensure = 'present', $version = '8', $version_major = undef, $version_minor = undef, $java_se = 'jdk', - $oracle_url = 'http://download.oracle.com/otn-pub/java/jdk/', $proxy_server = undef, $proxy_type = undef, $url = undef, - $url_hash = undef, $jce = false, $jce_url = undef, $basedir = undef, @@ -103,25 +82,17 @@ if $jce { if $jce_url { $jce_download = $jce_url - $cookie = undef } else { - $jce_download = $version ? { - '8' => 'http://download.oracle.com/otn-pub/java/jce/8/jce_policy-8.zip', - '7' => 'http://download.oracle.com/otn-pub/java/jce/7/UnlimitedJCEPolicyJDK7.zip', - '6' => 'http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip', - default => undef - } - $cookie = 'gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie' + fail('JCE URL must be specified') } } - # determine Oracle Java major and minor version, and installation path + # determine Java major and minor version, and installation path if $version_major and $version_minor { $label = $version_major $release_major = $version_major $release_minor = $version_minor - $release_hash = $url_hash if $release_major =~ /(\d+)u(\d+)/ { # Required for CentOS systems where Java8 update number is >= 171 to ensure @@ -143,25 +114,21 @@ $release_major = '6u45' $release_minor = 'b06' $install_path = "${java_se}1.6.0_45" - $release_hash = undef } '7' : { $release_major = '7u80' $release_minor = 'b15' $install_path = "${java_se}1.7.0_80" - $release_hash = undef } '8' : { $release_major = '8u201' $release_minor = 'b09' $install_path = "${java_se}1.8.0_201" - $release_hash = '42970487e3af4f5aa5bca3f542482c60' } default : { $release_major = '8u201' $release_minor = 'b09' $install_path = "${java_se}1.8.0_201" - $release_hash = '42970487e3af4f5aa5bca3f542482c60' } } } @@ -235,7 +202,7 @@ # JaveSE 6 distributed in .bin format # http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586-rpm.bin # http://download.oracle.com/otn-pub/java/jdk/6u45-b06/jdk-6u45-linux-i586.bin - # package name to download from Oracle's website + # package name to use in destination directory for the installer case $_package_type { 'bin' : { $package_name = "${java_se}-${release_major}-${os}-${arch}.bin" @@ -258,11 +225,8 @@ if $url { $source = $url } - elsif $release_hash != undef { - $source = "${oracle_url}/${release_major}-${release_minor}/${release_hash}/${package_name}" - } else { - $source = "${oracle_url}/${release_major}-${release_minor}/${package_name}" + fail('Url must be specified') } # full path to the installer @@ -292,7 +256,6 @@ archive { $destination : ensure => present, source => $source, - cookie => 'gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie', extract_path => '/tmp', cleanup => false, creates => $creates_path, @@ -339,7 +302,6 @@ } archive { "/tmp/jce-${version}.zip": source => $jce_download, - cookie => $cookie, extract => true, extract_path => $jce_path, extract_flags => '-oj', @@ -363,4 +325,4 @@ notice ("Action ${ensure} not supported.") } } -} \ No newline at end of file +} diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb new file mode 100644 index 00000000..f811df1c --- /dev/null +++ b/spec/defines/download_spec.rb @@ -0,0 +1,131 @@ +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 + context 'with CentOS 64-bit' do + let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'x86_64', name: 'CentOS', release: { full: '6.0' } } } } + + context 'when passing URL to url parameter' do + let(:params) do + { + ensure: 'present', + version_major: '8u201', + version_minor: 'b09', + java_se: 'jdk', + url: $url, + } + end + let(:title) { 'jdk8' } + + it { + is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.rpm') + } + end + + context 'when no url provided' do + let(:params) do + { + ensure: 'present', + version_major: '8u201', + version_minor: 'b09', + java_se: 'jdk', + } + end + let(:title) { 'jdk8' } + + it { + is_expected.to raise_error Puppet::Error + } + end + + context 'when manage_symlink is set to true' do + let(:params) do + { + ensure: 'present', + version: '6', + java_se: 'jdk', + basedir: '/usr/java', + manage_symlink: true, + symlink_name: 'java_home', + url: $url, + } + end + let(:title) { 'jdk6' } + + it { is_expected.to contain_file('/usr/java/java_home') } + 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 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 + [ + { + 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 diff --git a/spec/defines/oracle_spec.rb b/spec/defines/oracle_spec.rb deleted file mode 100644 index 9ecb7896..00000000 --- a/spec/defines/oracle_spec.rb +++ /dev/null @@ -1,474 +0,0 @@ -require 'spec_helper' - -oracle_url = 'http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.tar.gz' - -describe 'java::oracle', 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 Oracle Java SE 6 JDK' do - let(:params) { { ensure: 'present', version: '6', java_se: 'jdk' } } - let(:title) { 'jdk6' } - - it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-x64-rpm.bin') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').with_command('sh /tmp/jdk-6u45-linux-x64-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jdk*.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').that_requires('Archive[/tmp/jdk-6u45-linux-x64-rpm.bin]') } - end - - context 'when Oracle Java SE 7 JDK' do - let(:params) { { ensure: 'present', version: '7', java_se: 'jdk' } } - let(:title) { 'jdk7' } - - it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-x64.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').with_command('rpm --force -iv /tmp/jdk-7u80-linux-x64.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').that_requires('Archive[/tmp/jdk-7u80-linux-x64.rpm]') } - end - - context 'when Oracle Java SE 8 JDK' do - let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } } - let(:title) { 'jdk8' } - - it { is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u201 b09').with_command('rpm --force -iv /tmp/jdk-8u201-linux-x64.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u201 b09').that_requires('Archive[/tmp/jdk-8u201-linux-x64.rpm]') } - end - - context 'when Oracle Java SE 6 JRE' do - let(:params) { { ensure: 'present', version: '6', java_se: 'jre' } } - let(:title) { 'jre6' } - - it { is_expected.to contain_archive('/tmp/jre-6u45-linux-x64-rpm.bin') } - it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').with_command('sh /tmp/jre-6u45-linux-x64-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jre*.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').that_requires('Archive[/tmp/jre-6u45-linux-x64-rpm.bin]') } - end - - context 'when Oracle Java SE 7 JRE' do - let(:params) { { ensure: 'present', version: '7', java_se: 'jre' } } - let(:title) { 'jre7' } - - it { is_expected.to contain_archive('/tmp/jre-7u80-linux-x64.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').with_command('rpm --force -iv /tmp/jre-7u80-linux-x64.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').that_requires('Archive[/tmp/jre-7u80-linux-x64.rpm]') } - end - - context 'when select Oracle Java SE 8 JRE' do - let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } } - let(:title) { 'jre8' } - - it { is_expected.to contain_archive('/tmp/jre-8u201-linux-x64.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u201 b09').with_command('rpm --force -iv /tmp/jre-8u201-linux-x64.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u201 b09').that_requires('Archive[/tmp/jre-8u201-linux-x64.rpm]') } - end - - context 'when passing URL to url parameter' do - let(:params) do - { - ensure: 'present', - version_major: '8u201', - version_minor: 'b09', - java_se: 'jdk', - url: 'http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.rpm', - url_hash: 'ignored', - } - end - let(:title) { 'jdk8' } - - it { - is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.rpm') - .with_source('http://download.oracle.com/otn-pub/java/jdk/8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.rpm') - } - end - - context 'when passing a hash to url_hash parameter' do - let(:params) do - { - ensure: 'present', - version_major: '8u201', - version_minor: 'b09', - java_se: 'jdk', - url_hash: '42970487e3af4f5aa5bca3f542482c60', - } - end - let(:title) { 'jdk8' } - - it { - is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.rpm') - .with_source('http://download.oracle.com/otn-pub/java/jdk//8u201-b09/42970487e3af4f5aa5bca3f542482c60/jdk-8u201-linux-x64.rpm') - } - end - - context 'when installing multiple versions' do - let(:params) do - { - ensure: 'present', - version_major: '8u201', - version_minor: 'b09', - java_se: 'jdk', - url_hash: '42970487e3af4f5aa5bca3f542482c60', - } - end - let(:title) { 'jdk8' } - - let(:pre_condition) do - <<-EOL - java::oracle { - 'jdk8121': - ensure => 'present', - version_major => '8u121', - version_minor => 'b13', - java_se => 'jdk', - url_hash => 'abcdef01234567890', - } - EOL - end - - it { is_expected.to compile } - end - - context 'when installing Oracle Java SE 6 JRE with JCE' do - let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jre' } } - let(:title) { 'jre6jce' } - - it do - is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip') - is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jre1.6.0_99-amd64/lib/security') - end - end - - context 'when installing Oracle Java SE 6 JDK with JCE' do - let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jdk' } } - let(:title) { 'jre6jce' } - - it do - is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip') - is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jdk1.6.0_99-amd64/jre/lib/security') - end - end - - context 'when specifying package_type tar.gz and basedir' do - let(:params) do - { - ensure: 'present', - version: '6', - java_se: 'jdk', - basedir: '/usr/java', - package_type: 'tar.gz', - } - end - let(:title) { 'jdk6' } - - it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-x64.tar.gz') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').with_command('tar -zxf /tmp/jdk-6u45-linux-x64.tar.gz -C /usr/java') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').that_requires('Archive[/tmp/jdk-6u45-linux-x64.tar.gz]') } - end - context 'when manage_basedir is set to true' do - let(:params) do - { - ensure: 'present', - version: '6', - java_se: 'jdk', - basedir: '/usr/java', - manage_basedir: true, - } - end - let(:title) { 'jdk6' } - - it { is_expected.to contain_file('/usr/java') } - end - context 'when manage_symlink is set to true' do - let(:params) do - { - ensure: 'present', - version: '6', - java_se: 'jdk', - basedir: '/usr/java', - manage_symlink: true, - symlink_name: 'java_home', - } - end - let(:title) { 'jdk6' } - - it { is_expected.to contain_file('/usr/java/java_home') } - end - end - - context 'when on CentOS 32-bit' do - let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'i386', name: 'CentOS', release: { full: '6.6' } } } } - - context 'when selecting Oracle Java SE 6 JDK on RedHat family, 32-bit' do - let(:params) { { ensure: 'present', version: '6', java_se: 'jdk' } } - let(:title) { 'jdk6' } - - it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-i586-rpm.bin') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').with_command('sh /tmp/jdk-6u45-linux-i586-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jdk*.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').that_requires('Archive[/tmp/jdk-6u45-linux-i586-rpm.bin]') } - end - - context 'when selecting Oracle Java SE 7 JDK on RedHat family, 32-bit' do - let(:params) { { ensure: 'present', version: '7', java_se: 'jdk' } } - let(:title) { 'jdk7' } - - it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-i586.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').with_command('rpm --force -iv /tmp/jdk-7u80-linux-i586.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').that_requires('Archive[/tmp/jdk-7u80-linux-i586.rpm]') } - end - - context 'when selecting Oracle Java SE 8 JDK on RedHat family, 32-bit' do - let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } } - let(:title) { 'jdk8' } - - it { is_expected.to contain_archive('/tmp/jdk-8u201-linux-i586.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u201 b09').with_command('rpm --force -iv /tmp/jdk-8u201-linux-i586.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u201 b09').that_requires('Archive[/tmp/jdk-8u201-linux-i586.rpm]') } - end - - context 'when selecting Oracle Java SE 6 JRE on RedHat family, 32-bit' do - let(:params) { { ensure: 'present', version: '6', java_se: 'jre' } } - let(:title) { 'jdk6' } - - it { is_expected.to contain_archive('/tmp/jre-6u45-linux-i586-rpm.bin') } - it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').with_command('sh /tmp/jre-6u45-linux-i586-rpm.bin -x; rpm --force -iv sun*.rpm; rpm --force -iv jre*.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').that_requires('Archive[/tmp/jre-6u45-linux-i586-rpm.bin]') } - end - - context 'when select Oracle Java SE 7 JRE on RedHat family, 32-bit' do - let(:params) { { ensure: 'present', version: '7', java_se: 'jre' } } - let(:title) { 'jdk7' } - - it { is_expected.to contain_archive('/tmp/jre-7u80-linux-i586.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').with_command('rpm --force -iv /tmp/jre-7u80-linux-i586.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').that_requires('Archive[/tmp/jre-7u80-linux-i586.rpm]') } - end - - context 'when select Oracle Java SE 8 JRE on RedHat family, 32-bit' do - let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } } - let(:title) { 'jdk8' } - - it { is_expected.to contain_archive('/tmp/jre-8u201-linux-i586.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u201 b09').with_command('rpm --force -iv /tmp/jre-8u201-linux-i586.rpm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u201 b09').that_requires('Archive[/tmp/jre-8u201-linux-i586.rpm]') } - end - - context 'when installing multiple versions' do - let(:params) do - { - ensure: 'present', - version_major: '8u201', - version_minor: 'b09', - java_se: 'jdk', - url_hash: '42970487e3af4f5aa5bca3f542482c60', - } - end - let(:title) { 'jdk8' } - - let(:pre_condition) do - <<-EOL - java::oracle { - 'jdk8121': - ensure => 'present', - version_major => '8u121', - version_minor => 'b13', - java_se => 'jdk', - url_hash => 'abcdef01234567890', - } - EOL - end - - it { is_expected.to compile } - end - - context 'when installing Oracle Java SE 6 JRE with JCE' do - let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jre' } } - let(:title) { 'jre6jce' } - - it do - is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip') - is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jre1.6.0_99-amd64/lib/security') - end - end - - context 'when installing Oracle Java SE 6 JDK with JCE' do - let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jdk' } } - let(:title) { 'jre6jce' } - - it do - is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip') - is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/java/jdk1.6.0_99-amd64/jre/lib/security') - end - 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 Oracle Java SE 6 JDK' do - let(:params) { { ensure: 'present', version: '6', java_se: 'jdk' } } - let(:title) { 'jdk6' } - - it { is_expected.to contain_archive('/tmp/jdk-6u45-linux-x64.tar.gz') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').with_command('tar -zxf /tmp/jdk-6u45-linux-x64.tar.gz -C /usr/lib/jvm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 6 6u45 b06').that_requires('Archive[/tmp/jdk-6u45-linux-x64.tar.gz]') } - end - - context 'with Oracle Java SE 7 JDK' do - let(:params) { { ensure: 'present', version: '7', java_se: 'jdk' } } - let(:title) { 'jdk7' } - - it { is_expected.to contain_archive('/tmp/jdk-7u80-linux-x64.tar.gz') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').with_command('tar -zxf /tmp/jdk-7u80-linux-x64.tar.gz -C /usr/lib/jvm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 7 7u80 b15').that_requires('Archive[/tmp/jdk-7u80-linux-x64.tar.gz]') } - end - - context 'with Oracle Java SE 8 JDK' do - let(:params) { { ensure: 'present', version: '8', java_se: 'jdk' } } - let(:title) { 'jdk8' } - - it { is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.tar.gz') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u201 b09').with_command('tar -zxf /tmp/jdk-8u201-linux-x64.tar.gz -C /usr/lib/jvm') } - it { is_expected.to contain_exec('Install Oracle java_se jdk 8 8u201 b09').that_requires('Archive[/tmp/jdk-8u201-linux-x64.tar.gz]') } - end - - context 'with Oracle Java SE 6 JRE' do - let(:params) { { ensure: 'present', version: '6', java_se: 'jre' } } - let(:title) { 'jre6' } - - it { is_expected.to contain_archive('/tmp/jre-6u45-linux-x64.tar.gz') } - it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').with_command('tar -zxf /tmp/jre-6u45-linux-x64.tar.gz -C /usr/lib/jvm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 6 6u45 b06').that_requires('Archive[/tmp/jre-6u45-linux-x64.tar.gz]') } - end - - context 'when Oracle Java SE 7 JRE' do - let(:params) { { ensure: 'present', version: '7', java_se: 'jre' } } - let(:title) { 'jre7' } - - it { is_expected.to contain_archive('/tmp/jre-7u80-linux-x64.tar.gz') } - it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').with_command('tar -zxf /tmp/jre-7u80-linux-x64.tar.gz -C /usr/lib/jvm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 7 7u80 b15').that_requires('Archive[/tmp/jre-7u80-linux-x64.tar.gz]') } - end - - context 'when Oracle Java SE 8 JRE' do - let(:params) { { ensure: 'present', version: '8', java_se: 'jre' } } - let(:title) { 'jre8' } - - it { is_expected.to contain_archive('/tmp/jre-8u201-linux-x64.tar.gz') } - it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u201 b09').with_command('tar -zxf /tmp/jre-8u201-linux-x64.tar.gz -C /usr/lib/jvm') } - it { is_expected.to contain_exec('Install Oracle java_se jre 8 8u201 b09').that_requires('Archive[/tmp/jre-8u201-linux-x64.tar.gz]') } - end - - context 'when passing URL to url parameter' do - let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: oracle_url.to_s } } - let(:title) { 'jdk8' } - - it { is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.tar.gz') } - end - - context 'when installing multiple versions' do - let(:params) do - { - ensure: 'present', - version_major: '8u201', - version_minor: 'b09', - java_se: 'jdk', - url_hash: '42970487e3af4f5aa5bca3f542482c60', - } - end - let(:title) { 'jdk8' } - - let(:pre_condition) do - <<-EOL - java::oracle { - 'jdk8121': - ensure => 'present', - version_major => '8u121', - version_minor => 'b13', - java_se => 'jdk', - url_hash => 'abcdef01234567890', - } - EOL - end - - it { is_expected.to compile } - end - - context 'when installing Oracle Java SE 6 JRE with JCE' do - let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jre' } } - let(:title) { 'jre6jce' } - - it do - is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip') - is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/lib/jvm/jre1.6.0_99/lib/security') - end - end - - context 'when installing Oracle Java SE 6 JDK with JCE' do - let(:params) { { ensure: 'present', jce: true, version: '6', version_major: '6u99', version_minor: '99', java_se: 'jdk' } } - let(:title) { 'jre6jce' } - - it do - is_expected.to contain_archive('/tmp/jce-6.zip').with_source('http://download.oracle.com/otn-pub/java/jce_policy/6/jce_policy-6.zip') - is_expected.to contain_archive('/tmp/jce-6.zip').with_extract_path('/usr/lib/jvm/jdk1.6.0_99/jre/lib/security') - end - 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 From 0026df5de1190fdd85118c8e035c49fbfc750314 Mon Sep 17 00:00:00 2001 From: Bill Hurt Date: Mon, 29 Jul 2019 07:24:21 -0700 Subject: [PATCH 010/259] (MODULES-9604) Release prep - 5.0.0 --- CHANGELOG.md | 19 +++++++++++++++++++ metadata.json | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 31d148e7..d754ff69 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ 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). +## [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) + +### Changed + +- \[FM-8320\] Remove Oracle download [\#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) + +### Added + +- \(FM-8223\) converted to use litmus [\#376](https://github.com/puppetlabs/puppetlabs-java/pull/376) ([tphoney](https://github.com/tphoney)) +- Add buster support, default to 11 [\#369](https://github.com/puppetlabs/puppetlabs-java/pull/369) ([mhjacks](https://github.com/mhjacks)) +- Add support for debian buster [\#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) + +### Fixed + +- \(FM-8343\) use release numbers not lsbdistcodename [\#375](https://github.com/puppetlabs/puppetlabs-java/pull/375) ([tphoney](https://github.com/tphoney)) +- Revert "Add support for debian buster" [\#374](https://github.com/puppetlabs/puppetlabs-java/pull/374) ([tphoney](https://github.com/tphoney)) + ## [v4.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v4.1.0) (2019-05-29) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v4.0.0...v4.1.0) diff --git a/metadata.json b/metadata.json index 2c0868f3..ecd8b62d 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "4.1.0", + "version": "5.0.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 9c8d34f7e7f7fa3452be61dd6c38525f4cdc42fb Mon Sep 17 00:00:00 2001 From: sheena Date: Mon, 5 Aug 2019 11:10:39 +0100 Subject: [PATCH 011/259] MODULES-9669 Release preparation for v5.0.1 --- REFERENCE.md | 44 +++++++++++--------------------------------- metadata.json | 2 +- 2 files changed, 12 insertions(+), 34 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 6758ba5d..f7416d5a 100644 --- a/REFERENCE.md +++ b/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,28 +169,25 @@ 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. +Full URL Default value: `undef` -##### `url_hash` +##### `jce` 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. +Install Oracles Java Cryptographic Extensions into the JRE or JDK -Default value: `undef` +Default value: `false` -##### `jce` +##### `jce_url` Data type: `Any` -Install Oracles Java Cryptographic Extensions into the JRE or JDK +Full URL to the jce zip file -Default value: `false` +Default value: `undef` ##### `basedir` diff --git a/metadata.json b/metadata.json index ecd8b62d..0d87c11f 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "5.0.0", + "version": "5.0.1", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From d277391efcb65a972160b91abd37778060bb4d03 Mon Sep 17 00:00:00 2001 From: Florin Dragos Date: Thu, 29 Aug 2019 17:09:24 +0300 Subject: [PATCH 012/259] (MAINT) pdksync: fix for net-ssh 5 host_key check --- spec/spec_helper_acceptance.rb | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 745d46e1..aabeb0b8 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -28,7 +28,30 @@ 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 From 21d39590b0ee65df7a5757f93d2d7134c2b2170e Mon Sep 17 00:00:00 2001 From: Jeroen Hooyberghs Date: Tue, 10 Sep 2019 12:21:19 +0200 Subject: [PATCH 013/259] Add support for java 11, the default in debian buster 10 --- lib/facter/java_libjvm_path.rb | 2 +- lib/facter/java_major_version.rb | 10 +++++++++- lib/facter/java_patch_level.rb | 11 ++++++++++- lib/facter/java_version.rb | 3 ++- spec/classes/java_spec.rb | 16 ++++++++++++++++ spec/defines/download_spec.rb | 12 ++++++++++++ spec/unit/facter/java_libjvm_path_spec.rb | 4 ++-- 7 files changed, 52 insertions(+), 6 deletions(-) diff --git a/lib/facter/java_libjvm_path.rb b/lib/facter/java_libjvm_path.rb index 698a8f03..499e17e9 100644 --- a/lib/facter/java_libjvm_path.rb +++ b/lib/facter/java_libjvm_path.rb @@ -14,7 +14,7 @@ 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") + java_libjvm_file = Dir.glob("#{java_default_home}/**/lib/**/libjvm.so") if java_libjvm_file.nil? || java_libjvm_file.empty? nil else diff --git a/lib/facter/java_major_version.rb b/lib/facter/java_major_version.rb index 8fc04e2a..c82e20cf 100644 --- a/lib/facter/java_major_version.rb +++ b/lib/facter/java_major_version.rb @@ -16,7 +16,15 @@ 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_test = java_version.strip.split('.')[0] + if java_version_test.to_i > 1 + java_major_version = java_version_test + else + java_major_version = java_version.strip.split('_')[0].split('.')[1] + end + end end java_major_version end diff --git a/lib/facter/java_patch_level.rb b/lib/facter/java_patch_level.rb index 0c952ec1..5e4e8970 100644 --- a/lib/facter/java_patch_level.rb +++ b/lib/facter/java_patch_level.rb @@ -14,7 +14,16 @@ 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_test = java_version.strip.split('.')[0] + if java_version_test.to_i > 1 + java_patch_level = java_version.strip.split('.')[2] + else + java_patch_level = java_version.strip.split('_')[1] + end + end + end java_patch_level end diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index f717f69c..c5b92d8f 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -24,7 +24,8 @@ 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 diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 95d8fe8e..170e4e66 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -53,6 +53,22 @@ 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' } } diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index f811df1c..cbb10978 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -67,6 +67,18 @@ 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 [ { diff --git a/spec/unit/facter/java_libjvm_path_spec.rb b/spec/unit/facter/java_libjvm_path_spec.rb index b6277cf9..1b1a2e2d 100644 --- a/spec/unit/facter/java_libjvm_path_spec.rb +++ b/spec/unit/facter/java_libjvm_path_spec.rb @@ -11,14 +11,14 @@ 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 From 197213e51734ac949f2af61fb7ebc9703265f1b3 Mon Sep 17 00:00:00 2001 From: Jeroen Hooyberghs Date: Tue, 10 Sep 2019 14:15:56 +0200 Subject: [PATCH 014/259] Put test result in variable to satisfy RuboCop --- lib/facter/java_major_version.rb | 12 ++++++------ lib/facter/java_patch_level.rb | 13 ++++++------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/lib/facter/java_major_version.rb b/lib/facter/java_major_version.rb index c82e20cf..3c3c99f1 100644 --- a/lib/facter/java_major_version.rb +++ b/lib/facter/java_major_version.rb @@ -18,12 +18,12 @@ java_version = Facter.value(:java_version) unless java_version.nil? # First part > 1, use the first part as major version - java_version_test = java_version.strip.split('.')[0] - if java_version_test.to_i > 1 - java_major_version = java_version_test - else - java_major_version = java_version.strip.split('_')[0].split('.')[1] - end + 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 diff --git a/lib/facter/java_patch_level.rb b/lib/facter/java_patch_level.rb index 5e4e8970..d3acded7 100644 --- a/lib/facter/java_patch_level.rb +++ b/lib/facter/java_patch_level.rb @@ -16,14 +16,13 @@ java_version = Facter.value(:java_version) unless java_version.nil? # First part > 1, use . as seperator to get patch level - java_version_test = java_version.strip.split('.')[0] - if java_version_test.to_i > 1 - java_patch_level = java_version.strip.split('.')[2] - else - java_patch_level = java_version.strip.split('_')[1] - end + 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 From ba9a1dbe457737bfc7cbdbe2b164a28f712df5e9 Mon Sep 17 00:00:00 2001 From: lionce Date: Tue, 10 Sep 2019 16:27:01 +0300 Subject: [PATCH 015/259] add support Debain10 --- metadata.json | 3 ++- provision.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index 0d87c11f..b99c3e66 100644 --- a/metadata.json +++ b/metadata.json @@ -52,7 +52,8 @@ "operatingsystem": "Debian", "operatingsystemrelease": [ "8", - "9" + "9", + "10" ] }, { diff --git a/provision.yaml b/provision.yaml index 346c9d16..b9f845c5 100644 --- a/provision.yaml +++ b/provision.yaml @@ -10,4 +10,4 @@ travis_el: images: ['centos:6', 'centos:7', 'oraclelinux:6', 'oraclelinux:7', 'scientificlinux/sl:6', 'scientificlinux/sl:7'] 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', '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'] From 27fed78308c711f3aed67449bb5cca0c18291129 Mon Sep 17 00:00:00 2001 From: Caspar Clemens Mierau Date: Fri, 6 Sep 2019 16:15:50 +0200 Subject: [PATCH 016/259] ensure Java8 update number is being handled as a number when doing version comparing --- manifests/download.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/download.pp b/manifests/download.pp index c75966a2..2a33dbea 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -98,7 +98,7 @@ # 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}" From f83cf9fc38e1513511c2a3609958d5a154844040 Mon Sep 17 00:00:00 2001 From: tphoney Date: Tue, 17 Sep 2019 15:50:40 +0100 Subject: [PATCH 017/259] (maint) Add a codeowners file --- CODEOWNERS | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 CODEOWNERS diff --git a/CODEOWNERS b/CODEOWNERS new file mode 100644 index 00000000..a5d109e9 --- /dev/null +++ b/CODEOWNERS @@ -0,0 +1,2 @@ +# Setting ownership to the modules team +* @puppetlabs/modules From f70d15207a6e3cf41cfc4c6a18704bdfef0d8441 Mon Sep 17 00:00:00 2001 From: tphoney Date: Tue, 17 Sep 2019 11:03:27 +0100 Subject: [PATCH 018/259] fake paths always cause errors --- spec/acceptance/install_spec.rb | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 03469805..2cd7add5 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -71,10 +71,6 @@ 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 - apply_manifest(bogus_alternative, catch_failures: true) - end + apply_manifest(bogus_alternative, expect_failures: true) end end From d4e5461c26047bf24430101d3992b72ef377cd42 Mon Sep 17 00:00:00 2001 From: Robert Brooks Date: Thu, 26 Sep 2019 09:57:55 -0700 Subject: [PATCH 019/259] we need to check if java_default_home has a value before we attempt to find libjvm.so, otherwise we search the entire filesystem --- lib/facter/java_libjvm_path.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/facter/java_libjvm_path.rb b/lib/facter/java_libjvm_path.rb index 499e17e9..95ae61ae 100644 --- a/lib/facter/java_libjvm_path.rb +++ b/lib/facter/java_libjvm_path.rb @@ -14,7 +14,9 @@ confine kernel: ['Linux', 'OpenBSD'] setcode do java_default_home = Facter.value(:java_default_home) - java_libjvm_file = Dir.glob("#{java_default_home}/**/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 From ea006c058748ae88d092d46fd7841d71362a2d57 Mon Sep 17 00:00:00 2001 From: Michael T Lombardi Date: Fri, 18 Oct 2019 17:18:02 -0500 Subject: [PATCH 020/259] (FM-8275) Add vagrant provision list Prior to this commit the only provisioners included in the provision lists were docker and vmpooler, neither of which are particularly accessible to folks developing on Windows outside of Puppet. This commit adds a list which leverages the vagrant provisioner. --- provision.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/provision.yaml b/provision.yaml index b9f845c5..11da9077 100644 --- a/provision.yaml +++ b/provision.yaml @@ -8,6 +8,9 @@ travis_deb: 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', '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'] From de79582baf41c8067ab4b2e4fbf367aed1a8dc97 Mon Sep 17 00:00:00 2001 From: Ciaran McCrisken Date: Thu, 24 Oct 2019 15:21:53 +0100 Subject: [PATCH 021/259] Point pdk gem to head of master until PDK-1525 resolved --- Gemfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 030b78b7..60dd9056 100644 --- a/Gemfile +++ b/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(?(https?|git)[:@][^#]*)(#(?.*))?} @@ -69,4 +70,4 @@ extra_gemfiles.each do |gemfile| eval(File.read(gemfile), binding) end end -# vim: syntax=ruby +# vim: syntax=ruby \ No newline at end of file From 459757dd6560837631aedb023347b3cb6dabb81f Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Fri, 1 Nov 2019 09:29:02 +0800 Subject: [PATCH 022/259] (maint) Update for PDK templates This commit updates the module as per PDK-Templates commit 0b5b39b --- .rubocop.yml | 8 +++++++- Gemfile | 3 ++- Rakefile | 13 +++++++++++-- metadata.json | 4 ++-- spec/default_facts.yml | 1 + 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index f17c5ddd..bab25db5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -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: diff --git a/Gemfile b/Gemfile index 60dd9056..f7560c16 100644 --- a/Gemfile +++ b/Gemfile @@ -24,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] @@ -70,4 +71,4 @@ extra_gemfiles.each do |gemfile| eval(File.read(gemfile), binding) end end -# vim: syntax=ruby \ No newline at end of file +# vim: syntax=ruby diff --git a/Rakefile b/Rakefile index d9b223c6..395df547 100644 --- a/Rakefile +++ b/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 diff --git a/metadata.json b/metadata.json index b99c3e66..20c41ac6 100644 --- a/metadata.json +++ b/metadata.json @@ -80,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" } diff --git a/spec/default_facts.yml b/spec/default_facts.yml index ea1e4808..f777abfc 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -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" From 4913dc0bef543d1321b8e3740e9eabcf0b32f026 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Fri, 1 Nov 2019 09:30:31 +0800 Subject: [PATCH 023/259] (PDK-1501) Allow Travis CI config to be templated Previously the module unmanaged the Travis CI file when converted to Litmus. This commit allows the Travis CI file to be managed. --- .sync.yml | 57 ++++++++++++++++++++++++++++++++++++++++++- .travis.yml | 70 ++++++++++++++++++++--------------------------------- 2 files changed, 82 insertions(+), 45 deletions(-) diff --git a/.sync.yml b/.sync.yml index b9f29ab0..d2d4f82c 100644 --- a/.sync.yml +++ b/.sync.yml @@ -7,7 +7,62 @@ 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 + - + 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 appveyor.yml: delete: true diff --git a/.travis.yml b/.travis.yml index 8c3980ab..ea8a113c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -24,72 +24,54 @@ matrix: fast_finish: true include: - - bundler_args: + env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" + stage: static + - + env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec + rvm: 2.4.5 + stage: spec + - + env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec + rvm: 2.5.3 + stage: spec + - + 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 - 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 + script: ["bundle exec rake litmus:acceptance:parallel"] services: docker sudo: required - - bundler_args: + 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 - 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 + script: ["bundle exec rake litmus:acceptance:parallel"] services: docker - - bundler_args: + 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 - 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 + script: ["bundle exec rake litmus:acceptance:parallel"] services: docker sudo: required - - bundler_args: + 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 - 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 + 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 - - - env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec - rvm: 2.4.5 - stage: spec - - - env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec - rvm: 2.5.3 - stage: spec - - - env: DEPLOY_TO_FORGE=yes - stage: deploy branches: only: - master From ee0e10dc12a679a033fb0f9dacc9ce8c49be4b5d Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Fri, 1 Nov 2019 09:47:13 +0800 Subject: [PATCH 024/259] (maint) Fix rubocop failures in download_spec.rb This commit updates the download_spec.rb file to remote the global variable and use let based test fixture. --- spec/defines/download_spec.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index cbb10978..f9b9c974 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -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 @@ version_major: '8u201', version_minor: 'b09', java_se: 'jdk', - url: $url, + url: url, } end let(:title) { 'jdk8' } @@ -48,7 +48,7 @@ basedir: '/usr/java', manage_symlink: true, symlink_name: 'java_home', - url: $url, + url: url, } end let(:title) { 'jdk6' } @@ -61,7 +61,7 @@ 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') } @@ -72,7 +72,7 @@ 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(: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') } From 74c5c27108e0389dd18b47043e17226f39289099 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Fri, 1 Nov 2019 16:48:53 +0000 Subject: [PATCH 025/259] (FM-8634) ensure encrypted communication for fixtures --- .fixtures.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 514466cf..c675307e 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -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}" From 018de0aef68044deccac371d29cc4c3e1b0b95d4 Mon Sep 17 00:00:00 2001 From: Glenn Sarti Date: Tue, 5 Nov 2019 13:31:09 +0800 Subject: [PATCH 026/259] (PDK-1501) Fix acceptance stages in Travis CI Previously the Travis CI file was brought under PDK control, however the sync.yml did not contain the stage settings for the Litmus jobs which meant that they did not run. This commit fixes that error and runs PDK Update again --- .sync.yml | 3 +++ .travis.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.sync.yml b/.sync.yml index d2d4f82c..f125e585 100644 --- a/.sync.yml +++ b/.sync.yml @@ -24,6 +24,7 @@ - bundle exec rake litmus:acceptance:parallel services: docker sudo: required + stage: acceptance - bundler_args: dist: trusty @@ -50,6 +51,7 @@ - bundle exec rake litmus:acceptance:parallel services: docker sudo: required + stage: acceptance - bundler_args: dist: trusty @@ -63,6 +65,7 @@ - bundle exec rake litmus:acceptance:parallel services: docker sudo: required + stage: acceptance appveyor.yml: delete: true diff --git a/.travis.yml b/.travis.yml index ea8a113c..8c169528 100644 --- a/.travis.yml +++ b/.travis.yml @@ -45,6 +45,7 @@ matrix: 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"] @@ -62,6 +63,7 @@ matrix: 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"] @@ -71,6 +73,7 @@ matrix: rvm: 2.5.1 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker + stage: acceptance sudo: required branches: only: From c477db3b596e118e6321e9045a9029eab1b462ad Mon Sep 17 00:00:00 2001 From: lionce Date: Wed, 6 Nov 2019 14:25:09 +0200 Subject: [PATCH 027/259] MODULES-10062 - fix acceptance tests on sles --- spec/acceptance/install_spec.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 2cd7add5..9fddc8cf 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -71,6 +71,10 @@ end it 'fails on debian or RHEL when passed fake java_alternative and path' do - apply_manifest(bogus_alternative, expect_failures: true) + if os[:family] == 'sles' + apply_manifest(bogus_alternative, catch_failures: true) + else + apply_manifest(bogus_alternative, expect_failures: true) + end end end From 6f05978750338484fe3074272e5b8025abc229a9 Mon Sep 17 00:00:00 2001 From: lionce Date: Wed, 6 Nov 2019 17:45:14 +0200 Subject: [PATCH 028/259] FM-8499 - remove ubuntu14 support --- metadata.json | 1 - provision.yaml | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/metadata.json b/metadata.json index 20c41ac6..0f749c3b 100644 --- a/metadata.json +++ b/metadata.json @@ -59,7 +59,6 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "14.04", "16.04", "18.04" ] diff --git a/provision.yaml b/provision.yaml index 11da9077..e99b991c 100644 --- a/provision.yaml +++ b/provision.yaml @@ -4,7 +4,7 @@ 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'] @@ -13,4 +13,4 @@ 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', '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', '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'] From afb5531a4a421d13aaa3061a25791448699d0495 Mon Sep 17 00:00:00 2001 From: David Swan Date: Fri, 8 Nov 2019 16:07:59 +0000 Subject: [PATCH 029/259] (FM-8676) - Support added for CentOS 8 --- metadata.json | 3 ++- provision.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index 0f749c3b..9c6ec36d 100644 --- a/metadata.json +++ b/metadata.json @@ -32,7 +32,8 @@ "operatingsystemrelease": [ "5", "6", - "7" + "7", + "8" ] }, { diff --git a/provision.yaml b/provision.yaml index e99b991c..8e93ba63 100644 --- a/provision.yaml +++ b/provision.yaml @@ -13,4 +13,4 @@ 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', 'debian-10-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'] From a0bab6cf389501db37bfae32cc4c5fb2c1ba617b Mon Sep 17 00:00:00 2001 From: lionce Date: Mon, 11 Nov 2019 15:31:38 +0200 Subject: [PATCH 030/259] Release version 6.0.0 --- CHANGELOG.md | 23 +++++++++++++++++++++++ metadata.json | 2 +- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d754ff69..c508b8a5 100644 --- a/CHANGELOG.md +++ b/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) diff --git a/metadata.json b/metadata.json index 9c6ec36d..9d997abf 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "5.0.1", + "version": "6.0.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From fb850647a89e0c23b39c69a9209998884b09500a Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Thu, 21 Nov 2019 17:17:50 +0000 Subject: [PATCH 031/259] (maint) sort and canonicalise .sync.yml --- .sync.yml | 135 +++++++++++++++++++++++++----------------------------- 1 file changed, 63 insertions(+), 72 deletions(-) diff --git a/.sync.yml b/.sync.yml index f125e585..4786d689 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,83 +1,74 @@ --- -.gitignore: +".gitignore": required: - - ---.project - -.gitlab-ci.yml: + - "---.project" +".gitlab-ci.yml": unmanaged: true - -.travis.yml: +".travis.yml": branches: - - release + - 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 - + - 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 - 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')" - + ":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') spec/spec_helper.rb: - mock_with: ':rspec' + mock_with: ":rspec" coverage_report: true From 4610ca34a801d7d594b190a860f3656481c681fe Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Thu, 21 Nov 2019 17:18:40 +0000 Subject: [PATCH 032/259] (maint) mark .gitlab-ci.yml as deleted --- .sync.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.sync.yml b/.sync.yml index 4786d689..2b5530b0 100644 --- a/.sync.yml +++ b/.sync.yml @@ -3,7 +3,7 @@ required: - "---.project" ".gitlab-ci.yml": - unmanaged: true + delete: true ".travis.yml": branches: - release From d30c38266beb79ae2afbbe6228c2bbcdd0d0d6a6 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Thu, 21 Nov 2019 18:06:18 +0000 Subject: [PATCH 033/259] (maint) remove obsolete gepetto .project files --- .project | 23 ----------------------- .sync.yml | 3 --- 2 files changed, 26 deletions(-) delete mode 100644 .project diff --git a/.project b/.project deleted file mode 100644 index 139ecf77..00000000 --- a/.project +++ /dev/null @@ -1,23 +0,0 @@ - - - puppetlabs-java - - - - - - com.puppetlabs.geppetto.pp.dsl.ui.modulefileBuilder - - - - - org.eclipse.xtext.ui.shared.xtextBuilder - - - - - - com.puppetlabs.geppetto.pp.dsl.ui.puppetNature - org.eclipse.xtext.ui.shared.xtextNature - - diff --git a/.sync.yml b/.sync.yml index 2b5530b0..5be97727 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,7 +1,4 @@ --- -".gitignore": - required: - - "---.project" ".gitlab-ci.yml": delete: true ".travis.yml": From e300649623841f25786d71d2f3621bb40622bb3f Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Thu, 21 Nov 2019 18:16:13 +0000 Subject: [PATCH 034/259] (maint) update gitignore and pdkignore for .project file removal --- .gitignore | 1 + .pdkignore | 1 + 2 files changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 3f4e2e84..2767022c 100644 --- a/.gitignore +++ b/.gitignore @@ -22,5 +22,6 @@ /convert_report.txt /update_report.txt .DS_Store +.project .envrc /inventory.yaml diff --git a/.pdkignore b/.pdkignore index 54d2cda3..e6215cd0 100644 --- a/.pdkignore +++ b/.pdkignore @@ -22,6 +22,7 @@ /convert_report.txt /update_report.txt .DS_Store +.project .envrc /inventory.yaml /appveyor.yml From a57d124d7d6f42d58263308e410d0365fc770848 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 25 Nov 2019 18:25:27 +0000 Subject: [PATCH 035/259] (maint) enable simplecov for ruby codecoverage testing --- .sync.yml | 1 + .travis.yml | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.sync.yml b/.sync.yml index 5be97727..cfcea953 100644 --- a/.sync.yml +++ b/.sync.yml @@ -57,6 +57,7 @@ services: docker sudo: required stage: acceptance + simplecov: true appveyor.yml: delete: true Gemfile: diff --git a/.travis.yml b/.travis.yml index 8c169528..7e923a6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ before_install: - gem --version - bundle -v script: - - 'bundle exec rake $CHECK' + - 'SIMPLECOV=yes bundle exec rake $CHECK' bundler_args: --without system_tests rvm: - 2.5.3 @@ -34,9 +34,6 @@ matrix: env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec rvm: 2.5.3 stage: spec - - - 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: @@ -75,6 +72,9 @@ matrix: services: docker stage: acceptance sudo: required + - + env: DEPLOY_TO_FORGE=yes + stage: deploy branches: only: - master From 26e9bcfc1aec0000510da898e97ee32c3ca57e64 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 27 Nov 2019 18:31:35 +0000 Subject: [PATCH 036/259] (maint) Update to PDK 1.14.1 --- Gemfile | 1 - README.markdown => README.md | 0 metadata.json | 6 +++--- 3 files changed, 3 insertions(+), 4 deletions(-) rename README.markdown => README.md (100%) diff --git a/Gemfile b/Gemfile index f7560c16..0e395e7e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,4 @@ 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(?(https?|git)[:@][^#]*)(#(?.*))?} diff --git a/README.markdown b/README.md similarity index 100% rename from README.markdown rename to README.md diff --git a/metadata.json b/metadata.json index 9d997abf..90d308aa 100644 --- a/metadata.json +++ b/metadata.json @@ -79,7 +79,7 @@ "version_requirement": ">= 5.5.10 < 7.0.0" } ], - "template-url": "https://github.com/puppetlabs/pdk-templates/#master", - "template-ref": "1.14.1-0-g0b5b39b", - "pdk-version": "1.14.0" + "template-url": "https://github.com/puppetlabs/pdk-templates#master", + "template-ref": "heads/master-0-gfaf9e8b", + "pdk-version": "1.14.1" } From 4ad9ec6191b5ed3dd22779fab47edcf02c5d4c09 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Tue, 3 Dec 2019 12:37:39 +0200 Subject: [PATCH 037/259] Add Github Actions release workflow --- .github/workflows/release.yml | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..820339d7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,52 @@ +name: "release" + +on: + push: + branches: + - 'release' + +jobs: + LitmusAcceptance: + + runs-on: self-hosted + + strategy: + matrix: + ruby_version: [2.5.x] + puppet_gem_version: [~> 6.0] + platform: [release_checks] + agent_family: ['puppet5', 'puppet6'] + + steps: + - uses: actions/checkout@v1 + + - name: Litmus Parallel + uses: puppetlabs/action-litmus_parallel@master + with: + platform: ${{ matrix.platform }} + agent_family: ${{ matrix.agent_family }} + + Spec: + runs-on: self-hosted + + strategy: + matrix: + check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'] + ruby_version: [2.4.x, 2.5.x] + puppet_gem_version: [~> 5.0, ~> 6.0] + exclude: + - puppet_gem_version: ~> 5.0 + check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop' + - ruby_version: 2.4.x + puppet_gem_version: ~> 6.0 + - ruby_version: 2.5.x + puppet_gem_version: ~> 5.0 + + steps: + - uses: actions/checkout@v1 + + - name: Spec Tests + uses: puppetlabs/action-litmus_spec@master + with: + puppet_gem_versionm: ${{ matrix.puppet_gem_version }} + check: ${{ matrix.check }} From 60a4af1843c3c3a664ab319837e3c4cce9208864 Mon Sep 17 00:00:00 2001 From: sheena Date: Fri, 6 Dec 2019 11:24:25 +0000 Subject: [PATCH 038/259] MODULES-10242 Add ubuntu14 support back to the modules --- metadata.json | 1 + provision.yaml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/metadata.json b/metadata.json index 90d308aa..24a0c726 100644 --- a/metadata.json +++ b/metadata.json @@ -60,6 +60,7 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ + "14.04", "16.04", "18.04" ] diff --git a/provision.yaml b/provision.yaml index 8e93ba63..900d54f3 100644 --- a/provision.yaml +++ b/provision.yaml @@ -4,7 +4,7 @@ default: images: ['waffleimage/debian8'] travis_deb: provisioner: docker - images: ['debian:8', 'debian:9', 'ubuntu:16.04', 'ubuntu:18.04'] + images: ['debian:8', 'debian:9', 'ubuntu:14.04', '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'] @@ -13,4 +13,4 @@ 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', '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'] + 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'] From aa255af5ada25d39270d53bc301bf0b1f4ba4250 Mon Sep 17 00:00:00 2001 From: sheena Date: Fri, 6 Dec 2019 14:39:12 +0000 Subject: [PATCH 039/259] MODULES-10236 disable deploy_to_forge for the module --- .sync.yml | 2 ++ .travis.yml | 6 ------ metadata.json | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.sync.yml b/.sync.yml index cfcea953..5d1f4ace 100644 --- a/.sync.yml +++ b/.sync.yml @@ -2,6 +2,8 @@ ".gitlab-ci.yml": delete: true ".travis.yml": + deploy_to_forge: + enabled: false branches: - release includes: diff --git a/.travis.yml b/.travis.yml index 7e923a6c..bc6e320f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,9 +17,6 @@ stages: - static - spec - acceptance - - - if: tag =~ ^v\d - name: deploy matrix: fast_finish: true include: @@ -72,9 +69,6 @@ matrix: services: docker stage: acceptance sudo: required - - - env: DEPLOY_TO_FORGE=yes - stage: deploy branches: only: - master diff --git a/metadata.json b/metadata.json index 24a0c726..a92779f5 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-gfaf9e8b", + "template-ref": "heads/master-0-g643529a", "pdk-version": "1.14.1" } From 6bdf734416755143d8ad089e3d86e79bf9fc786d Mon Sep 17 00:00:00 2001 From: Molly Waggett Date: Tue, 10 Dec 2019 10:14:10 -0800 Subject: [PATCH 040/259] (maint) Remove MAINTAINERS file --- MAINTAINERS.md | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 MAINTAINERS.md diff --git a/MAINTAINERS.md b/MAINTAINERS.md deleted file mode 100644 index 179f45bd..00000000 --- a/MAINTAINERS.md +++ /dev/null @@ -1,6 +0,0 @@ -## Maintenance - -Maintainers: - - Puppet Forge Modules Team `forge-modules |at| puppet |dot| com` - -Tickets: https://tickets.puppet.com/browse/MODULES. Make sure to set component to `java`. From 1bfe4da05ac4e3816b41a7e2a7a613fb2469b617 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 16 Dec 2019 20:14:40 +0000 Subject: [PATCH 041/259] (maint) update travis to not use bundle update --system --- .travis.yml | 4 +++- metadata.json | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc6e320f..8cfd3bdf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,9 @@ cache: bundler before_install: - bundle -v - rm -f Gemfile.lock - - gem update --system $RUBYGEMS_VERSION + - "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner" + - "# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used" + - '[ -z "$RUBYGEMS_VERSION" ] || gem update --system $RUBYGEMS_VERSION' - gem --version - bundle -v script: diff --git a/metadata.json b/metadata.json index a92779f5..9dde18f9 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-g643529a", - "pdk-version": "1.14.1" + "template-ref": "heads/master-0-gcaed9d7", + "pdk-version": "1.15.0" } From 2b641fd530e020ef5e1d3c0f88713d657244447f Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Mon, 16 Dec 2019 20:57:22 +0000 Subject: [PATCH 042/259] (maint) update travis to notify puppet slack --- .sync.yml | 3 +++ .travis.yml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/.sync.yml b/.sync.yml index 5d1f4ace..9fa053e5 100644 --- a/.sync.yml +++ b/.sync.yml @@ -60,6 +60,9 @@ sudo: required stage: acceptance simplecov: true + notifications: + slack: + secure: Wf7Wz3KC0G9ngPiDcOIpSqcCfdvwKQqZdNH/z3GMcj/OipMAdyFSAVnBvikIl7L1c0LMU9ATEpub+jYzViT7RZywaNyer6SRAfs6MIgAYo4xxF/mOnDHAxXeUYAsBXXL4sS3NX2XWMPa9ZWUeuUQKth8O4STWgAX298QZLyYx5k= appveyor.yml: delete: true Gemfile: diff --git a/.travis.yml b/.travis.yml index 8cfd3bdf..d145c702 100644 --- a/.travis.yml +++ b/.travis.yml @@ -78,3 +78,5 @@ branches: - release notifications: email: false + slack: + secure: Wf7Wz3KC0G9ngPiDcOIpSqcCfdvwKQqZdNH/z3GMcj/OipMAdyFSAVnBvikIl7L1c0LMU9ATEpub+jYzViT7RZywaNyer6SRAfs6MIgAYo4xxF/mOnDHAxXeUYAsBXXL4sS3NX2XWMPa9ZWUeuUQKth8O4STWgAX298QZLyYx5k= From 6cda8ef5bab9d7e14f8db90d4967311097f96b7d Mon Sep 17 00:00:00 2001 From: David Swan Date: Fri, 10 Jan 2020 15:58:46 +0000 Subject: [PATCH 043/259] (FM-8581) - Debian 10 added to travis and provision file refactored --- .sync.yml | 60 ++++++++++++++++++++++++++++++++++++++++++++++---- .travis.yml | 46 ++++++++++++++++++++++++++++++++++---- provision.yaml | 18 ++++++++++----- 3 files changed, 110 insertions(+), 14 deletions(-) diff --git a/.sync.yml b/.sync.yml index 9fa053e5..97c09a43 100644 --- a/.sync.yml +++ b/.sync.yml @@ -35,10 +35,62 @@ services: docker - bundler_args: dist: trusty - env: PLATFORMS=el_puppet5 + env: PLATFORMS=ub_puppet5 rvm: 2.5.1 before_script: - - bundle exec rake 'litmus:provision_list[travis_el]' + - bundle exec rake 'litmus:provision_list[travis_ub]' + - 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=ub_puppet6 + rvm: 2.5.1 + before_script: + - bundle exec rake 'litmus:provision_list[travis_ub]' + - 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=el6_puppet5 + rvm: 2.5.1 + before_script: + - bundle exec rake 'litmus:provision_list[travis_el6]' + - 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=el6_puppet6 + rvm: 2.5.1 + before_script: + - bundle exec rake 'litmus:provision_list[travis_el6]' + - 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 + - bundler_args: + dist: trusty + env: PLATFORMS=el7_puppet5 + rvm: 2.5.1 + before_script: + - bundle exec rake 'litmus:provision_list[travis_el7]' - bundle exec rake 'litmus:install_agent[puppet5]' - bundle exec rake litmus:install_module script: @@ -48,10 +100,10 @@ stage: acceptance - bundler_args: dist: trusty - env: PLATFORMS=el_puppet6 + env: PLATFORMS=el7_puppet6 rvm: 2.5.1 before_script: - - bundle exec rake 'litmus:provision_list[travis_el]' + - bundle exec rake 'litmus:provision_list[travis_el7]' - bundle exec rake 'litmus:install_agent[puppet6]' - bundle exec rake litmus:install_module script: diff --git a/.travis.yml b/.travis.yml index d145c702..0f046cab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -52,20 +52,58 @@ matrix: 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"] + before_script: ["bundle exec rake 'litmus:provision_list[travis_ub]'", "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=el_puppet5 + env: PLATFORMS=ub_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"] + before_script: ["bundle exec rake 'litmus:provision_list[travis_ub]'", "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=el_puppet6 + env: PLATFORMS=ub_puppet6 + rvm: 2.5.1 + script: ["bundle exec rake litmus:acceptance:parallel"] + services: docker + - + before_script: ["bundle exec rake 'litmus:provision_list[travis_el6]'", "bundle exec rake 'litmus:install_agent[puppet5]'", "bundle exec rake litmus:install_module"] + bundler_args: + dist: trusty + env: PLATFORMS=el6_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_el6]'", "bundle exec rake 'litmus:install_agent[puppet6]'", "bundle exec rake litmus:install_module"] + bundler_args: + dist: trusty + env: PLATFORMS=el6_puppet6 + 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_el7]'", "bundle exec rake 'litmus:install_agent[puppet5]'", "bundle exec rake litmus:install_module"] + bundler_args: + dist: trusty + env: PLATFORMS=el7_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_el7]'", "bundle exec rake 'litmus:install_agent[puppet6]'", "bundle exec rake litmus:install_module"] + bundler_args: + dist: trusty + env: PLATFORMS=el7_puppet6 rvm: 2.5.1 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker diff --git a/provision.yaml b/provision.yaml index 900d54f3..6ac1acc2 100644 --- a/provision.yaml +++ b/provision.yaml @@ -2,15 +2,21 @@ default: provisioner: docker images: ['waffleimage/debian8'] -travis_deb: - provisioner: docker - images: ['debian:8', 'debian:9', 'ubuntu:14.04', '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'] +travis_deb: + provisioner: docker + images: ['waffleimage/debian8', 'waffleimage/debian9', 'waffleimage/debian10'] +travis_ub: + provisioner: docker + images: ['waffleimage/ubuntu14.04', 'waffleimage/ubuntu16.04', 'waffleimage/ubuntu18.04'] +travis_el6: + provisioner: docker + images: ['waffleimage/centos6', 'waffleimage/oraclelinux6', 'waffleimage/scientificlinux6'] +travis_el7: + provisioner: docker + images: ['waffleimage/centos7', 'waffleimage/oraclelinux7', 'waffleimage/scientificlinux7'] 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', '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'] From f44bc27a177c5cf13cdd01ee59102d01eb1ba374 Mon Sep 17 00:00:00 2001 From: Tim Eilers Date: Fri, 15 Feb 2019 15:00:10 +0100 Subject: [PATCH 044/259] Adding defined type for AdoptOpenJDK installation --- manifests/adopt.pp | 284 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 manifests/adopt.pp diff --git a/manifests/adopt.pp b/manifests/adopt.pp new file mode 100644 index 00000000..84d62c92 --- /dev/null +++ b/manifests/adopt.pp @@ -0,0 +1,284 @@ +# Defined Type java::adopt +# +# Description +# Installs OpenJDK Java built with AdoptOpenJDK with the Hotspot JVM. +# +# Install one or more versions of AdoptOpenJDK Java. +# +# Parameters +# [*version*] +# Version of Java to install, e.g. '7' or '8'. Default values for major and minor +# versions will be used. +# +# [*version_major*] +# Major version which should be installed, e.g. '8u101'. Must be used together with +# version_minor. +# +# [*version_minor*] +# Minor version which should be installed, e.g. 'b12'. Must be used together with +# version_major. +# +# [*java_edition*] +# Type of Java Edition to install, jdk or jre. +# +# [*ensure*] +# Install or remove the package. +# +# [*proxy_server*] +# Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) +# +# [*proxy_type*] +# Proxy server type (none|http|https|ftp). (passed to archive) +# +# Variables +# [*release_major*] +# Major version release number for java_se. Used to construct download URL. +# +# [*release_minor*] +# Minor version release number for java_se. Used to construct download URL. +# +# [*install_path*] +# Base install path for specified version of java_se. Used to determine if java_se +# has already been installed. +# +# [*package_type*] +# Type of installation package for specified version of java_se. java_se 6 comes +# in a few installation package flavors and we need to account for them. +# Optional forced package types: rpm, rpmbin, tar.gz +# +# [*os*] +# Oracle java_se OS type. +# +# [*destination*] +# Destination directory to save java_se installer to. Usually /tmp on Linux and +# C:\TEMP on Windows. +# +# [*creates_path*] +# Fully qualified path to java_se after it is installed. Used to determine if +# java_se is already installed. +# +# [*arch*] +# Oracle java_se architecture type. +# +# [*package_name*] +# Name of the java_se installation package to download from Oracle's website. +# +# [*install_command*] +# Installation command used to install Oracle java_se. Installation commands +# differ by package_type. 'bin' types are installed via shell command. 'rpmbin' +# types have the rpms extracted and then forcibly installed. 'rpm' types are +# forcibly installed. +# +# [*basedir*] +# Directory under which the installation will occur. If not set, defaults to +# /usr/lib/jvm for Debian and /usr/java for RedHat. +# +# [*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. +# +define java::adopt ( + $ensure = 'present', + $version = '8', + $version_major = undef, + $version_minor = undef, + $java = 'jdk', + $proxy_server = undef, + $proxy_type = undef, + $basedir = undef, + $manage_basedir = false, + $package_type = undef, +) { + + # archive module is used to download the java package + include ::archive + + # validate java Standard Edition to download + if $java !~ /(jre|jdk)/ { + fail('java must be either jre or jdk.') + } + + # determine AdoptOpenJDK Java major and minor version, and installation path + if $version_major and $version_minor { + + $label = $version_major + $release_major = $version_major + $release_minor = $version_minor + + $install_path = "${java}${release_major}${release_minor}" + + } else { + # use default versions if no specific major and minor version parameters are provided + $label = $version + case $version { + '8' : { + $release_major = '8u202' + $release_minor = 'b08' + $install_path = "${java}1.8.0_202" + } + '9' : { + $release_major = '9.0.4' + $release_minor = '_11' + $install_path = "${java}9.0.4_11" + } + '10' : { + $release_major = '10.0.2' + $release_minor = '+13' + $install_path = "${java}10.0.2_13" + } + '11' : { + $release_major = '11.0.2' + $release_minor = '_9' + $install_path = "${java}11.0.2_9" + } + default : { + $release_major = '8u202' + $release_minor = 'b08' + $install_path = "${java}1.8.0_192" + } + } + } + + # determine package type (exe/tar/rpm), destination directory based on OS + case $facts['kernel'] { + 'Linux' : { + case $facts['os']['family'] { + 'RedHat', 'Amazon' : { + if $package_type { + $_package_type = $package_type + } else { + $_package_type = 'tar.gz' + } + if $basedir { + $_basedir = $basedir + } else { + $_basedir = '/usr/java' + } + } + 'Debian' : { + if $package_type { + $_package_type = $package_type + } else { + $_package_type = 'tar.gz' + } + if $basedir { + $_basedir = $basedir + } else { + $_basedir = '/usr/lib/jvm' + } + } + default : { + fail ("unsupported platform ${$facts['os']['name']}") } + } + + $creates_path = "${_basedir}/${install_path}" + $os = 'linux' + $destination_dir = '/tmp/' + } + default : { + fail ( "unsupported platform ${$facts['kernel']}" ) } + } + + # set java architecture nomenclature + $os_architecture = $facts['os']['architecture'] ? { + undef => $facts['architecture'], + default => $facts['os']['architecture'] + } + + case $os_architecture { + 'i386' : { $arch = 'x86-32' } + 'x86_64' : { $arch = 'x64' } + 'amd64' : { $arch = 'x64' } + default : { + fail ("unsupported platform ${$os_architecture}") + } + } + + # following are based on this example: + # https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz + # + # or + # + # https://github.com/AdoptOpenJDK/openjdk9-binaries/releases/download/jdk-9.0.4%2B11/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz + # https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.2%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz + # + # package name to download from github + case $_package_type { + 'tar.gz' : { + $package_name = "OpenJDK${version}U-${java}_${arch}_${os}_hotspot_${release_major}${release_minor}.tar.gz" + } + default : { + $package_name = "OpenJDK${version}U-${java}_${arch}_${os}_hotspot_${release_major}${release_minor}.tar.gz" + } + } + + if ( $version == '8' ) { + $spacer = '-' + $release_minor_url = $release_minor + } else { + $spacer = '%2B' + $release_minor_url = $release_minor[1,-1] + } + $source = "https://github.com/AdoptOpenJDK/openjdk${version}-binaries/releases/download/jdk-${release_major}${spacer}${release_minor_url}/${package_name}" + + # full path to the installer + $destination = "${destination_dir}${package_name}" + notice ("Destination is ${destination}") + + case $_package_type { + 'tar.gz' : { + $install_command = "tar -zxf ${destination} -C ${_basedir}" + } + default : { + $install_command = "tar -zxf ${destination} -C ${_basedir}" + } + } + + case $ensure { + 'present' : { + archive { $destination : + ensure => present, + source => $source, + extract_path => '/tmp', + cleanup => false, + creates => $creates_path, + proxy_server => $proxy_server, + proxy_type => $proxy_type, + } + case $facts['kernel'] { + 'Linux' : { + case $facts['os']['family'] { + 'Debian' : { + ensure_resource('file', $_basedir, { + ensure => directory, + }) + $install_requires = [Archive[$destination], File[$_basedir]] + } + default : { + $install_requires = [Archive[$destination]] + } + } + + if $manage_basedir { + ensure_resource('file', $_basedir, {'ensure' => 'directory', 'before' => Exec["Install AdoptOpenJDK java ${java} ${version} ${release_major} ${release_minor}"]}) + } + + exec { "Install AdoptOpenJDK java ${java} ${version} ${release_major} ${release_minor}" : + path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', + command => $install_command, + creates => $creates_path, + require => $install_requires + } + + } + default : { + fail ("unsupported platform ${$facts['kernel']}") + } + } + } + default : { + notice ("Action ${ensure} not supported.") + } + } + +} From 4c336b3ca71fb7956c26660db88a83c067ae0e53 Mon Sep 17 00:00:00 2001 From: Tim Eilers Date: Fri, 15 Feb 2019 16:02:59 +0100 Subject: [PATCH 045/259] Fixing downloadfolder prefix for AdoptOpenJDK installation --- manifests/adopt.pp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 84d62c92..97983b11 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -214,12 +214,14 @@ if ( $version == '8' ) { $spacer = '-' + $download_folder_prefix = 'jdk' $release_minor_url = $release_minor } else { $spacer = '%2B' + $download_folder_prefix = 'jdk-' $release_minor_url = $release_minor[1,-1] } - $source = "https://github.com/AdoptOpenJDK/openjdk${version}-binaries/releases/download/jdk-${release_major}${spacer}${release_minor_url}/${package_name}" + $source = "https://github.com/AdoptOpenJDK/openjdk${version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor_url}/${package_name}" # full path to the installer $destination = "${destination_dir}${package_name}" From a88f01321dbd359ce31ca3cef8d58fcbae890a04 Mon Sep 17 00:00:00 2001 From: Tim Eilers Date: Mon, 18 Feb 2019 20:27:26 +0100 Subject: [PATCH 046/259] Fixing install path for default values for jdk 8 and improving comparison when version was given as integer --- manifests/adopt.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 97983b11..18ced263 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -134,7 +134,7 @@ default : { $release_major = '8u202' $release_minor = 'b08' - $install_path = "${java}1.8.0_192" + $install_path = "${java}1.8.0_202" } } } @@ -212,7 +212,7 @@ } } - if ( $version == '8' ) { + if ( "${version}" == '8' ) { $spacer = '-' $download_folder_prefix = 'jdk' $release_minor_url = $release_minor From c0748f164f5b23645bba9a180af599dd040e028e Mon Sep 17 00:00:00 2001 From: Tim Eilers Date: Tue, 25 Jun 2019 14:59:09 +0200 Subject: [PATCH 047/259] Refactor and improve code with experience from testing. Add spec and acceptance tests for new code. Extend documentation for new AdoptOpenJDK feature. --- README.md | 57 ++++++ manifests/adopt.pp | 183 ++++++++++++----- spec/acceptance/install_spec.rb | 141 +++++++++++++ spec/defines/adopt_spec.rb | 337 ++++++++++++++++++++++++++++++++ 4 files changed, 666 insertions(+), 52 deletions(-) create mode 100644 spec/defines/adopt_spec.rb diff --git a/README.md b/README.md index c3e0ab3d..6a23d2b0 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,56 @@ java::download { 'jdk8' : } ``` +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 +java::adopt { 'jdk8' : + ensure => 'present', + version => '8', + java => 'jdk', +} + +java::adopt { 'jdk11' : + ensure => 'present', + version => '11', + 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 +java::adopt { 'jdk8' : + ensure => 'present', + version_major => '8u202', + version_minor => 'b08', + java => 'jdk', +} +``` + +To install AdoptOpenJDK Java to a non-default basedir (defaults: /usr/lib/jvm for Debian; /usr/java for RedHat): +```puppet +java::adopt { 'jdk8' : + ensure => 'present', + version_major => '8u202', + version_minor => 'b08', + java => 'jdk', + basedir => '/custom/java', +} +``` + +To ensure that a custom basedir is a directory before AdoptOpenJDK Java is installed (note: manage separately for custom ownership or perms): +```puppet +java::adopt { 'jdk8' : + ensure => 'present', + version_major => '8u202', + version_minor => 'b08', + 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. @@ -104,6 +154,13 @@ Oracle Java is supported on: * CentOS 7 * Red Hat Enterprise Linux (RHEL) 7 +AdoptOpenJDK Java is supported on: + +* CentOS +* Red Hat Enterprise Linux (RHEL) +* Amazon Linux +* Debian + ### 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. diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 18ced263..26283b08 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -5,18 +5,20 @@ # # Install one or more versions of AdoptOpenJDK Java. # +# Currently only Linux RedHat, Amazon and Debian are supported. +# # Parameters # [*version*] -# Version of Java to install, e.g. '7' or '8'. Default values for major and minor +# Version of Java to install, e.g. '8' or '9'. Default values for major and minor # versions will be used. # # [*version_major*] -# Major version which should be installed, e.g. '8u101'. Must be used together with +# Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with # version_minor. # # [*version_minor*] -# Minor version which should be installed, e.g. 'b12'. Must be used together with -# version_major. +# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). +# Must be used together with version_major. # # [*java_edition*] # Type of Java Edition to install, jdk or jre. @@ -30,59 +32,92 @@ # [*proxy_type*] # Proxy server type (none|http|https|ftp). (passed to archive) # +# [*basedir*] +# Directory under which the installation will occur. If not set, defaults to +# /usr/lib/jvm for Debian and /usr/java for RedHat. +# +# [*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. +# +# [*package_type*] +# Type of installation package for specified version of java. java 6 comes +# in a few installation package flavors and we need to account for them. +# Optional forced package types: rpm, rpmbin, tar.gz +# # Variables # [*release_major*] -# Major version release number for java_se. Used to construct download URL. +# Major version release number for java. Used to construct download URL. # # [*release_minor*] -# Minor version release number for java_se. Used to construct download URL. +# Minor version release number for java. Used to construct download URL. # # [*install_path*] -# Base install path for specified version of java_se. Used to determine if java_se +# Base install path for specified version of java. Used to determine if java # has already been installed. # -# [*package_type*] -# Type of installation package for specified version of java_se. java_se 6 comes -# in a few installation package flavors and we need to account for them. -# Optional forced package types: rpm, rpmbin, tar.gz -# # [*os*] -# Oracle java_se OS type. +# java OS type. # # [*destination*] -# Destination directory to save java_se installer to. Usually /tmp on Linux and +# Destination directory to save java installer to. Usually /tmp on Linux and # C:\TEMP on Windows. # # [*creates_path*] -# Fully qualified path to java_se after it is installed. Used to determine if -# java_se is already installed. +# Fully qualified path to java after it is installed. Used to determine if +# java is already installed. # # [*arch*] -# Oracle java_se architecture type. +# java architecture type. # # [*package_name*] -# Name of the java_se installation package to download from Oracle's website. +# Name of the java installation package to download from github. # # [*install_command*] -# Installation command used to install Oracle java_se. Installation commands +# Installation command used to install java. Installation commands # differ by package_type. 'bin' types are installed via shell command. 'rpmbin' # types have the rpms extracted and then forcibly installed. 'rpm' types are # forcibly installed. # -# [*basedir*] -# Directory under which the installation will occur. If not set, defaults to -# /usr/lib/jvm for Debian and /usr/java for RedHat. +# [*spacer*] +# Spacer to be used in github download url. In major version 8 this is a simple dash +# in later versions they use a crazy plus sign, which needs to be used in urlencoded +# format # -# [*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. +# [*download_folder_prefix*] +# Download folder name begins differently depending on the release. After major release +# 8, they have given it a dash. Be aware that even if you want to have a JRE, the folder +# still begins with "jdk" +# +# [*release_minor_url*] +# filled depending on major release. Until major release 8 the minor part needs to be given +# with a 'b' for build, in later versions it is a underscore or a plus sign, which needs +# to be stripped for the download url and is replaced with the given spaces (see above) +# +# [*_package_type*] +# Helper variable which gets filled depending on parameter package_type +# +# [*_basedir*] +# Helper variable which gets filled depending on parameter basedir +# +# [*_version*] +# Helper variable which gets filled depending on parameter version +# +# [*_version_int*] +# Helper variable which gets the value of $_version converted to integer +# +# [*_append_jre*] +# Helper variable which gets filled with the string "-jre" if jre was selected to build the correct install path +# +# [*_release_minor_package_name*] +# Helper variable which gets filled with the right minor string depending on the major version # define java::adopt ( $ensure = 'present', $version = '8', $version_major = undef, $version_minor = undef, - $java = 'jdk', + $java = 'jdk', $proxy_server = undef, $proxy_type = undef, $basedir = undef, @@ -101,40 +136,75 @@ # determine AdoptOpenJDK Java major and minor version, and installation path if $version_major and $version_minor { - $label = $version_major $release_major = $version_major $release_minor = $version_minor - $install_path = "${java}${release_major}${release_minor}" + if ( $version_major[0] == '8' or $version_major[0] == '9' ) { + $_version = $version_major[0] + } else { + $_version = $version_major[0,2] + } + + $_version_int = Numeric($_version) + + if ( $java == 'jre' ) { + $_append_jre = '-jre' + } else { + $_append_jre = '' + } + + # extracted folders look like this: + # jdk8u202-b08 + # jdk-9.0.4+11 + # jdk-10.0.2+13 + # jdk-11.0.2+9 + # jdk-12.0.1+12 + # jdk8u202-b08-jre + # jdk-9.0.4+11-jre + # hence we need to check for the major version and build the install path according to it + if ( $_version_int == 8 ) { + $install_path = "jdk${release_major}-${release_minor}${_append_jre}" + } elsif ( $_version_int > 8 ) { + $install_path = "jdk-${release_major}+${release_minor}${_append_jre}" + } else { + fail ("unsupported version ${_version}") + } } else { + $_version = $version # use default versions if no specific major and minor version parameters are provided - $label = $version case $version { '8' : { $release_major = '8u202' $release_minor = 'b08' - $install_path = "${java}1.8.0_202" + $install_path = "${java}8u202-b08" } '9' : { $release_major = '9.0.4' - $release_minor = '_11' - $install_path = "${java}9.0.4_11" + $release_minor = '11' + $install_path = "${java}-9.0.4+11" } + # minor release is given with +, however package etc. works with underscore, so we use underscore here '10' : { $release_major = '10.0.2' - $release_minor = '+13' - $install_path = "${java}10.0.2_13" + $release_minor = '13' + $install_path = "${java}-10.0.2+13" } '11' : { $release_major = '11.0.2' - $release_minor = '_9' - $install_path = "${java}11.0.2_9" + $release_minor = '9' + $install_path = "${java}-11.0.2+9" + } + # minor release is given with +, however package etc. works with underscore, so we use underscore here + '12' : { + $release_major = '12.0.1' + $release_minor = '12' + $install_path = "${java}-12.0.1+12" } default : { $release_major = '8u202' $release_minor = 'b08' - $install_path = "${java}1.8.0_202" + $install_path = "${java}8u202-b08" } } } @@ -194,34 +264,43 @@ } } - # following are based on this example: - # https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz + # package name and path for download from github # - # or + # following are build based on this real life example full URLs: # + # https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u202-b08/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz # https://github.com/AdoptOpenJDK/openjdk9-binaries/releases/download/jdk-9.0.4%2B11/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz + # https://github.com/AdoptOpenJDK/openjdk10-binaries/releases/download/jdk-10.0.2%2B13/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz # https://github.com/AdoptOpenJDK/openjdk11-binaries/releases/download/jdk-11.0.2%2B9/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz - # - # package name to download from github + # https://github.com/AdoptOpenJDK/openjdk12-binaries/releases/download/jdk-12.0.1%2B12/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz + # jre just replaces jdk with jre in the archive name, but not in the path name! + # https://github.com/AdoptOpenJDK/openjdk9-binaries/releases/download/jdk-9.0.4%2B11/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz + + if ( "${_version}" == '8' ) { + $_release_minor_package_name = $release_minor + } else { + $_release_minor_package_name = "_${release_minor}" + } + case $_package_type { - 'tar.gz' : { - $package_name = "OpenJDK${version}U-${java}_${arch}_${os}_hotspot_${release_major}${release_minor}.tar.gz" + 'tar.gz': { + $package_name = "OpenJDK${_version}U-${java}_${arch}_${os}_hotspot_${release_major}${_release_minor_package_name}.tar.gz" } - default : { - $package_name = "OpenJDK${version}U-${java}_${arch}_${os}_hotspot_${release_major}${release_minor}.tar.gz" + default: { + $package_name = "OpenJDK${_version}U-${java}_${arch}_${os}_hotspot_${release_major}${_release_minor_package_name}.tar.gz" } } - if ( "${version}" == '8' ) { + # naming convention changed after major version 8, setting variables to consider that + # download_folder_prefix always begins with "jdk", even for jre! see comments for package_name above + if ( "${_version}" == '8' ) { $spacer = '-' $download_folder_prefix = 'jdk' - $release_minor_url = $release_minor } else { $spacer = '%2B' $download_folder_prefix = 'jdk-' - $release_minor_url = $release_minor[1,-1] } - $source = "https://github.com/AdoptOpenJDK/openjdk${version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor_url}/${package_name}" + $source = "https://github.com/AdoptOpenJDK/openjdk${_version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor}/${package_name}" # full path to the installer $destination = "${destination_dir}${package_name}" @@ -262,10 +341,10 @@ } if $manage_basedir { - ensure_resource('file', $_basedir, {'ensure' => 'directory', 'before' => Exec["Install AdoptOpenJDK java ${java} ${version} ${release_major} ${release_minor}"]}) + ensure_resource('file', $_basedir, {'ensure' => 'directory', 'before' => Exec["Install AdoptOpenJDK java ${java} ${_version} ${release_major} ${release_minor}"]}) } - exec { "Install AdoptOpenJDK java ${java} ${version} ${release_major} ${release_minor}" : + exec { "Install AdoptOpenJDK java ${java} ${_version} ${release_major} ${release_minor}" : path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', command => $install_command, creates => $creates_path, diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 9fddc8cf..95784432 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -42,6 +42,103 @@ '}' context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do +# Oracle installs are disabled by default, because the links to valid oracle installations +# change often. Look the parameters up from the Oracle download URLs at https://java.oracle.com and +# enable the tests: + +oracle_enabled = false +oracle_version_major = '8' +oracle_version_minor = '201' +oracle_version_build = '09' +oracle_hash = '42970487e3af4f5aa5bca3f542482c60' + +install_oracle_jdk_jre = < '#{oracle_version_major}', + version_major => '#{oracle_version_major}u#{oracle_version_minor}', + version_minor => 'b#{oracle_version_build}', + url_hash => '#{oracle_hash}', + java_se => 'jre', + } + java::oracle { + 'test_oracle_jdk': + version => '#{oracle_version_major}', + version_major => '#{oracle_version_major}u#{oracle_version_minor}', + version_minor => 'b#{oracle_version_build}', + url_hash => '#{oracle_hash}', + java_se => 'jdk', + } +EOL + +install_oracle_jre_jce = < '#{oracle_version_major}', + version_major => '#{oracle_version_major}u#{oracle_version_minor}', + version_minor => 'b#{oracle_version_build}', + url_hash => '#{oracle_hash}', + java_se => 'jre', + jce => true, + } + +EOL + +install_oracle_jdk_jce = < '#{oracle_version_major}', + version_major => '#{oracle_version_major}u#{oracle_version_minor}', + version_minor => 'b#{oracle_version_build}', + url_hash => '#{oracle_hash}', + java_se => 'jdk', + jce => true, + } +EOL + +# AdoptOpenJDK URLs are quite generic, so tests are enabled by default +# We need to test version 8 and >8 (here we use 9), because namings are different after version 8 + +adopt_enabled = true +adopt_version8_major = '8' +adopt_version8_minor = '202' +adopt_version8_build = '08' +adopt_version9_major = '9' +adopt_version9_full = '9.0.4' +adopt_version9_build = '11' + +install_adopt_jdk_jre = < '#{adopt_version8_major}', + version_major => '#{adopt_version8_major}u#{adopt_version8_minor}', + version_minor => 'b#{adopt_version8_build}', + java => 'jre', + } + java::adopt { + 'test_adopt_jdk_version8': + version => '#{adopt_version8_major}', + version_major => '#{adopt_version8_major}u#{adopt_version8_minor}', + version_minor => 'b#{adopt_version8_build}', + java => 'jdk', + } + java::adopt { + 'test_adopt_jre_version9': + version => '#{adopt_version9_major}', + version_major => '#{adopt_version9_full}', + version_minor => '#{adopt_version9_build}', + java => 'jre', + } + java::adopt { + 'test_adopt_jdk_version9': + version => '#{adopt_version9_major}', + version_major => '#{adopt_version9_full}', + version_minor => '#{adopt_version9_build}', + java => 'jdk', + } +EOL + +context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do it 'installs jre' do idempotent_apply(java_class_jre) end @@ -78,3 +175,47 @@ end end end + +context 'java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do + let(:install_path) do + (fact('osfamily') == 'RedHat') ? '/usr/java' : '/usr/lib/jvm' + end + + let(:version_suffix) do + (fact('osfamily') == 'RedHat') ? '-amd64' : '' + end + + it 'installs oracle jdk and jre' do + idempotent_apply(default, install_oracle_jdk_jre) + jdk_result = shell("test ! -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") + jre_result = shell("test ! -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") + expect(jdk_result.exit_code).to eq(0) + expect(jre_result.exit_code).to eq(0) + end + + it 'installs oracle jdk with jce' do + idempotent_apply(default, install_oracle_jdk_jce) + result = shell("test -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") + expect(result.exit_code).to eq(0) + end + + it 'installs oracle jre with jce' do + idempotent_apply(default, install_oracle_jre_jce) + result = shell("test -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") + expect(result.exit_code).to eq(0) + end +end + +context 'java::adopt', if: adopt_enabled, unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do + let(:install_path) do + (fact('osfamily') == 'RedHat') ? '/usr/java' : '/usr/lib/jvm' + end + + let(:version_suffix) do + (fact('osfamily') == 'RedHat') ? '-amd64' : '' + end + + it 'installs adopt jdk and jre' do + idempotent_apply(default, install_adopt_jdk_jre) + end +end diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb new file mode 100644 index 00000000..900d9d1d --- /dev/null +++ b/spec/defines/adopt_spec.rb @@ -0,0 +1,337 @@ +require 'spec_helper' + +describe 'java::adopt', 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 AdoptOpenJDK Java 8 JDK' do + let(:params) { { ensure: 'present', version: '8', java: 'jdk' } } + let(:title) { 'jdk8' } + + it { is_expected.to contain_archive('/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 9 JDK' do + let(:params) { { ensure: 'present', version: '9', java: 'jdk' } } + let(:title) { 'jdk9' } + + it { is_expected.to contain_archive('/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').with_command('tar -zxf /tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').that_requires('Archive[/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 10 JDK' do + let(:params) { { ensure: 'present', version: '10', java: 'jdk' } } + let(:title) { 'jdk10' } + + it { is_expected.to contain_archive('/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').with_command('tar -zxf /tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').that_requires('Archive[/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 11 JDK' do + let(:params) { { ensure: 'present', version: '11', java: 'jdk' } } + let(:title) { 'jdk11' } + + it { is_expected.to contain_archive('/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').with_command('tar -zxf /tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').that_requires('Archive[/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 12 JDK' do + let(:params) { { ensure: 'present', version: '12', java: 'jdk' } } + let(:title) { 'jdk12' } + + it { is_expected.to contain_archive('/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').with_command('tar -zxf /tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz]') } + end + + + context 'when AdoptOpenJDK Java 8 JRE' do + let(:params) { { ensure: 'present', version: '8', java: 'jre' } } + let(:title) { 'jre8' } + + it { is_expected.to contain_archive('/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 9 JRE' do + let(:params) { { ensure: 'present', version: '9', java: 'jre' } } + let(:title) { 'jre9' } + + it { is_expected.to contain_archive('/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').with_command('tar -zxf /tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').that_requires('Archive[/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 10 JRE' do + let(:params) { { ensure: 'present', version: '10', java: 'jre' } } + let(:title) { 'jre11' } + + it { is_expected.to contain_archive('/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').with_command('tar -zxf /tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').that_requires('Archive[/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 11 JRE' do + let(:params) { { ensure: 'present', version: '11', java: 'jre' } } + let(:title) { 'jre11' } + + it { is_expected.to contain_archive('/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').with_command('tar -zxf /tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').that_requires('Archive[/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 12 JRE' do + let(:params) { { ensure: 'present', version: '12', java: 'jre' } } + let(:title) { 'jre12' } + + it { is_expected.to contain_archive('/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').with_command('tar -zxf /tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz]') } + end + + context 'when installing multiple versions' do + let(:params) do + { + ensure: 'present', + version_major: '8u202', + version_minor: 'b08', + java: 'jdk', + } + end + let(:title) { 'jdk8' } + + let(:pre_condition) do + <<-EOL + java::adopt { + 'jdk8172': + ensure => 'present', + version_major => '8u172', + version_minor => 'b11', + java => 'jdk', + } + EOL + end + + it { is_expected.to compile } + end + + context 'when specifying package_type tar.gz and basedir' do + let(:params) do + { + ensure: 'present', + version: '8', + java: 'jdk', + basedir: '/usr/java', + package_type: 'tar.gz', + } + end + let(:title) { 'jdk8' } + + it { is_expected.to contain_archive('/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz]') } + 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 AdoptOpenJDK Java 8 JDK' do + let(:params) { { ensure: 'present', version: '8', java: 'jdk' } } + let(:title) { 'jdk8' } + + it { is_expected.to contain_archive('/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 9 JDK' do + let(:params) { { ensure: 'present', version: '9', java: 'jdk' } } + let(:title) { 'jdk9' } + + it { is_expected.to contain_archive('/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').with_command('tar -zxf /tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').that_requires('Archive[/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 10 JDK' do + let(:params) { { ensure: 'present', version: '10', java: 'jdk' } } + let(:title) { 'jdk10' } + + it { is_expected.to contain_archive('/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').with_command('tar -zxf /tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').that_requires('Archive[/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 11 JDK' do + let(:params) { { ensure: 'present', version: '11', java: 'jdk' } } + let(:title) { 'jdk11' } + + it { is_expected.to contain_archive('/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').with_command('tar -zxf /tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').that_requires('Archive[/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 12 JDK' do + let(:params) { { ensure: 'present', version: '12', java: 'jdk' } } + let(:title) { 'jdk12' } + + it { is_expected.to contain_archive('/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').with_command('tar -zxf /tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 8 JRE' do + let(:params) { { ensure: 'present', version: '8', java: 'jre' } } + let(:title) { 'jre8' } + + it { is_expected.to contain_archive('/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 9 JRE' do + let(:params) { { ensure: 'present', version: '9', java: 'jre' } } + let(:title) { 'jre9' } + + it { is_expected.to contain_archive('/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').with_command('tar -zxf /tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').that_requires('Archive[/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 10 JRE' do + let(:params) { { ensure: 'present', version: '10', java: 'jre' } } + let(:title) { 'jre11' } + + it { is_expected.to contain_archive('/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').with_command('tar -zxf /tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').that_requires('Archive[/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 11 JRE' do + let(:params) { { ensure: 'present', version: '11', java: 'jre' } } + let(:title) { 'jre11' } + + it { is_expected.to contain_archive('/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').with_command('tar -zxf /tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').that_requires('Archive[/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz]') } + end + + context 'when AdoptOpenJDK Java 12 JRE' do + let(:params) { { ensure: 'present', version: '12', java: 'jre' } } + let(:title) { 'jre12' } + + it { is_expected.to contain_archive('/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').with_command('tar -zxf /tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz]') } + end + + context 'when installing multiple versions' do + let(:params) do + { + ensure: 'present', + version_major: '8u202', + version_minor: 'b08', + java: 'jdk', + } + end + let(:title) { 'jdk8' } + + let(:pre_condition) do + <<-EOL + java::adopt { + 'jdk8172': + ensure => 'present', + version_major => '8u172', + version_minor => 'b11', + 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 From da548082fe0bd57cc1b2dae8326ec299a39a94de Mon Sep 17 00:00:00 2001 From: Tim Eilers Date: Tue, 25 Jun 2019 15:25:11 +0200 Subject: [PATCH 048/259] Clean up code according to rubocop checks --- manifests/adopt.pp | 5 +++-- spec/defines/adopt_spec.rb | 10 ++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 26283b08..0d29f957 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -172,6 +172,7 @@ } else { $_version = $version + $_version_int = Numeric($_version) # use default versions if no specific major and minor version parameters are provided case $version { '8' : { @@ -276,7 +277,7 @@ # jre just replaces jdk with jre in the archive name, but not in the path name! # https://github.com/AdoptOpenJDK/openjdk9-binaries/releases/download/jdk-9.0.4%2B11/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz - if ( "${_version}" == '8' ) { + if ( $_version_int == 8 ) { $_release_minor_package_name = $release_minor } else { $_release_minor_package_name = "_${release_minor}" @@ -293,7 +294,7 @@ # naming convention changed after major version 8, setting variables to consider that # download_folder_prefix always begins with "jdk", even for jre! see comments for package_name above - if ( "${_version}" == '8' ) { + if ( $_version_int == 8 ) { $spacer = '-' $download_folder_prefix = 'jdk' } else { diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index 900d9d1d..4cb01d30 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -49,7 +49,6 @@ it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz]') } end - context 'when AdoptOpenJDK Java 8 JRE' do let(:params) { { ensure: 'present', version: '8', java: 'jre' } } let(:title) { 'jre8' } @@ -249,10 +248,10 @@ context 'when installing multiple versions' do let(:params) do { - ensure: 'present', - version_major: '8u202', - version_minor: 'b08', - java: 'jdk', + ensure: 'present', + version_major: '8u202', + version_minor: 'b08', + java: 'jdk', } end let(:title) { 'jdk8' } @@ -271,7 +270,6 @@ it { is_expected.to compile } end - end describe 'incompatible OSes' do [ From 4dbf9321ebf5faf77dad79e8baf253ce61a9898d Mon Sep 17 00:00:00 2001 From: Tim Eilers Date: Tue, 25 Jun 2019 17:03:07 +0200 Subject: [PATCH 049/259] Fix basedir management (correctly avoid duplicate resource declarations) --- manifests/adopt.pp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 0d29f957..5931ecce 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -121,7 +121,7 @@ $proxy_server = undef, $proxy_type = undef, $basedir = undef, - $manage_basedir = false, + $manage_basedir = true, $package_type = undef, ) { @@ -342,7 +342,12 @@ } if $manage_basedir { - ensure_resource('file', $_basedir, {'ensure' => 'directory', 'before' => Exec["Install AdoptOpenJDK java ${java} ${_version} ${release_major} ${release_minor}"]}) + if (!defined(File[$_basedir])) { + file { $_basedir: + ensure => 'directory', + before => Exec["Install AdoptOpenJDK java ${java} ${_version} ${release_major} ${release_minor}"], + } + } } exec { "Install AdoptOpenJDK java ${java} ${_version} ${release_major} ${release_minor}" : From 4f52cee832d83d14c3ef49a65e82d21659afe623 Mon Sep 17 00:00:00 2001 From: Tim Eilers Date: Wed, 17 Jul 2019 13:49:37 +0200 Subject: [PATCH 050/259] Fixing java_version fact, because OpenJDK puts a date after version --- lib/facter/java_version.rb | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index c5b92d8f..6de4bb45 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -4,7 +4,7 @@ # # Resolution: # Tests for presence of java, returns nil if not present -# returns output of "java -version" and splits on \n + '"' +# returns output of "java -version" and splits on '"' # # Caveats: # none @@ -24,8 +24,7 @@ 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 = Regexp.last_match(1) if %r{^.+ version \"(.+)\"} =~ line } end version end @@ -38,7 +37,7 @@ setcode do unless %r{Unable to find any JVMs matching version} =~ Facter::Util::Resolution.exec('/usr/libexec/java_home --failfast 2>&1') version = nil - 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 = Regexp.last_match(1) if %r{^.+ version \"(.+)\"} =~ line } version end end From 61ace5ea012d1c52b2e1e4451408e9a938f61b65 Mon Sep 17 00:00:00 2001 From: Tim Eilers Date: Wed, 17 Jul 2019 15:14:20 +0200 Subject: [PATCH 051/259] Fixing several facts due to different version scheme and locations in specific java versions --- lib/facter/java_libjvm_path.rb | 25 ++++++++++++++++++------- lib/facter/java_major_version.rb | 12 +++++------- lib/facter/java_patch_level.rb | 14 ++++++-------- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/lib/facter/java_libjvm_path.rb b/lib/facter/java_libjvm_path.rb index 95ae61ae..1cd51a8e 100644 --- a/lib/facter/java_libjvm_path.rb +++ b/lib/facter/java_libjvm_path.rb @@ -7,6 +7,7 @@ # # Caveats: # Needs to list files recursively. Returns the first match +# Needs working java_major_version fact # # Notes: # None @@ -14,13 +15,23 @@ confine kernel: ['Linux', 'OpenBSD'] setcode do java_default_home = Facter.value(:java_default_home) - 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 - File.dirname(java_libjvm_file[0]) + java_major_version = Facter.value(:java_major_version) + unless java_major_version.nil? + if java_major_version.to_i >= 11 + java_libjvm_file = Dir.glob("#{java_default_home}/lib/**/libjvm.so") + if java_libjvm_file.nil? || java_libjvm_file.empty? + nil + else + File.dirname(java_libjvm_file[0]) + end + else + java_libjvm_file = Dir.glob("#{java_default_home}/jre/lib/**/libjvm.so") + if java_libjvm_file.nil? || java_libjvm_file.empty? + nil + else + File.dirname(java_libjvm_file[0]) + end + end end end end diff --git a/lib/facter/java_major_version.rb b/lib/facter/java_major_version.rb index 3c3c99f1..123c70a5 100644 --- a/lib/facter/java_major_version.rb +++ b/lib/facter/java_major_version.rb @@ -17,13 +17,11 @@ setcode do java_version = Facter.value(:java_version) 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 + if java_version.strip[0..1] == '1.' + java_major_version = java_version.strip.split('_')[0].split('.')[1] + else + java_major_version = java_version.strip.split('.')[0] + end end end java_major_version diff --git a/lib/facter/java_patch_level.rb b/lib/facter/java_patch_level.rb index d3acded7..2722d0b0 100644 --- a/lib/facter/java_patch_level.rb +++ b/lib/facter/java_patch_level.rb @@ -3,7 +3,7 @@ # Purpose: get Java's patch level # # Resolution: -# Uses java_version fact splits on the patch number (after _) +# Uses java_version fact splits on the patch number (after _ for 1.x and patch number for semver'ed javas) # # Caveats: # none @@ -15,13 +15,11 @@ setcode do java_version = Facter.value(:java_version) 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 + if java_version.strip[0..1] == '1.' + java_patch_level = java_version.strip.split('_')[1] unless java_version.nil? + else + java_patch_level = java_version.strip.split('.')[2] unless java_version.nil? + end end end java_patch_level From 84546ca9a74d618f38215160152970c7594ee57c Mon Sep 17 00:00:00 2001 From: lionce Date: Tue, 14 Jan 2020 15:38:31 +0200 Subject: [PATCH 052/259] Rebase with master, fix conflicts and rubocop issues --- lib/facter/java_libjvm_path.rb | 21 ++++++++------------- lib/facter/java_major_version.rb | 10 +++++----- spec/acceptance/install_spec.rb | 24 ++++++++++++------------ 3 files changed, 25 insertions(+), 30 deletions(-) diff --git a/lib/facter/java_libjvm_path.rb b/lib/facter/java_libjvm_path.rb index 1cd51a8e..7ae549f0 100644 --- a/lib/facter/java_libjvm_path.rb +++ b/lib/facter/java_libjvm_path.rb @@ -17,20 +17,15 @@ java_default_home = Facter.value(:java_default_home) java_major_version = Facter.value(:java_major_version) unless java_major_version.nil? - if java_major_version.to_i >= 11 - java_libjvm_file = Dir.glob("#{java_default_home}/lib/**/libjvm.so") - if java_libjvm_file.nil? || java_libjvm_file.empty? - nil - else - File.dirname(java_libjvm_file[0]) - end + java_libjvm_file = if java_major_version.to_i >= 11 + Dir.glob("#{java_default_home}/lib/**/libjvm.so") + else + Dir.glob("#{java_default_home}/jre/lib/**/libjvm.so") + end + if java_libjvm_file.nil? || java_libjvm_file.empty? + nil else - java_libjvm_file = Dir.glob("#{java_default_home}/jre/lib/**/libjvm.so") - if java_libjvm_file.nil? || java_libjvm_file.empty? - nil - else - File.dirname(java_libjvm_file[0]) - end + File.dirname(java_libjvm_file[0]) end end end diff --git a/lib/facter/java_major_version.rb b/lib/facter/java_major_version.rb index 123c70a5..3afd9949 100644 --- a/lib/facter/java_major_version.rb +++ b/lib/facter/java_major_version.rb @@ -17,11 +17,11 @@ setcode do java_version = Facter.value(:java_version) unless java_version.nil? - if java_version.strip[0..1] == '1.' - java_major_version = java_version.strip.split('_')[0].split('.')[1] - else - java_major_version = java_version.strip.split('.')[0] - end + java_major_version = if java_version.strip[0..1] == '1.' + java_version.strip.split('_')[0].split('.')[1] + else + java_version.strip.split('.')[0] + end end end java_major_version diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 95784432..2ea2885a 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -1,4 +1,5 @@ require 'spec_helper_acceptance' +require 'pry' java_class_jre = "class { 'java':\n"\ " distribution => 'jre',\n"\ @@ -41,7 +42,6 @@ " java_alternative_path => '/whatever',\n"\ '}' -context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do # Oracle installs are disabled by default, because the links to valid oracle installations # change often. Look the parameters up from the Oracle download URLs at https://java.oracle.com and # enable the tests: @@ -138,7 +138,7 @@ } EOL -context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do +context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do it 'installs jre' do idempotent_apply(java_class_jre) end @@ -176,17 +176,17 @@ end end -context 'java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do +context 'java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do let(:install_path) do - (fact('osfamily') == 'RedHat') ? '/usr/java' : '/usr/lib/jvm' + (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' end let(:version_suffix) do - (fact('osfamily') == 'RedHat') ? '-amd64' : '' + (os[:family] == 'redhat') ? '-amd64' : '' end it 'installs oracle jdk and jre' do - idempotent_apply(default, install_oracle_jdk_jre) + idempotent_apply(install_oracle_jdk_jre) jdk_result = shell("test ! -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") jre_result = shell("test ! -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") expect(jdk_result.exit_code).to eq(0) @@ -194,28 +194,28 @@ end it 'installs oracle jdk with jce' do - idempotent_apply(default, install_oracle_jdk_jce) + idempotent_apply(install_oracle_jdk_jce) result = shell("test -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") expect(result.exit_code).to eq(0) end it 'installs oracle jre with jce' do - idempotent_apply(default, install_oracle_jre_jce) + idempotent_apply(install_oracle_jre_jce) result = shell("test -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") expect(result.exit_code).to eq(0) end end -context 'java::adopt', if: adopt_enabled, unless: UNSUPPORTED_PLATFORMS.include?(fact('osfamily')) do +context 'java::adopt', if: adopt_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do let(:install_path) do - (fact('osfamily') == 'RedHat') ? '/usr/java' : '/usr/lib/jvm' + (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' end let(:version_suffix) do - (fact('osfamily') == 'RedHat') ? '-amd64' : '' + (os[:family] == 'redhat') ? '-amd64' : '' end it 'installs adopt jdk and jre' do - idempotent_apply(default, install_adopt_jdk_jre) + idempotent_apply(install_adopt_jdk_jre) end end From 93cc9727688460cadfd76c4bcc6cf62ff8bf1e1e Mon Sep 17 00:00:00 2001 From: Hubert de Heer Date: Mon, 3 Feb 2020 13:24:27 +0100 Subject: [PATCH 053/259] Replace legacy facts by modern facts Fix minor puppet-lint issues. --- examples/alternative.pp | 2 +- manifests/config.pp | 4 +- manifests/download.pp | 10 ++-- manifests/init.pp | 4 +- manifests/params.pp | 48 ++++++++--------- spec/classes/java_spec.rb | 106 +++++++++++++++++++++----------------- 6 files changed, 92 insertions(+), 82 deletions(-) diff --git a/examples/alternative.pp b/examples/alternative.pp index f361db6c..0d0dee87 100644 --- a/examples/alternative.pp +++ b/examples/alternative.pp @@ -1,5 +1,5 @@ class { 'java': package => 'jdk-8u25-linux-x64', java_alternative => 'jdk1.8.0_25', - java_alternative_path => '/usr/java/jdk1.8.0_25/jre/bin/java' + java_alternative_path => '/usr/java/jdk1.8.0_25/jre/bin/java', } diff --git a/manifests/config.pp b/manifests/config.pp index 7f965f37..fd67fea3 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -1,6 +1,6 @@ # @api private class java::config ( ) { - case $::osfamily { + case $facts['os']['family'] { 'Debian': { if $java::use_java_alternative != undef and $java::use_java_alternative_path != undef { exec { 'update-java-alternatives': @@ -26,7 +26,7 @@ path => '/usr/bin:/usr/sbin:/bin:/sbin', command => "alternatives --install /usr/bin/java java ${$java::use_java_alternative_path} 20000" , unless => "alternatives --display java | grep -q ${$java::use_java_alternative_path}", - before => Exec['update-java-alternatives'] + before => Exec['update-java-alternatives'], } } diff --git a/manifests/download.pp b/manifests/download.pp index 2a33dbea..9e8f7a8f 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -72,7 +72,7 @@ ) { # archive module is used to download the java package - include ::archive + include archive # validate java Standard Edition to download if $java_se !~ /(jre|jdk)/ { @@ -183,7 +183,7 @@ # set java architecture nomenclature $os_architecture = $facts['os']['architecture'] ? { - undef => $facts['architecture'], + undef => $facts['os']['architecture'], default => $facts['os']['architecture'] } @@ -284,14 +284,14 @@ path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', command => $install_command, creates => $creates_path, - require => $install_requires + require => $install_requires, } if ($manage_symlink and $symlink_name) { file { "${_basedir}/${symlink_name}": ensure => link, target => $creates_path, - require => Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"] + require => Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"], } } @@ -312,7 +312,7 @@ require => [ Package['unzip'], Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"] - ] + ], } } } diff --git a/manifests/init.pp b/manifests/init.pp index f93f1d73..e17bc004 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -101,7 +101,7 @@ $use_java_package_name == undef or $use_java_alternative == undef or $use_java_alternative_path == undef or $use_java_home == undef ) and ( - ! has_key($::java::params::java, $distribution) + ! has_key($java::params::java, $distribution) )) { fail("Java distribution ${distribution} is not supported. Missing default values.") } @@ -111,7 +111,7 @@ default => '--jre' } - if $::osfamily == 'Debian' { + if $facts['os']['family'] == 'Debian' { # Needed for update-java-alternatives package { 'java-common': ensure => present, diff --git a/manifests/params.pp b/manifests/params.pp index ddf97f4c..697b8284 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -6,23 +6,23 @@ # @api private class java::params { - case $::osfamily { + case $facts['os']['family'] { 'RedHat': { - case $::operatingsystem { + case $facts['os']['name'] { 'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL', 'SLC', 'CloudLinux': { - if (versioncmp($::operatingsystemrelease, '5.0') < 0) { + if (versioncmp($facts['os']['release']['full'], '5.0') < 0) { $jdk_package = 'java-1.6.0-sun-devel' $jre_package = 'java-1.6.0-sun' $java_home = '/usr/lib/jvm/java-1.6.0-sun/jre/' } # See cde7046 for why >= 5.0 < 6.3 - elsif (versioncmp($::operatingsystemrelease, '6.3') < 0) { + elsif (versioncmp($facts['os']['release']['full'], '6.3') < 0) { $jdk_package = 'java-1.6.0-openjdk-devel' $jre_package = 'java-1.6.0-openjdk' $java_home = '/usr/lib/jvm/java-1.6.0/' } # See PR#160 / c8e46b5 for why >= 6.3 < 7.1 - elsif (versioncmp($::operatingsystemrelease, '7.1') < 0) { + elsif (versioncmp($facts['os']['release']['full'], '7.1') < 0) { $jdk_package = 'java-1.7.0-openjdk-devel' $jre_package = 'java-1.7.0-openjdk' $java_home = '/usr/lib/jvm/java-1.7.0/' @@ -34,23 +34,23 @@ } } 'Fedora': { - if (versioncmp($::operatingsystemrelease, '21') < 0) { + if (versioncmp($facts['os']['release']['full'], '21') < 0) { $jdk_package = 'java-1.7.0-openjdk-devel' $jre_package = 'java-1.7.0-openjdk' - $java_home = "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/" + $java_home = "/usr/lib/jvm/java-1.7.0-openjdk-${facts['os']['architecture']}/" } else { $jdk_package = 'java-1.8.0-openjdk-devel' $jre_package = 'java-1.8.0-openjdk' - $java_home = "/usr/lib/jvm/java-1.8.0-openjdk-${::architecture}/" + $java_home = "/usr/lib/jvm/java-1.8.0-openjdk-${facts['os']['architecture']}/" } } 'Amazon': { $jdk_package = 'java-1.7.0-openjdk-devel' $jre_package = 'java-1.7.0-openjdk' - $java_home = "/usr/lib/jvm/java-1.7.0-openjdk-${::architecture}/" + $java_home = "/usr/lib/jvm/java-1.7.0-openjdk-${facts['os']['architecture']}/" } - default: { fail("unsupported os ${::operatingsystem}") } + default: { fail("unsupported os ${facts['os']['name']}") } } $java = { 'jdk' => { @@ -64,16 +64,16 @@ } } 'Debian': { - $oracle_architecture = $::architecture ? { + $oracle_architecture = $facts['os']['architecture'] ? { 'amd64' => 'x64', - default => $::architecture + default => $facts['os']['architecture'] } - $openjdk_architecture = $::architecture ? { + $openjdk_architecture = $facts['os']['architecture'] ? { 'aarch64' => 'arm64', 'armv7l' => 'armhf', - default => $::architecture + default => $facts['os']['architecture'] } - case $::operatingsystemmajrelease { + case $facts['os']['release']['major'] { '7', '8', '14.04': { $java = { 'jdk' => { @@ -84,7 +84,7 @@ }, 'jre' => { 'package' => 'openjdk-7-jre-headless', - 'alternative' => "java-1.7.0-openjdk-${::architecture}", + 'alternative' => "java-1.7.0-openjdk-${facts['os']['architecture']}", 'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/bin/java", 'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/", }, @@ -139,7 +139,7 @@ 'alternative' => "java-1.8.0-openjdk-${openjdk_architecture}", 'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/bin/java", 'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/", - } + }, } } '10', '18.04', '18.10', '19.04', '19.10': { @@ -155,10 +155,10 @@ 'alternative' => "java-1.11.0-openjdk-${openjdk_architecture}", 'alternative_path' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/bin/java", 'java_home' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/", - } + }, } } - default: { fail("unsupported release ${::operatingsystemmajrelease}") } + default: { fail("unsupported release ${facts['os']['release']['major']}") } } } 'OpenBSD': { @@ -198,17 +198,17 @@ } } 'Suse': { - case $::operatingsystem { + case $facts['os']['name'] { 'SLES': { - if (versioncmp($::operatingsystemrelease, '12.1') >= 0) { + if (versioncmp($facts['os']['release']['full'], '12.1') >= 0) { $jdk_package = 'java-1_8_0-openjdk-devel' $jre_package = 'java-1_8_0-openjdk' $java_home = '/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/' - } elsif (versioncmp($::operatingsystemrelease, '12') >= 0) { + } elsif (versioncmp($facts['os']['release']['full'], '12') >= 0) { $jdk_package = 'java-1_7_0-openjdk-devel' $jre_package = 'java-1_7_0-openjdk' $java_home = '/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/' - } elsif (versioncmp($::operatingsystemrelease, '11.4') >= 0) { + } elsif (versioncmp($facts['os']['release']['full'], '11.4') >= 0) { $jdk_package = 'java-1_7_1-ibm-devel' $jre_package = 'java-1_7_1-ibm' $java_home = '/usr/lib64/jvm/java-1.7.1-ibm-1.7.1/' @@ -255,6 +255,6 @@ }, } } - default: { fail("unsupported platform ${::osfamily}") } + default: { fail("unsupported platform ${facts['os']['family']}") } } } diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 170e4e66..0480ea6d 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -1,36 +1,36 @@ require 'spec_helper' describe 'java', type: :class do - context 'when select openjdk for Centos 5.8' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Centos', operatingsystemrelease: '5.8', architecture: 'x86_64' } } + context 'when select openjdk for CentOS 5.8' do + let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.8' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.6.0/') } end - context 'when select openjdk for Centos 6.3' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Centos', operatingsystemrelease: '6.3', architecture: 'x86_64' } } + context 'when select openjdk for CentOS 6.3' do + let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.7.0/') } end - context 'when select openjdk for Centos 7.1.1503' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Centos', operatingsystemrelease: '7.1.1503', architecture: 'x86_64' } } + context 'when select openjdk for CentOS 7.1.1503' do + let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '7.1.1503' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.8.0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0/') } end - context 'when select openjdk for Centos 6.2' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Centos', operatingsystemrelease: '6.2', architecture: 'x86_64' } } + context 'when select openjdk for CentOS 6.2' do + let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.2' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } it { is_expected.not_to contain_exec('update-java-alternatives') } end - context 'when select Oracle JRE with alternatives for Centos 6.3' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Centos', operatingsystemrelease: '6.3', architecture: 'x86_64' } } + context 'when select Oracle JRE with alternatives for CentOS 6.3' do + let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java/jre1.7.0_67/bin/java' } } it { is_expected.to contain_package('java').with_name('jre') } @@ -38,23 +38,23 @@ it { is_expected.to contain_exec('update-java-alternatives').with_command('alternatives --set java /usr/java/jre1.7.0_67/bin/java') } end - context 'when select passed value for Centos 5.3' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Centos', operatingsystemrelease: '5.3', architecture: 'x86_64' } } + context 'when select passed value for CentOS 5.3' do + let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.3' }, architecture: 'x86_64' } } } let(:params) { { 'package' => 'jdk', 'java_home' => '/usr/local/lib/jre' } } it { is_expected.to contain_package('java').with_name('jdk') } it { is_expected.not_to contain_exec('update-java-alternatives') } end - context 'when select default for Centos 5.3' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Centos', operatingsystemrelease: '5.3', architecture: 'x86_64' } } + context 'when select default for CentOS 5.3' do + let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } 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(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '10' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jdk' } } it { is_expected.to contain_package('java').with_name('openjdk-11-jdk') } @@ -62,7 +62,7 @@ end context 'when select jre for Debian Buster (10.0)' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Debian', lsbdistcodename: 'buster', operatingsystemmajrelease: '10', architecture: 'amd64' } } + let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '10' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('openjdk-11-jre-headless') } @@ -70,7 +70,7 @@ 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(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'trusty' }, release: { major: '14.04' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jdk' } } it { is_expected.to contain_package('java').with_name('openjdk-7-jdk') } @@ -78,7 +78,7 @@ end context 'when select jre for Ubuntu Trusty (14.04)' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'trusty', operatingsystemmajrelease: '14.04', architecture: 'amd64' } } + let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'trusty' }, release: { major: '14.04' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('openjdk-7-jre-headless') } @@ -86,7 +86,7 @@ end context 'when select jdk for Ubuntu xenial (16.04) on ARM' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'xenial', operatingsystemmajrelease: '16.04', architecture: 'armv7l' } } + let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'xenial' }, release: { major: '16.04' }, architecture: 'armv7l' } } } let(:params) { { 'distribution' => 'jdk' } } it { is_expected.to contain_package('java').with_name('openjdk-8-jdk') } @@ -94,7 +94,7 @@ end context 'when select jdk for Ubuntu xenial (16.04) on ARM64' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Ubuntu', lsbdistcodename: 'xenial', operatingsystemmajrelease: '16.04', architecture: 'aarch64' } } + let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'xenial' }, release: { major: '16.04' }, architecture: 'aarch64' } } } let(:params) { { 'distribution' => 'jdk' } } it { is_expected.to contain_package('java').with_name('openjdk-8-jdk') } @@ -102,26 +102,26 @@ end context 'when select openjdk for Oracle Linux' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'OracleLinux', operatingsystemrelease: '6.4', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.4' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } end context 'when select openjdk for Oracle Linux 6.2' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'OracleLinux', operatingsystemrelease: '6.2', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.2' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } end context 'when select passed value for Oracle Linux' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'OracleLinux', operatingsystemrelease: '6.3', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.3' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } end context 'when select passed value for Scientific Linux' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'Scientific', operatingsystemrelease: '6.4', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'RedHat', name: 'Scientific', release: { full: '6.4' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } @@ -129,7 +129,7 @@ end context 'when select passed value for Scientific Linux CERN (SLC)' do - let(:facts) { { osfamily: 'RedHat', operatingsystem: 'SLC', operatingsystemrelease: '6.4', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'RedHat', name: 'SLC', release: { full: '6.4' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } @@ -137,47 +137,47 @@ end context 'when select default for OpenSUSE 12.3' do - let(:facts) { { osfamily: 'Suse', operatingsystem: 'OpenSUSE', operatingsystemrelease: '12.3', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'Suse', name: 'OpenSUSE', release: { major: '12.3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/') } end context 'when select default for SLES 11.3' do - let(:facts) { { osfamily: 'Suse', operatingsystem: 'SLES', operatingsystemrelease: '11.3', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_6_0-ibm-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.6.0-ibm-1.6.0/') } end context 'when select default for SLES 11.4' do - let(:facts) { { osfamily: 'Suse', operatingsystem: 'SLES', operatingsystemrelease: '11.4', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.4' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_1-ibm-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.1-ibm-1.7.1/') } end context 'when select default for SLES 12.0' do - let(:facts) { { osfamily: 'Suse', operatingsystem: 'SLES', operatingsystemrelease: '12.0', operatingsystemmajrelease: '12', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '12.0', major: '12' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/') } end context 'when select default for SLES 12.1' do - let(:facts) { { osfamily: 'Suse', operatingsystem: 'SLES', operatingsystemrelease: '12.1', operatingsystemmajrelease: '12', architecture: 'x86_64' } } + let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '12.1', major: '12' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_8_0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0/') } end describe 'custom java package' do - let(:facts) { { osfamily: 'Debian', operatingsystem: 'Debian', lsbdistcodename: 'jessie', operatingsystemmajrelease: '8', architecture: 'amd64' } } + let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'jessie' }, release: { major: '8' }, architecture: 'amd64' } } } context 'when all params provided' do let(:params) do { - 'distribution' => 'custom', + 'distribution' => 'custom', 'package' => 'custom_jdk', 'java_alternative' => 'java-custom_jdk', 'java_alternative_path' => '/opt/custom_jdk/bin/java', @@ -206,34 +206,44 @@ describe 'incompatible OSs' do [ { - osfamily: 'windows', - operatingsystem: 'windows', - operatingsystemrelease: '8.1', + os: { + family: 'windows', + name: 'windows', + release: { full: '8.1' }, + }, }, { - osfamily: 'Darwin', - operatingsystem: 'Darwin', - operatingsystemrelease: '13.3.0', + os: { + family: 'Darwin', + name: 'Darwin', + release: { full: '13.3.0' }, + }, }, { - osfamily: 'AIX', - operatingsystem: 'AIX', - operatingsystemrelease: '7100-02-00-000', + os: { + family: 'AIX', + name: 'AIX', + release: { full: '7100-02-00-000' }, + }, }, { - osfamily: 'AIX', - operatingsystem: 'AIX', - operatingsystemrelease: '6100-07-04-1216', + os: { + family: 'AIX', + name: 'AIX', + release: { full: '6100-07-04-1216' }, + }, }, { - osfamily: 'AIX', - operatingsystem: 'AIX', - operatingsystemrelease: '5300-12-01-1016', + os: { + family: 'AIX', + name: 'AIX', + release: { full: '5300-12-01-1016' }, + }, }, ].each do |facts| let(:facts) { facts } - it "is_expected.to fail on #{facts[:operatingsystem]} #{facts[:operatingsystemrelease]}" do + 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 From e54f5b4f08400570e9fa7578202671772d25bc4c Mon Sep 17 00:00:00 2001 From: Auto-release Date: Mon, 3 Feb 2020 16:07:00 +0000 Subject: [PATCH 054/259] Release version 6.1.0 --- CHANGELOG.md | 7 +------ metadata.json | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c508b8a5..b13321d5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,18 +6,13 @@ All notable changes to this project will be documented in this file. The format [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-8676\) Add CentOS 8 to supported OS list [\#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)) diff --git a/metadata.json b/metadata.json index 9dde18f9..0f716330 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "6.0.0", + "version": "6.1.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 415f1283d2dec639096e284ce4a22d7f1a3293b8 Mon Sep 17 00:00:00 2001 From: sheena Date: Wed, 5 Feb 2020 11:13:15 +0000 Subject: [PATCH 055/259] (IAC-365) updating tokens and dataset for honeycomb --- .github/workflows/release.yml | 4 +++- .sync.yml | 2 ++ .travis.yml | 6 +++++- Gemfile | 8 ++++---- Rakefile | 2 ++ metadata.json | 4 ++-- spec/spec_helper.rb | 2 ++ 7 files changed, 20 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 820339d7..35162951 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,9 @@ on: jobs: LitmusAcceptance: - + env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 + HONEYCOMB_DATASET: litmus tests runs-on: self-hosted strategy: diff --git a/.sync.yml b/.sync.yml index 97c09a43..d25ca614 100644 --- a/.sync.yml +++ b/.sync.yml @@ -2,6 +2,8 @@ ".gitlab-ci.yml": delete: true ".travis.yml": + global_env: + - HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests" deploy_to_forge: enabled: false branches: diff --git a/.travis.yml b/.travis.yml index 0f046cab..f84e573e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,8 @@ before_install: - rm -f Gemfile.lock - "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner" - "# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used" - - '[ -z "$RUBYGEMS_VERSION" ] || gem update --system $RUBYGEMS_VERSION' + - "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set" + - '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION' - gem --version - bundle -v script: @@ -15,6 +16,9 @@ script: bundler_args: --without system_tests rvm: - 2.5.3 +env: + global: + - HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests" stages: - static - spec diff --git a/Gemfile b/Gemfile index 0e395e7e..4f6e33b0 100644 --- a/Gemfile +++ b/Gemfile @@ -24,10 +24,10 @@ group :development do 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] - gem "puppet-module-win-dev-r#{minor_version}", '~> 0.3', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet-module-posix-default-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby] + gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby] + 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') end diff --git a/Rakefile b/Rakefile index 395df547..cb7ed0cc 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' diff --git a/metadata.json b/metadata.json index 0f716330..09fd90a6 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-gcaed9d7", - "pdk-version": "1.15.0" + "template-ref": "heads/master-0-g5d52853", + "pdk-version": "1.16.0" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c09e0024..bc023f51 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + RSpec.configure do |c| c.mock_with :rspec end From 1cdeba11f134de3f1ddaf8d27127c6430d63b69e Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Thu, 13 Feb 2020 11:41:09 +0200 Subject: [PATCH 056/259] Fix unit tests --- spec/unit/facter/java_libjvm_path_spec.rb | 9 +++++---- spec/unit/facter/java_major_version_spec.rb | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/spec/unit/facter/java_libjvm_path_spec.rb b/spec/unit/facter/java_libjvm_path_spec.rb index 1b1a2e2d..3efcb474 100644 --- a/spec/unit/facter/java_libjvm_path_spec.rb +++ b/spec/unit/facter/java_libjvm_path_spec.rb @@ -5,20 +5,21 @@ before(:each) do Facter.clear - allow(Facter.fact(:kernel)).to receive(:value).once.and_return('Linux') - allow(Facter.fact(:java_default_home)).to receive(:value).once.and_return(java_default_home) + allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') + allow(Facter.fact(:java_default_home)).to receive(:value).and_return(java_default_home) end context 'when libjvm exists' do it do - 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']) + allow(Facter.fact(:java_major_version)).to receive(:value).and_return(8) + 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']) 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}/**/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 diff --git a/spec/unit/facter/java_major_version_spec.rb b/spec/unit/facter/java_major_version_spec.rb index b9ead125..3b50e003 100644 --- a/spec/unit/facter/java_major_version_spec.rb +++ b/spec/unit/facter/java_major_version_spec.rb @@ -16,7 +16,7 @@ context 'when java not present, returns nil' do before :each do - allow(Facter.fact(:java_version)).to receive(:value).and_return('nil') + allow(Facter.fact(:java_version)).to receive(:value).and_return(nil) end it do expect(Facter.fact(:java_major_version).value).to be_nil From 84654700bca2328b0c4f495d6159f50275031251 Mon Sep 17 00:00:00 2001 From: David Swan Date: Fri, 14 Feb 2020 14:29:32 +0000 Subject: [PATCH 057/259] (IAC-215) - Implement use_litmus:true --- .sync.yml | 113 ++++-------------------------------------------------- 1 file changed, 8 insertions(+), 105 deletions(-) diff --git a/.sync.yml b/.sync.yml index d25ca614..4cb1b6be 100644 --- a/.sync.yml +++ b/.sync.yml @@ -8,111 +8,14 @@ enabled: false 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=ub_puppet5 - rvm: 2.5.1 - before_script: - - bundle exec rake 'litmus:provision_list[travis_ub]' - - 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=ub_puppet6 - rvm: 2.5.1 - before_script: - - bundle exec rake 'litmus:provision_list[travis_ub]' - - 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=el6_puppet5 - rvm: 2.5.1 - before_script: - - bundle exec rake 'litmus:provision_list[travis_el6]' - - 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=el6_puppet6 - rvm: 2.5.1 - before_script: - - bundle exec rake 'litmus:provision_list[travis_el6]' - - 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 - - bundler_args: - dist: trusty - env: PLATFORMS=el7_puppet5 - rvm: 2.5.1 - before_script: - - bundle exec rake 'litmus:provision_list[travis_el7]' - - 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=el7_puppet6 - rvm: 2.5.1 - before_script: - - bundle exec rake 'litmus:provision_list[travis_el7]' - - 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 + use_litmus: true + litmus: + provision_list: + - travis_deb + - travis_ub + - travis_el6 + - travis_el7 + - ---travis_el simplecov: true notifications: slack: From 2e72a1e255dbdbf0a28ec0cf6680fedc35f7f6cf Mon Sep 17 00:00:00 2001 From: David Swan Date: Fri, 14 Feb 2020 14:37:07 +0000 Subject: [PATCH 058/259] (IAC-215) - Pdk Update --- .travis.yml | 105 ++++++++++++++++++++++++++++++-------------------- metadata.json | 2 +- 2 files changed, 64 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index f84e573e..27746423 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ --- +os: linux dist: xenial language: ruby cache: bundler @@ -23,96 +24,116 @@ stages: - static - spec - acceptance -matrix: +jobs: fast_finish: true include: - - env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" - stage: static - - - env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec - rvm: 2.4.5 - stage: spec - - - env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec - rvm: 2.5.3 - stage: spec - - - 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"] + before_script: + - "bundle exec rake 'litmus:provision_list[travis_deb]'" + - "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 + env: PLATFORMS=travis_deb_puppet5 + rvm: 2.5.3 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"] + before_script: + - "bundle exec rake 'litmus:provision_list[travis_ub]'" + - "bundle exec rake 'litmus:install_agent[puppet5]'" + - "bundle exec rake litmus:install_module" bundler_args: dist: trusty - env: PLATFORMS=deb_puppet6 - rvm: 2.5.1 + env: PLATFORMS=travis_ub_puppet5 + rvm: 2.5.3 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker + stage: acceptance - - before_script: ["bundle exec rake 'litmus:provision_list[travis_ub]'", "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"] + before_script: + - "bundle exec rake 'litmus:provision_list[travis_el6]'" + - "bundle exec rake 'litmus:install_agent[puppet5]'" + - "bundle exec rake litmus:install_module" bundler_args: dist: trusty - env: PLATFORMS=ub_puppet5 - rvm: 2.5.1 + env: PLATFORMS=travis_el6_puppet5 + rvm: 2.5.3 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - sudo: required - - before_script: ["bundle exec rake 'litmus:provision_list[travis_ub]'", "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"] + before_script: + - "bundle exec rake 'litmus:provision_list[travis_el7]'" + - "bundle exec rake 'litmus:install_agent[puppet5]'" + - "bundle exec rake litmus:install_module" bundler_args: dist: trusty - env: PLATFORMS=ub_puppet6 - rvm: 2.5.1 + env: PLATFORMS=travis_el7_puppet5 + rvm: 2.5.3 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker + stage: acceptance - - before_script: ["bundle exec rake 'litmus:provision_list[travis_el6]'", "bundle exec rake 'litmus:install_agent[puppet5]'", "bundle exec rake litmus:install_module"] + before_script: + - "bundle exec rake 'litmus:provision_list[travis_deb]'" + - "bundle exec rake 'litmus:install_agent[puppet6]'" + - "bundle exec rake litmus:install_module" bundler_args: dist: trusty - env: PLATFORMS=el6_puppet5 - rvm: 2.5.1 + env: PLATFORMS=travis_deb_puppet6 + rvm: 2.5.3 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - sudo: required - - before_script: ["bundle exec rake 'litmus:provision_list[travis_el6]'", "bundle exec rake 'litmus:install_agent[puppet6]'", "bundle exec rake litmus:install_module"] + before_script: + - "bundle exec rake 'litmus:provision_list[travis_ub]'" + - "bundle exec rake 'litmus:install_agent[puppet6]'" + - "bundle exec rake litmus:install_module" bundler_args: dist: trusty - env: PLATFORMS=el6_puppet6 - rvm: 2.5.1 + env: PLATFORMS=travis_ub_puppet6 + rvm: 2.5.3 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - sudo: required - - before_script: ["bundle exec rake 'litmus:provision_list[travis_el7]'", "bundle exec rake 'litmus:install_agent[puppet5]'", "bundle exec rake litmus:install_module"] + before_script: + - "bundle exec rake 'litmus:provision_list[travis_el6]'" + - "bundle exec rake 'litmus:install_agent[puppet6]'" + - "bundle exec rake litmus:install_module" bundler_args: dist: trusty - env: PLATFORMS=el7_puppet5 - rvm: 2.5.1 + env: PLATFORMS=travis_el6_puppet6 + rvm: 2.5.3 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - sudo: required - - before_script: ["bundle exec rake 'litmus:provision_list[travis_el7]'", "bundle exec rake 'litmus:install_agent[puppet6]'", "bundle exec rake litmus:install_module"] + before_script: + - "bundle exec rake 'litmus:provision_list[travis_el7]'" + - "bundle exec rake 'litmus:install_agent[puppet6]'" + - "bundle exec rake litmus:install_module" bundler_args: dist: trusty - env: PLATFORMS=el7_puppet6 - rvm: 2.5.1 + env: PLATFORMS=travis_el7_puppet6 + rvm: 2.5.3 script: ["bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - sudo: required + - + env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" + stage: static + - + env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec + rvm: 2.4.5 + stage: spec + - + env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec + rvm: 2.5.3 + stage: spec branches: only: - master diff --git a/metadata.json b/metadata.json index 09fd90a6..8b06d86c 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-g5d52853", + "template-ref": "heads/master-0-g88c96ab", "pdk-version": "1.16.0" } From 35dba98f4b3fcd9342c86da4d1bc2209fc6ba03a Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Tue, 18 Feb 2020 15:29:10 +0200 Subject: [PATCH 059/259] Skip acceptance tests for AdoptOpenJDK on SLES --- spec/acceptance/install_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 2ea2885a..032fee9b 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -99,7 +99,7 @@ # AdoptOpenJDK URLs are quite generic, so tests are enabled by default # We need to test version 8 and >8 (here we use 9), because namings are different after version 8 -adopt_enabled = true +adopt_enabled = true unless os[:family].casecmp('SLES').zero? adopt_version8_major = '8' adopt_version8_minor = '202' adopt_version8_build = '08' From 86a66d57323b09854d3b7dd0f92ea844baad06e0 Mon Sep 17 00:00:00 2001 From: Auto-release Date: Tue, 18 Feb 2020 14:31:44 +0000 Subject: [PATCH 060/259] Release version 6.2.0 --- CHANGELOG.md | 18 ++++- REFERENCE.md | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++ metadata.json | 2 +- 3 files changed, 219 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b13321d5..e8acbe11 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +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.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.2.0) (2020-02-18) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.1.0...v6.2.0) + +### Added + +- Support AdoptOpenJDK [\#370](https://github.com/puppetlabs/puppetlabs-java/pull/370) ([timdeluxe](https://github.com/timdeluxe)) + +### Fixed + +- Replace legacy facts by modern facts [\#406](https://github.com/puppetlabs/puppetlabs-java/pull/406) ([hdeheer](https://github.com/hdeheer)) + +## [v6.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.1.0) (2020-02-03) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.0.0...v6.1.0) + ## [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) @@ -32,7 +48,6 @@ All notable changes to this project will be documented in this file. The format - \(FM-8223\) converted to use litmus [\#376](https://github.com/puppetlabs/puppetlabs-java/pull/376) ([tphoney](https://github.com/tphoney)) - Add buster support, default to 11 [\#369](https://github.com/puppetlabs/puppetlabs-java/pull/369) ([mhjacks](https://github.com/mhjacks)) -- Add support for debian buster [\#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) ### Fixed @@ -57,6 +72,7 @@ All notable changes to this project will be documented in this file. The format ### Added +- Add support for debian buster [\#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) - \(FM-7921\) - Implement Puppet Strings [\#353](https://github.com/puppetlabs/puppetlabs-java/pull/353) ([david22swan](https://github.com/david22swan)) - Update default version & java 8 version from 8u192 to 8u201 [\#347](https://github.com/puppetlabs/puppetlabs-java/pull/347) ([valentinsavenko](https://github.com/valentinsavenko)) - Add ability to override basedir and package type for oracle java [\#345](https://github.com/puppetlabs/puppetlabs-java/pull/345) ([fraenki](https://github.com/fraenki)) diff --git a/REFERENCE.md b/REFERENCE.md index f7416d5a..79d90d9c 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -18,6 +18,7 @@ options, even though those are not in the package repositories. **Defined types** +* [`java::adopt`](#javaadopt): Defined Type java::adopt Description Installs OpenJDK Java built with AdoptOpenJDK with the Hotspot JVM. Install one or more versions of Ad * [`java::download`](#javadownload): Installs Java from a url location. ## Classes @@ -101,6 +102,206 @@ Default value: `undef` ## Defined types +### java::adopt + +Defined Type java::adopt + +Description +Installs OpenJDK Java built with AdoptOpenJDK with the Hotspot JVM. + +Install one or more versions of AdoptOpenJDK Java. + +Currently only Linux RedHat, Amazon and Debian are supported. + +Parameters +[*version*] +Version of Java to install, e.g. '8' or '9'. Default values for major and minor +versions will be used. + +[*version_major*] +Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with +version_minor. + +[*version_minor*] +Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). +Must be used together with version_major. + +[*java_edition*] +Type of Java Edition to install, jdk or jre. + +[*ensure*] +Install or remove the package. + +[*proxy_server*] +Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) + +[*proxy_type*] +Proxy server type (none|http|https|ftp). (passed to archive) + +[*basedir*] +Directory under which the installation will occur. If not set, defaults to +/usr/lib/jvm for Debian and /usr/java for RedHat. + +[*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. + +[*package_type*] +Type of installation package for specified version of java. java 6 comes +in a few installation package flavors and we need to account for them. +Optional forced package types: rpm, rpmbin, tar.gz + +Variables +[*release_major*] +Major version release number for java. Used to construct download URL. + +[*release_minor*] +Minor version release number for java. Used to construct download URL. + +[*install_path*] +Base install path for specified version of java. Used to determine if java +has already been installed. + +[*os*] +java OS type. + +[*destination*] +Destination directory to save java installer to. Usually /tmp on Linux and +C:\TEMP on Windows. + +[*creates_path*] +Fully qualified path to java after it is installed. Used to determine if +java is already installed. + +[*arch*] +java architecture type. + +[*package_name*] +Name of the java installation package to download from github. + +[*install_command*] +Installation command used to install java. Installation commands +differ by package_type. 'bin' types are installed via shell command. 'rpmbin' +types have the rpms extracted and then forcibly installed. 'rpm' types are +forcibly installed. + +[*spacer*] +Spacer to be used in github download url. In major version 8 this is a simple dash +in later versions they use a crazy plus sign, which needs to be used in urlencoded +format + +[*download_folder_prefix*] +Download folder name begins differently depending on the release. After major release +8, they have given it a dash. Be aware that even if you want to have a JRE, the folder +still begins with "jdk" + +[*release_minor_url*] +filled depending on major release. Until major release 8 the minor part needs to be given +with a 'b' for build, in later versions it is a underscore or a plus sign, which needs +to be stripped for the download url and is replaced with the given spaces (see above) + +[*_package_type*] +Helper variable which gets filled depending on parameter package_type + +[*_basedir*] +Helper variable which gets filled depending on parameter basedir + +[*_version*] +Helper variable which gets filled depending on parameter version + +[*_version_int*] +Helper variable which gets the value of $_version converted to integer + +[*_append_jre*] +Helper variable which gets filled with the string "-jre" if jre was selected to build the correct install path + +[*_release_minor_package_name*] +Helper variable which gets filled with the right minor string depending on the major version + +#### Parameters + +The following parameters are available in the `java::adopt` defined type. + +##### `ensure` + +Data type: `Any` + + + +Default value: 'present' + +##### `version` + +Data type: `Any` + + + +Default value: '8' + +##### `version_major` + +Data type: `Any` + + + +Default value: `undef` + +##### `version_minor` + +Data type: `Any` + + + +Default value: `undef` + +##### `java` + +Data type: `Any` + + + +Default value: 'jdk' + +##### `proxy_server` + +Data type: `Any` + + + +Default value: `undef` + +##### `proxy_type` + +Data type: `Any` + + + +Default value: `undef` + +##### `basedir` + +Data type: `Any` + + + +Default value: `undef` + +##### `manage_basedir` + +Data type: `Any` + + + +Default value: `true` + +##### `package_type` + +Data type: `Any` + + + +Default value: `undef` + ### java::download Defined Type java::download diff --git a/metadata.json b/metadata.json index 8b06d86c..e5a16c2c 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "6.1.0", + "version": "6.2.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 2e16e093f25763eacb5b41243827ef7e155b819e Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Wed, 19 Feb 2020 09:03:21 +0200 Subject: [PATCH 061/259] Change Rspec test execution to serial mode --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 35162951..36eabfc1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,7 +33,7 @@ jobs: strategy: matrix: - check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'] + check: [spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'] ruby_version: [2.4.x, 2.5.x] puppet_gem_version: [~> 5.0, ~> 6.0] exclude: From 9551b4284b72d888efe6f8012fa433bb0474ae90 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Thu, 20 Feb 2020 11:36:34 +0200 Subject: [PATCH 062/259] Add weekly workflow on default branch --- .github/workflows/weekly.yml | 42 ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/weekly.yml diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml new file mode 100644 index 00000000..3be2e052 --- /dev/null +++ b/.github/workflows/weekly.yml @@ -0,0 +1,42 @@ +name: "weekly" + +on: + schedule: + - cron: '0 0 * * 6' + +jobs: + LitmusAcceptance: + runs-on: self-hosted + strategy: + matrix: + ruby_version: [2.5.x] + puppet_gem_version: [~> 6.0] + platform: [release_checks] + agent_family: ['puppet5', 'puppet6'] + + steps: + - uses: actions/checkout@v1 + - name: Litmus Parallel + uses: puppetlabs/action-litmus_parallel@master + with: + platform: ${{ matrix.platform }} + agent_family: ${{ matrix.agent_family }} + Spec: + runs-on: self-hosted + strategy: + matrix: + check: [spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'] + ruby_version: [2.5.x] + puppet_gem_version: [~> 5.0, ~> 6.0] + exclude: + - puppet_gem_version: ~> 5.0 + check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop' + - ruby_version: 2.5.x + puppet_gem_version: ~> 5.0 + steps: + - uses: actions/checkout@v1 + - name: Spec Tests + uses: puppetlabs/action-litmus_spec@master + with: + puppet_gem_version: ${{ matrix.puppet_gem_version }} + check: ${{ matrix.check }} From 76cca5c33d3edf4adb65bf25ebbdf2986d676805 Mon Sep 17 00:00:00 2001 From: David Swan Date: Thu, 27 Feb 2020 13:14:56 +0000 Subject: [PATCH 063/259] (maint) - Pdk Update --- .travis.yml | 60 ++++++++++++++++++++++----------------------------- metadata.json | 4 ++-- 2 files changed, 28 insertions(+), 36 deletions(-) diff --git a/.travis.yml b/.travis.yml index 27746423..9be3dab9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,7 +16,7 @@ script: - 'SIMPLECOV=yes bundle exec rake $CHECK' bundler_args: --without system_tests rvm: - - 2.5.3 + - 2.5.7 env: global: - HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests" @@ -32,11 +32,10 @@ jobs: - "bundle exec rake 'litmus:provision_list[travis_deb]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - bundler_args: - dist: trusty + bundler_args: env: PLATFORMS=travis_deb_puppet5 - rvm: 2.5.3 - script: ["bundle exec rake litmus:acceptance:parallel"] + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - @@ -44,11 +43,10 @@ jobs: - "bundle exec rake 'litmus:provision_list[travis_ub]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - bundler_args: - dist: trusty + bundler_args: env: PLATFORMS=travis_ub_puppet5 - rvm: 2.5.3 - script: ["bundle exec rake litmus:acceptance:parallel"] + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - @@ -56,11 +54,10 @@ jobs: - "bundle exec rake 'litmus:provision_list[travis_el6]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - bundler_args: - dist: trusty + bundler_args: env: PLATFORMS=travis_el6_puppet5 - rvm: 2.5.3 - script: ["bundle exec rake litmus:acceptance:parallel"] + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - @@ -68,11 +65,10 @@ jobs: - "bundle exec rake 'litmus:provision_list[travis_el7]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - bundler_args: - dist: trusty + bundler_args: env: PLATFORMS=travis_el7_puppet5 - rvm: 2.5.3 - script: ["bundle exec rake litmus:acceptance:parallel"] + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - @@ -80,11 +76,10 @@ jobs: - "bundle exec rake 'litmus:provision_list[travis_deb]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - bundler_args: - dist: trusty + bundler_args: env: PLATFORMS=travis_deb_puppet6 - rvm: 2.5.3 - script: ["bundle exec rake litmus:acceptance:parallel"] + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - @@ -92,11 +87,10 @@ jobs: - "bundle exec rake 'litmus:provision_list[travis_ub]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - bundler_args: - dist: trusty + bundler_args: env: PLATFORMS=travis_ub_puppet6 - rvm: 2.5.3 - script: ["bundle exec rake litmus:acceptance:parallel"] + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - @@ -104,11 +98,10 @@ jobs: - "bundle exec rake 'litmus:provision_list[travis_el6]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - bundler_args: - dist: trusty + bundler_args: env: PLATFORMS=travis_el6_puppet6 - rvm: 2.5.3 - script: ["bundle exec rake litmus:acceptance:parallel"] + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - @@ -116,11 +109,10 @@ jobs: - "bundle exec rake 'litmus:provision_list[travis_el7]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - bundler_args: - dist: trusty + bundler_args: env: PLATFORMS=travis_el7_puppet6 - rvm: 2.5.3 - script: ["bundle exec rake litmus:acceptance:parallel"] + rvm: 2.5.7 + script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - @@ -132,7 +124,7 @@ jobs: stage: spec - env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec - rvm: 2.5.3 + rvm: 2.5.7 stage: spec branches: only: diff --git a/metadata.json b/metadata.json index e5a16c2c..76eb060c 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-g88c96ab", - "pdk-version": "1.16.0" + "template-ref": "1.17.0-0-gd3a4319", + "pdk-version": "1.17.0" } From 504fe4c0ffd16e8cf17eac5b38655f66d8abc968 Mon Sep 17 00:00:00 2001 From: David Swan Date: Fri, 6 Mar 2020 12:37:46 +0000 Subject: [PATCH 064/259] (IAC-555) - Remove distelli-manifest.yml --- distelli-manifest.yml | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 distelli-manifest.yml diff --git a/distelli-manifest.yml b/distelli-manifest.yml deleted file mode 100644 index 34b3a2f9..00000000 --- a/distelli-manifest.yml +++ /dev/null @@ -1,25 +0,0 @@ -team-modules/puppetlabs-java: - PreBuild: - - source /opt/rh/rh-ruby25/enable - - echo "--- LETS update BUNDLER ---" - - bundle install --path vendor/bundle --jobs 3 - Build: - - echo "--- PROVISIONING ---" - - source /opt/rh/rh-ruby25/enable - - bundle exec rake litmus:provision_list[release_checks] - - cat inventory.yaml - - echo "--- AGENT INSTALLATION ---" - - bundle exec rake litmus:install_agent - - echo "--- MODULE INSTALLATION ---" - - bundle exec rake litmus:install_module - - echo "--- TESTS RUNNING ---" - - bundle exec rake litmus:acceptance:parallel - AfterBuildSuccess: - - source /opt/rh/rh-ruby25/enable - - bundle exec rake litmus:tear_down - AfterBuildFailure: - - source /opt/rh/rh-ruby25/enable - - bundle exec rake litmus:tear_down - CommitData: - - RepoType: Git - - RepoPath: . From 708a94f2535d79088c5fe5bc6e8ca4a1b3a74e1e Mon Sep 17 00:00:00 2001 From: Michael T Lombardi Date: Mon, 9 Mar 2020 21:46:58 -0500 Subject: [PATCH 065/259] (MAINT) Update docker image names Prior to this commit the provision file referenced the old waffleimage repo for CI docker images to use. This commit updates the file to point at litmusimage, which is the repo the latest images are released to. --- provision.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/provision.yaml b/provision.yaml index 6ac1acc2..4716e395 100644 --- a/provision.yaml +++ b/provision.yaml @@ -1,22 +1,22 @@ --- default: provisioner: docker - images: ['waffleimage/debian8'] + images: ['litmusimage/debian:8'] vagrant: provisioner: vagrant images: ['centos/7', 'generic/ubuntu1804'] travis_deb: provisioner: docker - images: ['waffleimage/debian8', 'waffleimage/debian9', 'waffleimage/debian10'] + images: ['litmusimage/debian:8', 'litmusimage/debian:9', 'litmusimage/debian:10'] travis_ub: provisioner: docker - images: ['waffleimage/ubuntu14.04', 'waffleimage/ubuntu16.04', 'waffleimage/ubuntu18.04'] + images: ['litmusimage/ubuntu:14.04', 'litmusimage/ubuntu:16.04', 'litmusimage/ubuntu:18.04'] travis_el6: provisioner: docker - images: ['waffleimage/centos6', 'waffleimage/oraclelinux6', 'waffleimage/scientificlinux6'] + images: ['litmusimage/centos:6', 'litmusimage/oraclelinux:6', 'litmusimage/scientificlinux:6'] travis_el7: provisioner: docker - images: ['waffleimage/centos7', 'waffleimage/oraclelinux7', 'waffleimage/scientificlinux7'] + images: ['litmusimage/centos:7', 'litmusimage/oraclelinux:7', 'litmusimage/scientificlinux:7'] 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', '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'] From 01e717777fa77e3907454bd5c74d82dc2cf7bb12 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Wed, 26 Feb 2020 11:41:05 +0200 Subject: [PATCH 066/259] Update weekly workflow schedule --- .github/workflows/weekly.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 3be2e052..3afd42c5 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -2,10 +2,13 @@ name: "weekly" on: schedule: - - cron: '0 0 * * 6' + - cron: '0 5 * * 5' jobs: LitmusAcceptance: + env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 + HONEYCOMB_DATASET: litmus tests runs-on: self-hosted strategy: matrix: @@ -25,7 +28,7 @@ jobs: runs-on: self-hosted strategy: matrix: - check: [spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'] + check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'] ruby_version: [2.5.x] puppet_gem_version: [~> 5.0, ~> 6.0] exclude: From c3104ce39b7c50e2b8071162cb5e188d85936a72 Mon Sep 17 00:00:00 2001 From: gimmy Date: Fri, 13 Mar 2020 15:13:27 +0200 Subject: [PATCH 067/259] (maint) correct test when java is not installed --- spec/unit/facter/java_version_spec.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index 20f4f523..5d65a04e 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -63,6 +63,7 @@ it do allow(Facter::Util::Resolution).to receive(:exec) # Catch all other calls + allow(Facter::Util::Resolution).to receive(:which).and_return(nil) expect(Facter.value(:java_version)).to be_nil end end From 602d630cf04e70bd5042aed29164f05f4c4130ba Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 27 Apr 2020 14:26:51 +0300 Subject: [PATCH 068/259] Add net-ssh dependency gems to development group --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 4f6e33b0..adbbe6d0 100644 --- a/Gemfile +++ b/Gemfile @@ -29,6 +29,8 @@ 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'] From 622c3469a61ecaebbd5b46cc91ba4babae47b18f Mon Sep 17 00:00:00 2001 From: David Swan Date: Tue, 12 May 2020 15:39:48 +0100 Subject: [PATCH 069/259] (maint) - Pdk Update --- .rubocop.yml | 4 ++++ .vscode/extensions.json | 2 +- Gemfile | 2 -- metadata.json | 2 +- spec/spec_helper.rb | 1 + 5 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index bab25db5..5307849e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -40,6 +40,10 @@ Style/BlockDelimiters: Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then. EnforcedStyle: braces_for_chaining +Style/BracesAroundHashParameters: + Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0. + See https://github.com/rubocop-hq/rubocop/pull/7643 + Enabled: true Style/ClassAndModuleChildren: Description: Compact style reduces the required amount of indentation. EnforcedStyle: compact diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 61777827..2f1e4f73 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,6 @@ { "recommendations": [ - "jpogran.puppet-vscode", + "puppet.puppet-vscode", "rebornix.Ruby" ] } diff --git a/Gemfile b/Gemfile index adbbe6d0..4f6e33b0 100644 --- a/Gemfile +++ b/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'] diff --git a/metadata.json b/metadata.json index 76eb060c..a3f4d226 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "1.17.0-0-gd3a4319", + "template-ref": "heads/master-0-g095317c", "pdk-version": "1.17.0" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bc023f51..16764b6f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -42,6 +42,7 @@ # set to strictest setting for testing # by default Puppet runs at warning level Puppet.settings[:strict] = :warning + Puppet.settings[:strict_variables] = true end c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT'] c.after(:suite) do From 484f27a79ed99e5ea07b0f1d2ecd230882699c7c Mon Sep 17 00:00:00 2001 From: david22swan Date: Thu, 14 May 2020 09:28:50 +0100 Subject: [PATCH 070/259] (maint) - add back gems removed by pdk update --- Gemfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Gemfile b/Gemfile index 4f6e33b0..adbbe6d0 100644 --- a/Gemfile +++ b/Gemfile @@ -29,6 +29,8 @@ 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'] From 6de2b2db55583ba948d7d6904802a96f5842a312 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 18 May 2020 09:55:46 +0300 Subject: [PATCH 071/259] Change provision from vmpooler to abs --- provision.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/provision.yaml b/provision.yaml index 4716e395..b64c5e3d 100644 --- a/provision.yaml +++ b/provision.yaml @@ -18,5 +18,5 @@ travis_el7: provisioner: docker images: ['litmusimage/centos:7', 'litmusimage/oraclelinux:7', 'litmusimage/scientificlinux:7'] release_checks: - provisioner: vmpooler + 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'] From 46e2a3b08439534a961ccf120d55e198037ad7b5 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 18 May 2020 10:02:03 +0300 Subject: [PATCH 072/259] Switch to default spec_helper_acceptance file --- spec/spec_helper_acceptance.rb | 78 +--------------------------------- 1 file changed, 1 insertion(+), 77 deletions(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index aabeb0b8..4ac8d7e0 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -1,82 +1,6 @@ # frozen_string_literal: true -require 'serverspec' require 'puppet_litmus' require 'spec_helper_acceptance_local' if File.file?(File.join(File.dirname(__FILE__), 'spec_helper_acceptance_local.rb')) -include PuppetLitmus -if ENV['TARGET_HOST'].nil? || ENV['TARGET_HOST'] == 'localhost' - puts 'Running tests against this machine !' - if Gem.win_platform? - set :backend, :cmd - else - set :backend, :exec - end -else - # load inventory - inventory_hash = inventory_hash_from_inventory_file - node_config = config_from_node(inventory_hash, ENV['TARGET_HOST']) - - if target_in_group(inventory_hash, ENV['TARGET_HOST'], 'docker_nodes') - host = ENV['TARGET_HOST'] - set :backend, :docker - set :docker_container, host - elsif target_in_group(inventory_hash, ENV['TARGET_HOST'], 'ssh_nodes') - set :backend, :ssh - options = Net::SSH::Config.for(host) - options[:user] = node_config.dig('ssh', 'user') unless node_config.dig('ssh', 'user').nil? - 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? - # 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 - ENV['TARGET_HOST'] - end - set :host, options[:host_name] || host - set :ssh_options, options - set :request_pty, true - elsif target_in_group(inventory_hash, ENV['TARGET_HOST'], 'winrm_nodes') - require 'winrm' - - set :backend, :winrm - set :os, family: 'windows' - user = node_config.dig('winrm', 'user') unless node_config.dig('winrm', 'user').nil? - pass = node_config.dig('winrm', 'password') unless node_config.dig('winrm', 'password').nil? - endpoint = "http://#{ENV['TARGET_HOST']}:5985/wsman" - - opts = { - user: user, - password: pass, - endpoint: endpoint, - operation_timeout: 300, - } - - winrm = WinRM::Connection.new opts - Specinfra.configuration.winrm = winrm - end -end +PuppetLitmus.configure! From 43133c9a222dfeafd1a2a6b270d9effeddcf21e7 Mon Sep 17 00:00:00 2001 From: David Swan Date: Wed, 20 May 2020 11:52:07 +0100 Subject: [PATCH 073/259] (IAC-746) - Add ubuntu 20.04 support --- .github/workflows/release.yml | 25 +++++++++++++++++++++---- .github/workflows/weekly.yml | 25 ++++++++++++++++++++++--- .sync.yml | 20 +++++++++++++++----- .travis.yml | 28 ++++++++++++++-------------- metadata.json | 5 +++-- provision.yaml | 11 +++++++++-- 6 files changed, 84 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 36eabfc1..37315319 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -6,22 +6,39 @@ on: - 'release' jobs: - LitmusAcceptance: + LitmusAcceptancePuppet5: env: HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 HONEYCOMB_DATASET: litmus tests runs-on: self-hosted - strategy: matrix: ruby_version: [2.5.x] puppet_gem_version: [~> 6.0] - platform: [release_checks] - agent_family: ['puppet5', 'puppet6'] + platform: [release_checks_5] + agent_family: ['puppet5'] steps: - uses: actions/checkout@v1 + - name: Litmus Parallel + uses: puppetlabs/action-litmus_parallel@master + with: + platform: ${{ matrix.platform }} + agent_family: ${{ matrix.agent_family }} + LitmusAcceptancePuppet6: + env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 + HONEYCOMB_DATASET: litmus tests + runs-on: self-hosted + strategy: + matrix: + ruby_version: [2.5.x] + puppet_gem_version: [~> 6.0] + platform: [release_checks_6] + agent_family: ['puppet6'] + steps: + - uses: actions/checkout@v1 - name: Litmus Parallel uses: puppetlabs/action-litmus_parallel@master with: diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 3afd42c5..6b9b0962 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -5,7 +5,7 @@ on: - cron: '0 5 * * 5' jobs: - LitmusAcceptance: + LitmusAcceptancePuppet5: env: HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 HONEYCOMB_DATASET: litmus tests @@ -14,8 +14,27 @@ jobs: matrix: ruby_version: [2.5.x] puppet_gem_version: [~> 6.0] - platform: [release_checks] - agent_family: ['puppet5', 'puppet6'] + platform: [release_checks_5] + agent_family: ['puppet5'] + + steps: + - uses: actions/checkout@v1 + - name: Litmus Parallel + uses: puppetlabs/action-litmus_parallel@master + with: + platform: ${{ matrix.platform }} + agent_family: ${{ matrix.agent_family }} + LitmusAcceptancePuppet6: + env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 + HONEYCOMB_DATASET: litmus tests + runs-on: self-hosted + strategy: + matrix: + ruby_version: [2.5.x] + puppet_gem_version: [~> 6.0] + platform: [release_checks_6] + agent_family: ['puppet6'] steps: - uses: actions/checkout@v1 diff --git a/.sync.yml b/.sync.yml index 4cb1b6be..bfca55e9 100644 --- a/.sync.yml +++ b/.sync.yml @@ -11,11 +11,21 @@ use_litmus: true litmus: provision_list: - - travis_deb - - travis_ub - - travis_el6 - - travis_el7 - - ---travis_el + - ---travis_el + - travis_deb + - travis_el6 + - travis_el7 + complex: + - collection: + puppet_collection: + - puppet6 + provision_list: + - travis_ub_6 + - collection: + puppet_collection: + - puppet5 + provision_list: + - travis_ub_5 simplecov: true notifications: slack: diff --git a/.travis.yml b/.travis.yml index 9be3dab9..78f54026 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,66 +29,66 @@ jobs: include: - before_script: - - "bundle exec rake 'litmus:provision_list[travis_deb]'" - - "bundle exec rake 'litmus:install_agent[puppet5]'" + - "bundle exec rake 'litmus:provision_list[travis_ub_6]'" + - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" bundler_args: - env: PLATFORMS=travis_deb_puppet5 + env: PLATFORMS=travis_ub_6_puppet6 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_ub]'" + - "bundle exec rake 'litmus:provision_list[travis_ub_5]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" bundler_args: - env: PLATFORMS=travis_ub_puppet5 + env: PLATFORMS=travis_ub_5_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_el6]'" + - "bundle exec rake 'litmus:provision_list[travis_deb]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" bundler_args: - env: PLATFORMS=travis_el6_puppet5 + env: PLATFORMS=travis_deb_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_el7]'" + - "bundle exec rake 'litmus:provision_list[travis_el6]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" bundler_args: - env: PLATFORMS=travis_el7_puppet5 + env: PLATFORMS=travis_el6_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]'" - - "bundle exec rake 'litmus:install_agent[puppet6]'" + - "bundle exec rake 'litmus:provision_list[travis_el7]'" + - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" bundler_args: - env: PLATFORMS=travis_deb_puppet6 + env: PLATFORMS=travis_el7_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_ub]'" + - "bundle exec rake 'litmus:provision_list[travis_deb]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" bundler_args: - env: PLATFORMS=travis_ub_puppet6 + env: PLATFORMS=travis_deb_puppet6 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker diff --git a/metadata.json b/metadata.json index a3f4d226..f0443817 100644 --- a/metadata.json +++ b/metadata.json @@ -62,7 +62,8 @@ "operatingsystemrelease": [ "14.04", "16.04", - "18.04" + "18.04", + "20.04" ] }, { @@ -81,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-g095317c", + "template-ref": "heads/master-0-g88b05c7", "pdk-version": "1.17.0" } diff --git a/provision.yaml b/provision.yaml index b64c5e3d..9a5c6b28 100644 --- a/provision.yaml +++ b/provision.yaml @@ -8,15 +8,22 @@ vagrant: travis_deb: provisioner: docker images: ['litmusimage/debian:8', 'litmusimage/debian:9', 'litmusimage/debian:10'] -travis_ub: +travis_ub_5: provisioner: docker images: ['litmusimage/ubuntu:14.04', 'litmusimage/ubuntu:16.04', 'litmusimage/ubuntu:18.04'] +travis_ub_6: + provisioner: docker + images: ['litmusimage/ubuntu:14.04', 'litmusimage/ubuntu:16.04', 'litmusimage/ubuntu:18.04', 'litmusimage/ubuntu:20.04'] travis_el6: provisioner: docker images: ['litmusimage/centos:6', 'litmusimage/oraclelinux:6', 'litmusimage/scientificlinux:6'] travis_el7: provisioner: docker images: ['litmusimage/centos:7', 'litmusimage/oraclelinux:7', 'litmusimage/scientificlinux:7'] -release_checks: +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'] +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'] + \ No newline at end of file From e4912e071c3cb072c5e6063e9e85b06902d74bfe Mon Sep 17 00:00:00 2001 From: David Swan Date: Wed, 20 May 2020 17:30:56 +0100 Subject: [PATCH 074/259] (IAZ-746) - Set default params for Ubuntu 20.04 --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 697b8284..909eb9cf 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -142,7 +142,7 @@ }, } } - '10', '18.04', '18.10', '19.04', '19.10': { + '10', '18.04', '18.10', '19.04', '19.10', '20.04': { $java = { 'jdk' => { 'package' => 'openjdk-11-jdk', From 06f1a56b3131e9a9d0041b70516504b0de9012d9 Mon Sep 17 00:00:00 2001 From: Frank Wall Date: Tue, 26 May 2020 16:21:33 +0200 Subject: [PATCH 075/259] (MODULES-10681) Add option to manage symlink to java::adopt While here, convert the documentation to Puppet Strings and add some basic unit tests. --- REFERENCE.md | 152 +++++++--------------------------- manifests/adopt.pp | 139 +++++++++---------------------- spec/defines/adopt_spec.rb | 23 +++++ spec/defines/download_spec.rb | 15 ++++ 4 files changed, 108 insertions(+), 221 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 79d90d9c..260d7c10 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -18,7 +18,7 @@ options, even though those are not in the package repositories. **Defined types** -* [`java::adopt`](#javaadopt): Defined Type java::adopt Description Installs OpenJDK Java built with AdoptOpenJDK with the Hotspot JVM. Install one or more versions of Ad +* [`java::adopt`](#javaadopt): Install one or more versions of AdoptOpenJDK Java. * [`java::download`](#javadownload): Installs Java from a url location. ## Classes @@ -106,118 +106,6 @@ Default value: `undef` Defined Type java::adopt -Description -Installs OpenJDK Java built with AdoptOpenJDK with the Hotspot JVM. - -Install one or more versions of AdoptOpenJDK Java. - -Currently only Linux RedHat, Amazon and Debian are supported. - -Parameters -[*version*] -Version of Java to install, e.g. '8' or '9'. Default values for major and minor -versions will be used. - -[*version_major*] -Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with -version_minor. - -[*version_minor*] -Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). -Must be used together with version_major. - -[*java_edition*] -Type of Java Edition to install, jdk or jre. - -[*ensure*] -Install or remove the package. - -[*proxy_server*] -Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) - -[*proxy_type*] -Proxy server type (none|http|https|ftp). (passed to archive) - -[*basedir*] -Directory under which the installation will occur. If not set, defaults to -/usr/lib/jvm for Debian and /usr/java for RedHat. - -[*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. - -[*package_type*] -Type of installation package for specified version of java. java 6 comes -in a few installation package flavors and we need to account for them. -Optional forced package types: rpm, rpmbin, tar.gz - -Variables -[*release_major*] -Major version release number for java. Used to construct download URL. - -[*release_minor*] -Minor version release number for java. Used to construct download URL. - -[*install_path*] -Base install path for specified version of java. Used to determine if java -has already been installed. - -[*os*] -java OS type. - -[*destination*] -Destination directory to save java installer to. Usually /tmp on Linux and -C:\TEMP on Windows. - -[*creates_path*] -Fully qualified path to java after it is installed. Used to determine if -java is already installed. - -[*arch*] -java architecture type. - -[*package_name*] -Name of the java installation package to download from github. - -[*install_command*] -Installation command used to install java. Installation commands -differ by package_type. 'bin' types are installed via shell command. 'rpmbin' -types have the rpms extracted and then forcibly installed. 'rpm' types are -forcibly installed. - -[*spacer*] -Spacer to be used in github download url. In major version 8 this is a simple dash -in later versions they use a crazy plus sign, which needs to be used in urlencoded -format - -[*download_folder_prefix*] -Download folder name begins differently depending on the release. After major release -8, they have given it a dash. Be aware that even if you want to have a JRE, the folder -still begins with "jdk" - -[*release_minor_url*] -filled depending on major release. Until major release 8 the minor part needs to be given -with a 'b' for build, in later versions it is a underscore or a plus sign, which needs -to be stripped for the download url and is replaced with the given spaces (see above) - -[*_package_type*] -Helper variable which gets filled depending on parameter package_type - -[*_basedir*] -Helper variable which gets filled depending on parameter basedir - -[*_version*] -Helper variable which gets filled depending on parameter version - -[*_version_int*] -Helper variable which gets the value of $_version converted to integer - -[*_append_jre*] -Helper variable which gets filled with the string "-jre" if jre was selected to build the correct install path - -[*_release_minor_package_name*] -Helper variable which gets filled with the right minor string depending on the major version - #### Parameters The following parameters are available in the `java::adopt` defined type. @@ -226,7 +114,7 @@ The following parameters are available in the `java::adopt` defined type. Data type: `Any` - +Install or remove the package. Default value: 'present' @@ -234,7 +122,7 @@ Default value: 'present' Data type: `Any` - +Version of Java to install, e.g. '8' or '9'. Default values for major and minor versions will be used. Default value: '8' @@ -242,7 +130,7 @@ Default value: '8' Data type: `Any` - +Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor. Default value: `undef` @@ -250,7 +138,7 @@ Default value: `undef` Data type: `Any` - +Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major. Default value: `undef` @@ -258,7 +146,7 @@ Default value: `undef` Data type: `Any` - +Type of Java Standard Edition to install, jdk or jre. Default value: 'jdk' @@ -266,7 +154,7 @@ Default value: 'jdk' Data type: `Any` - +Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) Default value: `undef` @@ -274,7 +162,7 @@ Default value: `undef` Data type: `Any` - +Proxy server type (none|http|https|ftp). (passed to archive) Default value: `undef` @@ -282,7 +170,8 @@ Default value: `undef` 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` @@ -290,7 +179,8 @@ Default value: `undef` 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` @@ -298,7 +188,25 @@ Default value: `true` Data type: `Any` +Type of installation package for specified version of java_se. java_se 6 comes +in a few installation package flavors and we need to account for them. +Optional forced package types: rpm, rpmbin, tar.gz + +Default value: `undef` + +##### `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` diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 5931ecce..c460069f 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -1,116 +1,47 @@ # Defined Type java::adopt # -# Description -# Installs OpenJDK Java built with AdoptOpenJDK with the Hotspot JVM. +# @summary +# Install one or more versions of AdoptOpenJDK Java. # -# Install one or more versions of AdoptOpenJDK Java. +# @param ensure +# Install or remove the package. # -# Currently only Linux RedHat, Amazon and Debian are supported. +# @param version +# Version of Java to install, e.g. '8' or '9'. Default values for major and minor versions will be used. # -# Parameters -# [*version*] -# Version of Java to install, e.g. '8' or '9'. Default values for major and minor -# versions will be used. +# @param version_major +# Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor. # -# [*version_major*] -# Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with -# version_minor. +# @param version_minor +# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major. # -# [*version_minor*] -# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). -# Must be used together with version_major. +# @param java +# Type of Java Standard Edition to install, jdk or jre. # -# [*java_edition*] -# 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) # -# [*ensure*] -# Install or remove the package. +# @param proxy_type +# Proxy server type (none|http|https|ftp). (passed to archive) # -# [*proxy_server*] -# Specify a proxy server, with port number if needed. ie: https://example.com:8080. (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. # -# [*proxy_type*] -# Proxy server type (none|http|https|ftp). (passed to archive) +# @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. # -# [*basedir*] -# Directory under which the installation will occur. If not set, defaults to -# /usr/lib/jvm for Debian and /usr/java for RedHat. +# @param package_type +# Type of installation package for specified version of java_se. java_se 6 comes +# in a few installation package flavors and we need to account for them. +# Optional forced package types: rpm, rpmbin, tar.gz # -# [*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. # -# [*package_type*] -# Type of installation package for specified version of java. java 6 comes -# in a few installation package flavors and we need to account for them. -# Optional forced package types: rpm, rpmbin, tar.gz -# -# Variables -# [*release_major*] -# Major version release number for java. Used to construct download URL. -# -# [*release_minor*] -# Minor version release number for java. Used to construct download URL. -# -# [*install_path*] -# Base install path for specified version of java. Used to determine if java -# has already been installed. -# -# [*os*] -# java OS type. -# -# [*destination*] -# Destination directory to save java installer to. Usually /tmp on Linux and -# C:\TEMP on Windows. -# -# [*creates_path*] -# Fully qualified path to java after it is installed. Used to determine if -# java is already installed. -# -# [*arch*] -# java architecture type. -# -# [*package_name*] -# Name of the java installation package to download from github. -# -# [*install_command*] -# Installation command used to install java. Installation commands -# differ by package_type. 'bin' types are installed via shell command. 'rpmbin' -# types have the rpms extracted and then forcibly installed. 'rpm' types are -# forcibly installed. -# -# [*spacer*] -# Spacer to be used in github download url. In major version 8 this is a simple dash -# in later versions they use a crazy plus sign, which needs to be used in urlencoded -# format -# -# [*download_folder_prefix*] -# Download folder name begins differently depending on the release. After major release -# 8, they have given it a dash. Be aware that even if you want to have a JRE, the folder -# still begins with "jdk" -# -# [*release_minor_url*] -# filled depending on major release. Until major release 8 the minor part needs to be given -# with a 'b' for build, in later versions it is a underscore or a plus sign, which needs -# to be stripped for the download url and is replaced with the given spaces (see above) -# -# [*_package_type*] -# Helper variable which gets filled depending on parameter package_type -# -# [*_basedir*] -# Helper variable which gets filled depending on parameter basedir -# -# [*_version*] -# Helper variable which gets filled depending on parameter version -# -# [*_version_int*] -# Helper variable which gets the value of $_version converted to integer -# -# [*_append_jre*] -# Helper variable which gets filled with the string "-jre" if jre was selected to build the correct install path -# -# [*_release_minor_package_name*] -# Helper variable which gets filled with the right minor string depending on the major version +# @param symlink_name +# The name for the optional symlink in the installation directory. # define java::adopt ( $ensure = 'present', @@ -123,6 +54,8 @@ $basedir = undef, $manage_basedir = true, $package_type = undef, + $manage_symlink = false, + $symlink_name = undef, ) { # archive module is used to download the java package @@ -357,6 +290,14 @@ require => $install_requires } + if ($manage_symlink and $symlink_name) { + file { "${_basedir}/${symlink_name}": + ensure => link, + target => $creates_path, + require => Exec["Install AdoptOpenJDK java ${java} ${_version} ${release_major} ${release_minor}"], + } + } + } default : { fail ("unsupported platform ${$facts['kernel']}") diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index 4cb01d30..514e788e 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -4,6 +4,29 @@ 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 AdoptOpenJDK Java 8 JDK' do let(:params) { { ensure: 'present', version: '8', java: 'jdk' } } let(:title) { 'jdk8' } diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index f9b9c974..ae8ca756 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -55,6 +55,21 @@ it { is_expected.to contain_file('/usr/java/java_home') } end + + context 'when manage_symlink is not set' do + let(:params) do + { + ensure: 'present', + version: '6', + java_se: 'jdk', + basedir: '/usr/java', + url: url, + } + end + let(:title) { 'jdk6_nosymlink' } + + it { is_expected.not_to contain_file('/usr/java/java_home') } + end end context 'with Ubuntu 64-bit' do From 372b5d939a306b0964d8004fa7cd41d4f0a10b44 Mon Sep 17 00:00:00 2001 From: David Swan Date: Wed, 27 May 2020 15:46:26 +0100 Subject: [PATCH 076/259] Release version 6.3.0 --- CHANGELOG.md | 11 ++++++++++- metadata.json | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8acbe11..00f9f116 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ 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) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.2.0...v6.2.0) + +### Added + +- \(MODULES-10681\) Add option to manage symlink to java::adopt [\#429](https://github.com/puppetlabs/puppetlabs-java/pull/429) ([fraenki](https://github.com/fraenki)) +- \(IAC-746\) - Add ubuntu 20.04 support [\#428](https://github.com/puppetlabs/puppetlabs-java/pull/428) ([david22swan](https://github.com/david22swan)) + ## [v6.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.2.0) (2020-02-18) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.1.0...v6.2.0) @@ -48,6 +57,7 @@ All notable changes to this project will be documented in this file. The format - \(FM-8223\) converted to use litmus [\#376](https://github.com/puppetlabs/puppetlabs-java/pull/376) ([tphoney](https://github.com/tphoney)) - Add buster support, default to 11 [\#369](https://github.com/puppetlabs/puppetlabs-java/pull/369) ([mhjacks](https://github.com/mhjacks)) +- Add support for debian buster [\#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) ### Fixed @@ -72,7 +82,6 @@ All notable changes to this project will be documented in this file. The format ### Added -- Add support for debian buster [\#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) - \(FM-7921\) - Implement Puppet Strings [\#353](https://github.com/puppetlabs/puppetlabs-java/pull/353) ([david22swan](https://github.com/david22swan)) - Update default version & java 8 version from 8u192 to 8u201 [\#347](https://github.com/puppetlabs/puppetlabs-java/pull/347) ([valentinsavenko](https://github.com/valentinsavenko)) - Add ability to override basedir and package type for oracle java [\#345](https://github.com/puppetlabs/puppetlabs-java/pull/345) ([fraenki](https://github.com/fraenki)) diff --git a/metadata.json b/metadata.json index f0443817..f223f0c8 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "6.2.0", + "version": "6.3.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From cf2ce99452a0941790925ea9b8393e80754ad83d Mon Sep 17 00:00:00 2001 From: Ciaran McCrisken Date: Fri, 12 Jun 2020 16:33:38 +0100 Subject: [PATCH 077/259] (IAC-886) Remove SLES 11 from release checks --- provision.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/provision.yaml b/provision.yaml index 9a5c6b28..d8132d86 100644 --- a/provision.yaml +++ b/provision.yaml @@ -22,8 +22,8 @@ travis_el7: images: ['litmusimage/centos:7', 'litmusimage/oraclelinux:7', 'litmusimage/scientificlinux:7'] 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'] - \ No newline at end of file + 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'] + From 875d5c420537498f974a0d4f384a5effa8684c1c Mon Sep 17 00:00:00 2001 From: David Swan Date: Tue, 16 Jun 2020 16:24:49 +0100 Subject: [PATCH 078/259] (IAC-890) - Implement CentOS 8 travis tests --- .sync.yml | 1 + .travis.yml | 22 ++++++++++++++++++++++ Gemfile | 2 -- metadata.json | 4 ++-- provision.yaml | 3 +++ 5 files changed, 28 insertions(+), 4 deletions(-) diff --git a/.sync.yml b/.sync.yml index bfca55e9..b7789040 100644 --- a/.sync.yml +++ b/.sync.yml @@ -15,6 +15,7 @@ - travis_deb - travis_el6 - travis_el7 + - travis_el8 complex: - collection: puppet_collection: diff --git a/.travis.yml b/.travis.yml index 78f54026..5bf49567 100644 --- a/.travis.yml +++ b/.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 diff --git a/Gemfile b/Gemfile index adbbe6d0..4f6e33b0 100644 --- a/Gemfile +++ b/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'] diff --git a/metadata.json b/metadata.json index f223f0c8..acccfba8 100644 --- a/metadata.json +++ b/metadata.json @@ -82,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-g88b05c7", - "pdk-version": "1.17.0" + "template-ref": "heads/master-0-g9c14433", + "pdk-version": "1.18.0" } diff --git a/provision.yaml b/provision.yaml index d8132d86..0029ac28 100644 --- a/provision.yaml +++ b/provision.yaml @@ -20,6 +20,9 @@ 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-12-x86_64', 'sles-15-x86_64'] From 24ca4a662a2b28ab5c140228ba53220b762588c4 Mon Sep 17 00:00:00 2001 From: timdeluxe Date: Tue, 14 Jul 2020 17:28:48 +0200 Subject: [PATCH 079/259] Support SAP Javas (sapjvm / sapmachine) --- README.md | 67 ++++++++- REFERENCE.md | 91 ++++++++++++ manifests/sap.pp | 227 ++++++++++++++++++++++++++++ spec/acceptance/install_spec.rb | 59 ++++++++ spec/defines/sap_spec.rb | 255 ++++++++++++++++++++++++++++++++ 5 files changed, 698 insertions(+), 1 deletion(-) create mode 100644 manifests/sap.pp create mode 100644 spec/defines/sap_spec.rb diff --git a/README.md b/README.md index 6a23d2b0..d2f48763 100644 --- a/README.md +++ b/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,6 +107,58 @@ 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. @@ -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. diff --git a/REFERENCE.md b/REFERENCE.md index 260d7c10..f9f6450c 100644 --- a/REFERENCE.md +++ b/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` + diff --git a/manifests/sap.pp b/manifests/sap.pp new file mode 100644 index 00000000..21d5e2c2 --- /dev/null +++ b/manifests/sap.pp @@ -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.070' + if ($java != 'jdk') { + fail('java parameter is not jdk. jre is not supported on version 7') + } + } + '8' : { + $_version_full = '8.1.063' + 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.063-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.") + } + } + +} diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 032fee9b..40b947f2 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -138,6 +138,55 @@ } EOL +sap_enabled = true +sap_version7 = '7' +sap_version7_full = '7.1.070' +sap_version8 = '8' +sap_version8_full = '8.1.063' +sap_version11 = '11' +sap_version11_full = '11.0.7' +sap_version14 = '14' +sap_version14_full = '14.0.1' + +install_sap_jdk_jre = < '#{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 @@ idempotent_apply(install_adopt_jdk_jre) end end + +context 'java::adopt', if: sap_enabled, 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 diff --git a/spec/defines/sap_spec.rb b/spec/defines/sap_spec.rb new file mode 100644 index 00000000..e2449cae --- /dev/null +++ b/spec/defines/sap_spec.rb @@ -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.070-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.063-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.063-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.070-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.063-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 From d26dc21d11346f329ece6a921d3eae0efc8a93b4 Mon Sep 17 00:00:00 2001 From: David Swan Date: Tue, 4 Aug 2020 15:42:38 +0100 Subject: [PATCH 080/259] (IAC-973) - Update travis/appveyor to run on new default branch main --- .travis.yml | 2 +- Rakefile | 13 ++++++------- metadata.json | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5bf49567..849bde0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -150,7 +150,7 @@ jobs: stage: spec branches: only: - - master + - main - /^v\d/ - release notifications: diff --git a/Rakefile b/Rakefile index cb7ed0cc..0a5093b3 100644 --- a/Rakefile +++ b/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 <= 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 diff --git a/metadata.json b/metadata.json index acccfba8..39aeb782 100644 --- a/metadata.json +++ b/metadata.json @@ -82,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#master", - "template-ref": "heads/master-0-g9c14433", - "pdk-version": "1.18.0" + "template-ref": "heads/master-0-gd610ead", + "pdk-version": "1.18.1" } From 82bf74b42acf8fef4ae53bdb629a1d92938502f6 Mon Sep 17 00:00:00 2001 From: Kenyon Ralph Date: Thu, 22 Oct 2020 12:02:15 -0700 Subject: [PATCH 081/259] README: add Ubuntu 20.04 Ubuntu 20.04 support was added in #428. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d2f48763..28ac6921 100644 --- a/README.md +++ b/README.md @@ -194,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 From f90756d87c28f02dde8e6823cb35d96f50fa5891 Mon Sep 17 00:00:00 2001 From: Daiana_Mezdrea Date: Fri, 23 Oct 2020 14:33:40 +0300 Subject: [PATCH 082/259] Add the good links for solving the 404 error and exclude sles --- manifests/sap.pp | 6 +++--- spec/acceptance/install_spec.rb | 6 +++--- spec/defines/sap_spec.rb | 10 +++++----- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/manifests/sap.pp b/manifests/sap.pp index 21d5e2c2..9cb39eec 100644 --- a/manifests/sap.pp +++ b/manifests/sap.pp @@ -70,13 +70,13 @@ # use default versions if full version parameter is not provided case $version { '7' : { - $_version_full = '7.1.070' + $_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.063' + $_version_full = '8.1.065' if ($java != 'jdk') { fail('java parameter is not jdk. jre is not supported on version 8') } @@ -140,7 +140,7 @@ } # download links look like this (examples): - # https://tools.hana.ondemand.com/additional/sapjvm-8.1.063-linux-x64.zip + # 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 diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 40b947f2..7d315642 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -140,9 +140,9 @@ sap_enabled = true sap_version7 = '7' -sap_version7_full = '7.1.070' +sap_version7_full = '7.1.072' sap_version8 = '8' -sap_version8_full = '8.1.063' +sap_version8_full = '8.1.065' sap_version11 = '11' sap_version11_full = '11.0.7' sap_version14 = '14' @@ -269,7 +269,7 @@ end end -context 'java::adopt', if: sap_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do +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 diff --git a/spec/defines/sap_spec.rb b/spec/defines/sap_spec.rb index e2449cae..9d106863 100644 --- a/spec/defines/sap_spec.rb +++ b/spec/defines/sap_spec.rb @@ -31,14 +31,14 @@ let(:params) { { ensure: 'present', version: '7', java: 'jdk' } } let(:title) { 'jdk7' } - it { is_expected.to contain_archive('/tmp/sapjvm-7.1.070-linux-x64.zip') } + 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.063-linux-x64.zip') } + it { is_expected.to contain_archive('/tmp/sapjvm-8.1.065-linux-x64.zip') } end context 'when sapmachine 11 jdk' do @@ -104,7 +104,7 @@ end let(:title) { 'jdk8' } - it { is_expected.to contain_archive('/tmp/sapjvm-8.1.063-linux-x64.zip') } + 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 @@ -129,14 +129,14 @@ let(:params) { { ensure: 'present', version: '7', java: 'jdk' } } let(:title) { 'jdk7' } - it { is_expected.to contain_archive('/tmp/sapjvm-7.1.070-linux-x64.zip') } + 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.063-linux-x64.zip') } + it { is_expected.to contain_archive('/tmp/sapjvm-8.1.065-linux-x64.zip') } end context 'when sapmachine 11 jdk' do From 9ef2748ef351daf0efd32b3a003aafaf2dd69668 Mon Sep 17 00:00:00 2001 From: Ciaran McCrisken Date: Mon, 10 Aug 2020 10:42:25 +0100 Subject: [PATCH 083/259] (IAC-993) - Removal of inappropriate terminology --- .github/workflows/release.yml | 6 +++--- .github/workflows/weekly.yml | 6 +++--- CONTRIBUTING.md | 2 +- README.md | 4 ++-- metadata.json | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 37315319..1f7b70b3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 }} diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml index 6b9b0962..57290e74 100644 --- a/.github/workflows/weekly.yml +++ b/.github/workflows/weekly.yml @@ -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 }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1a9fb3a5..9c171f99 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/README.md b/README.md index d2f48763..d6db73ac 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,7 @@ java::adopt { 'sapjvm8' : ## 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 @@ -177,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. diff --git a/metadata.json b/metadata.json index 39aeb782..42f8460c 100644 --- a/metadata.json +++ b/metadata.json @@ -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-gd610ead", + "template-url": "https://github.com/puppetlabs/pdk-templates#main", + "template-ref": "heads/main-0-gd610ead", "pdk-version": "1.18.1" } From 8d1f9c50fc6294382ab4aa0aaa7f95202e283beb Mon Sep 17 00:00:00 2001 From: David Swan Date: Mon, 9 Nov 2020 14:38:58 +0000 Subject: [PATCH 084/259] Release version 6.4.0 --- CHANGELOG.md | 17 +++++++++++++++-- metadata.json | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00f9f116..d7e765b4 100644 --- a/CHANGELOG.md +++ b/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 diff --git a/metadata.json b/metadata.json index 42f8460c..fd475e40 100644 --- a/metadata.json +++ b/metadata.json @@ -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", From 6aea9f98330bc754dec1989c6b377ffac15c1386 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Tue, 17 Nov 2020 21:22:26 +0000 Subject: [PATCH 085/259] Update pdk-templates for gitpod and codespaces support --- .devcontainer/Dockerfile | 6 ++++++ .devcontainer/devcontainer.json | 23 +++++++++++++++++++++++ .gitpod.Dockerfile | 18 ++++++++++++++++++ .gitpod.yml | 9 +++++++++ .pdkignore | 2 ++ .rubocop.yml | 2 +- .sync.yml | 4 ++++ Gemfile | 1 + data/common.yaml | 1 + hiera.yaml | 21 +++++++++++++++++++++ metadata.json | 2 +- 11 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json create mode 100644 .gitpod.Dockerfile create mode 100644 .gitpod.yml create mode 100644 data/common.yaml create mode 100644 hiera.yaml diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 00000000..12ed4ff1 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,6 @@ +FROM puppet/pdk:latest + +# [Optional] Uncomment this section to install additional packages. +# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ +# && apt-get -y install --no-install-recommends + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 00000000..f1a55dc3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,23 @@ +// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: +// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet +{ + "name": "Puppet Development Kit (Community)", + "dockerFile": "Dockerfile", + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "puppet.puppet-vscode", + "rebornix.Ruby" + ] + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + // "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + // "postCreateCommand": "pdk --version", +} diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000..0814c5e6 --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,18 @@ +FROM gitpod/workspace-full +RUN sudo wget https://apt.puppet.com/puppet-tools-release-bionic.deb && \ + wget https://apt.puppetlabs.com/puppet6-release-bionic.deb && \ + sudo dpkg -i puppet6-release-bionic.deb && \ + sudo dpkg -i puppet-tools-release-bionic.deb && \ + sudo apt-get update && \ + sudo apt-get install -y pdk zsh puppet-agent && \ + sudo apt-get clean && \ + sudo rm -rf /var/lib/apt/lists/* +RUN sudo usermod -s $(which zsh) gitpod && \ + sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \ + echo "plugins=(git gitignore github gem pip bundler python ruby docker docker-compose)" >> /home/gitpod/.zshrc && \ + echo 'PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin"' >> /home/gitpod/.zshrc && \ + sudo /opt/puppetlabs/puppet/bin/gem install puppet-debugger hub -N && \ + mkdir -p /home/gitpod/.config/puppet && \ + /opt/puppetlabs/puppet/bin/ruby -r yaml -e "puts ({'disabled' => true}).to_yaml" > /home/gitpod/.config/puppet/analytics.yml +RUN rm -f puppet6-release-bionic.deb puppet-tools-release-bionic.deb +ENTRYPOINT /usr/bin/zsh diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000..18406c50 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,9 @@ +image: + file: .gitpod.Dockerfile + +tasks: + - init: pdk bundle install + +vscode: + extensions: + - puppet.puppet-vscode@1.0.0:oSzfTkDf6Cmc1jOjgW33VA== diff --git a/.pdkignore b/.pdkignore index e6215cd0..254808c8 100644 --- a/.pdkignore +++ b/.pdkignore @@ -32,6 +32,7 @@ /.gitignore /.gitlab-ci.yml /.pdkignore +/.puppet-lint.rc /Rakefile /rakelib/ /.rspec @@ -40,3 +41,4 @@ /.yardopts /spec/ /.vscode/ +/.sync.yml diff --git a/.rubocop.yml b/.rubocop.yml index 5307849e..858882d1 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -43,7 +43,7 @@ Style/BlockDelimiters: Style/BracesAroundHashParameters: Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0. See https://github.com/rubocop-hq/rubocop/pull/7643 - Enabled: true + Enabled: false Style/ClassAndModuleChildren: Description: Compact style reduces the required amount of indentation. EnforcedStyle: compact diff --git a/.sync.yml b/.sync.yml index b7789040..508072f9 100644 --- a/.sync.yml +++ b/.sync.yml @@ -43,3 +43,7 @@ Gemfile: spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true +.gitpod.Dockerfile: + unmanaged: false +.gitpod.yml: + unmanaged: false diff --git a/Gemfile b/Gemfile index 4f6e33b0..b6b25afe 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.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.4', require: false, platforms: [:ruby] gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby] diff --git a/data/common.yaml b/data/common.yaml new file mode 100644 index 00000000..2fbf0ffd --- /dev/null +++ b/data/common.yaml @@ -0,0 +1 @@ +--- {} diff --git a/hiera.yaml b/hiera.yaml new file mode 100644 index 00000000..545fff32 --- /dev/null +++ b/hiera.yaml @@ -0,0 +1,21 @@ +--- +version: 5 + +defaults: # Used for any hierarchy level that omits these keys. + datadir: data # This path is relative to hiera.yaml's directory. + data_hash: yaml_data # Use the built-in YAML backend. + +hierarchy: + - name: "osfamily/major release" + paths: + # Used to distinguish between Debian and Ubuntu + - "os/%{facts.os.name}/%{facts.os.release.major}.yaml" + - "os/%{facts.os.family}/%{facts.os.release.major}.yaml" + # Used for Solaris + - "os/%{facts.os.family}/%{facts.kernelrelease}.yaml" + - name: "osfamily" + paths: + - "os/%{facts.os.name}.yaml" + - "os/%{facts.os.family}.yaml" + - name: 'common' + path: 'common.yaml' diff --git a/metadata.json b/metadata.json index fd475e40..d1d4aa83 100644 --- a/metadata.json +++ b/metadata.json @@ -82,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-gd610ead", + "template-ref": "heads/main-0-g874030e", "pdk-version": "1.18.1" } From 460daa1a80501a447c654da9c94724a60d68c502 Mon Sep 17 00:00:00 2001 From: sheena Date: Fri, 13 Nov 2020 12:08:33 +0000 Subject: [PATCH 086/259] (maint) add java module to ci --- .github/workflows/nightly.yml | 146 ++++++++++++++++++++++++++++++++++ .github/workflows/pr_test.yml | 126 +++++++++++++++++++++++++++++ .sync.yml | 7 ++ Gemfile | 2 + 4 files changed, 281 insertions(+) create mode 100644 .github/workflows/nightly.yml create mode 100644 .github/workflows/pr_test.yml diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 00000000..5dfe7a18 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,146 @@ +name: "nightly" + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 + HONEYCOMB_DATASET: litmus tests + +jobs: + setup_matrix: + name: "Setup Test Matrix" + runs-on: ubuntu-20.04 + outputs: + matrix: ${{ steps.get-matrix.outputs.matrix }} + steps: + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Activate Ruby 2.7 + uses: actions/setup-ruby@v1 + with: + ruby-version: "2.7" + + - name: Cache gems + uses: actions/cache@v2 + with: + path: vendor/gems + key: ${{ runner.os }}-nightly-${{ hashFiles('**/Gemfile') }} + restore-keys: | + ${{ runner.os }}-nightly- + ${{ runner.os }}- + + - name: Install gems + run: | + bundle config path vendor/gems + bundle config jobs 8 + bundle config retry 3 + bundle install + bundle clean + + - name: Setup Acceptance Test Matrix + id: get-matrix + run: "bundle exec matrix_from_metadata" + + Acceptance: + needs: + - setup_matrix + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} + + steps: + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Activate Ruby 2.7 + uses: actions/setup-ruby@v1 + with: + ruby-version: "2.7" + + - name: Cache gems + uses: actions/cache@v2 + with: + path: vendor/gems + key: ${{ runner.os }}-nightly-${{ hashFiles('**/Gemfile') }} + restore-keys: | + ${{ runner.os }}-nightly- + ${{ runner.os }}- + + - name: Install gems + run: | + bundle config path vendor/gems + bundle config jobs 8 + bundle config retry 3 + bundle install + bundle clean + + - name: bundler environment + run: | + bundle env + + - name: Provision test environment + run: | + bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]' + echo ::group::=== REQUEST === + cat request.json || true + echo + echo ::endgroup:: + echo ::group::=== INVENTORY === + sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true + echo ::endgroup:: + + # The provision service hands out machines as soon as they're provisioned. + # The GCP VMs might still take a while to spool up and configure themselves fully. + # This retry loop spins until all agents have been installed successfully. + - name: Install agent + uses: nick-invision/retry@v1 + with: + timeout_minutes: 30 + max_attempts: 5 + retry_wait_seconds: 90 + command: bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' + + # The agent installer on windows does not finish in time for this to work. To + # work around this for now, retry after a minute if installing the module failed. + - name: Install module + uses: nick-invision/retry@v1 + with: + timeout_minutes: 30 + max_attempts: 5 + retry_wait_seconds: 60 + command: bundle exec rake 'litmus:install_module' + + - name: Run acceptance tests + run: bundle exec rake 'litmus:acceptance:parallel' + + - name: Remove test environment + if: ${{ always() }} + run: | + bundle exec rake 'litmus:tear_down' + echo ::group::=== REQUEST === + cat request.json || true + echo + echo ::endgroup:: + + slack-workflow-status: + if: always() + name: Post Workflow Status To Slack + needs: + - Acceptance + runs-on: ubuntu-20.04 + steps: + - name: Slack Workflow Notification + uses: Gamesight/slack-workflow-status@master + with: + # Required Input + repo_token: ${{secrets.GITHUB_TOKEN}} + slack_webhook_url: ${{secrets.SLACK_WEBHOOK}} + # Optional Input + channel: '#team-ia-bots' + name: 'GABot' diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml new file mode 100644 index 00000000..7b47199f --- /dev/null +++ b/.github/workflows/pr_test.yml @@ -0,0 +1,126 @@ +name: "PR Testing" + +on: [pull_request] + +env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 + HONEYCOMB_DATASET: litmus tests + +jobs: + setup_matrix: + name: "Setup Test Matrix" + runs-on: ubuntu-20.04 + outputs: + matrix: ${{ steps.get-matrix.outputs.matrix }} + steps: + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Activate Ruby 2.7 + uses: actions/setup-ruby@v1 + with: + ruby-version: "2.7" + + - name: Cache gems + uses: actions/cache@v2 + with: + path: vendor/gems + key: ${{ runner.os }}-pr-${{ hashFiles('**/Gemfile') }} + restore-keys: | + ${{ runner.os }}-pr- + ${{ runner.os }}- + + - name: Install gems + run: | + bundle config path vendor/gems + bundle config jobs 8 + bundle config retry 3 + bundle install + bundle clean + + - name: Setup Acceptance Test Matrix + id: get-matrix + run: "bundle exec matrix_from_metadata" + + Acceptance: + needs: + - setup_matrix + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} + + steps: + - name: Checkout Source + uses: actions/checkout@v2 + + - name: Activate Ruby 2.7 + uses: actions/setup-ruby@v1 + with: + ruby-version: "2.7" + + - name: Cache gems + uses: actions/cache@v2 + with: + path: vendor/gems + key: ${{ runner.os }}-pr-${{ hashFiles('**/Gemfile') }} + restore-keys: | + ${{ runner.os }}-pr- + ${{ runner.os }}- + + - name: Install gems + run: | + bundle config path vendor/gems + bundle config jobs 8 + bundle config retry 3 + bundle install + bundle clean + + - name: bundler environment + run: | + bundle env + + - name: Provision test environment + run: | + bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]' + echo ::group::=== REQUEST === + cat request.json || true + echo + echo ::endgroup:: + echo ::group::=== INVENTORY === + sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true + echo ::endgroup:: + + # The provision service hands out machines as soon as they're provisioned. + # The GCP VMs might still take a while to spool up and configure themselves fully. + # This retry loop spins until all agents have been installed successfully. + - name: Install agent + uses: nick-invision/retry@v1 + with: + timeout_minutes: 30 + max_attempts: 5 + retry_wait_seconds: 90 + command: bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' + + # The agent installer on windows does not finish in time for this to work. To + # work around this for now, retry after a minute if installing the module failed. + - name: Install module + uses: nick-invision/retry@v1 + with: + timeout_minutes: 30 + max_attempts: 5 + retry_wait_seconds: 60 + command: bundle exec rake 'litmus:install_module' + + - name: Run acceptance tests + run: bundle exec rake 'litmus:acceptance:parallel' + + - name: Remove test environment + if: ${{ always() }} + run: | + bundle exec rake 'litmus:tear_down' + echo ::group::=== REQUEST === + cat request.json || true + echo + echo ::endgroup:: diff --git a/.sync.yml b/.sync.yml index 508072f9..04584769 100644 --- a/.sync.yml +++ b/.sync.yml @@ -40,6 +40,13 @@ Gemfile: git: https://github.com/skywinder/github-changelog-generator ref: 20ee04ba1234e9e83eb2ffb5056e23d641c7a018 condition: Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.2.2') + - gem: puppet_litmus + git: https://github.com/puppetlabs/puppet_litmus + ref: main + condition: Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0') + - gem: bolt + version: '2.32.0' + condition: Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0') spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true diff --git a/Gemfile b/Gemfile index b6b25afe..84b04e80 100644 --- a/Gemfile +++ b/Gemfile @@ -30,6 +30,8 @@ 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 "puppet_litmus", require: false, git: 'https://github.com/puppetlabs/puppet_litmus', ref: 'main' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0') + gem "bolt", '2.32.0', require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0') end puppet_version = ENV['PUPPET_GEM_VERSION'] From 92102956066e161aedd830cf2ddf4759a84d65d7 Mon Sep 17 00:00:00 2001 From: sheena Date: Mon, 23 Nov 2020 09:50:01 +0000 Subject: [PATCH 087/259] (maint) remove old workflow --- .github/workflows/release.yml | 71 ----------------------------------- .github/workflows/weekly.yml | 64 ------------------------------- 2 files changed, 135 deletions(-) delete mode 100644 .github/workflows/release.yml delete mode 100644 .github/workflows/weekly.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 1f7b70b3..00000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,71 +0,0 @@ -name: "release" - -on: - push: - branches: - - 'release' - -jobs: - LitmusAcceptancePuppet5: - env: - HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 - HONEYCOMB_DATASET: litmus tests - runs-on: self-hosted - strategy: - matrix: - ruby_version: [2.5.x] - puppet_gem_version: [~> 6.0] - platform: [release_checks_5] - agent_family: ['puppet5'] - - steps: - - uses: actions/checkout@v1 - - name: Litmus Parallel - uses: puppetlabs/action-litmus_parallel@main - with: - platform: ${{ matrix.platform }} - agent_family: ${{ matrix.agent_family }} - LitmusAcceptancePuppet6: - env: - HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 - HONEYCOMB_DATASET: litmus tests - runs-on: self-hosted - strategy: - matrix: - ruby_version: [2.5.x] - puppet_gem_version: [~> 6.0] - platform: [release_checks_6] - agent_family: ['puppet6'] - - steps: - - uses: actions/checkout@v1 - - name: Litmus Parallel - uses: puppetlabs/action-litmus_parallel@main - with: - platform: ${{ matrix.platform }} - agent_family: ${{ matrix.agent_family }} - - Spec: - runs-on: self-hosted - - strategy: - matrix: - check: [spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'] - ruby_version: [2.4.x, 2.5.x] - puppet_gem_version: [~> 5.0, ~> 6.0] - exclude: - - puppet_gem_version: ~> 5.0 - check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop' - - ruby_version: 2.4.x - puppet_gem_version: ~> 6.0 - - ruby_version: 2.5.x - puppet_gem_version: ~> 5.0 - - steps: - - uses: actions/checkout@v1 - - - name: Spec Tests - uses: puppetlabs/action-litmus_spec@main - with: - puppet_gem_versionm: ${{ matrix.puppet_gem_version }} - check: ${{ matrix.check }} diff --git a/.github/workflows/weekly.yml b/.github/workflows/weekly.yml deleted file mode 100644 index 57290e74..00000000 --- a/.github/workflows/weekly.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: "weekly" - -on: - schedule: - - cron: '0 5 * * 5' - -jobs: - LitmusAcceptancePuppet5: - env: - HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 - HONEYCOMB_DATASET: litmus tests - runs-on: self-hosted - strategy: - matrix: - ruby_version: [2.5.x] - puppet_gem_version: [~> 6.0] - platform: [release_checks_5] - agent_family: ['puppet5'] - - steps: - - uses: actions/checkout@v1 - - name: Litmus Parallel - uses: puppetlabs/action-litmus_parallel@main - with: - platform: ${{ matrix.platform }} - agent_family: ${{ matrix.agent_family }} - LitmusAcceptancePuppet6: - env: - HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 - HONEYCOMB_DATASET: litmus tests - runs-on: self-hosted - strategy: - matrix: - ruby_version: [2.5.x] - puppet_gem_version: [~> 6.0] - platform: [release_checks_6] - agent_family: ['puppet6'] - - steps: - - uses: actions/checkout@v1 - - name: Litmus Parallel - uses: puppetlabs/action-litmus_parallel@main - with: - platform: ${{ matrix.platform }} - agent_family: ${{ matrix.agent_family }} - Spec: - runs-on: self-hosted - strategy: - matrix: - check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'] - ruby_version: [2.5.x] - puppet_gem_version: [~> 5.0, ~> 6.0] - exclude: - - puppet_gem_version: ~> 5.0 - check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop' - - ruby_version: 2.5.x - puppet_gem_version: ~> 5.0 - steps: - - uses: actions/checkout@v1 - - name: Spec Tests - uses: puppetlabs/action-litmus_spec@main - with: - puppet_gem_version: ${{ matrix.puppet_gem_version }} - check: ${{ matrix.check }} From d9969df1484dabce08b40758b5c896cf455a0547 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Tue, 24 Nov 2020 15:27:17 +0200 Subject: [PATCH 088/259] PDK Update for GA workflows --- .github/workflows/nightly.yml | 148 ++++++++++++++++++++++++++-------- .github/workflows/pr_test.yml | 143 +++++++++++++++++++++++++------- .sync.yml | 4 + metadata.json | 2 +- 4 files changed, 235 insertions(+), 62 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5dfe7a18..d59437aa 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -3,7 +3,6 @@ name: "nightly" on: schedule: - cron: '0 0 * * *' - workflow_dispatch: env: HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 @@ -15,35 +14,63 @@ jobs: runs-on: ubuntu-20.04 outputs: matrix: ${{ steps.get-matrix.outputs.matrix }} + steps: + - name: "Honeycomb: Start recording" + uses: kvrhdn/gha-buildevents@v1.0.2 + with: + apikey: ${{ env.HONEYCOMB_WRITEKEY }} + dataset: ${{ env.HONEYCOMB_DATASET }} + job-status: ${{ job.status }} + + - name: "Honeycomb: Start first step" + run: | + echo STEP_ID=0 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + - name: Checkout Source uses: actions/checkout@v2 + if: ${{ github.repository_owner == 'puppetlabs' }} - name: Activate Ruby 2.7 uses: actions/setup-ruby@v1 + if: ${{ github.repository_owner == 'puppetlabs' }} with: ruby-version: "2.7" - name: Cache gems uses: actions/cache@v2 + if: ${{ github.repository_owner == 'puppetlabs' }} with: path: vendor/gems - key: ${{ runner.os }}-nightly-${{ hashFiles('**/Gemfile') }} + key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }} restore-keys: | - ${{ runner.os }}-nightly- + ${{ runner.os }}-${{ github.event_name }}- ${{ runner.os }}- - name: Install gems + if: ${{ github.repository_owner == 'puppetlabs' }} run: | - bundle config path vendor/gems - bundle config jobs 8 - bundle config retry 3 - bundle install - bundle clean + buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems + buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8 + buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3 + buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install + buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean - name: Setup Acceptance Test Matrix id: get-matrix - run: "bundle exec matrix_from_metadata" + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then + buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata + else + echo "::set-output name=matrix::{}" + fi + + - name: "Honeycomb: Record setup time" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' Acceptance: needs: @@ -54,7 +81,27 @@ jobs: fail-fast: false matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} + env: + BUILDEVENT_FILE: '../buildevents.txt' + steps: + - run: | + echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE + echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE + + - name: "Honeycomb: Start recording" + uses: kvrhdn/gha-buildevents@v1.0.2 + with: + apikey: ${{ env.HONEYCOMB_WRITEKEY }} + dataset: ${{ env.HONEYCOMB_DATASET }} + job-status: ${{ job.status }} + matrix-key: ${{ matrix.platform }}-${{ matrix.collection }} + + - name: "Honeycomb: start first step" + run: | + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + - name: Checkout Source uses: actions/checkout@v2 @@ -67,26 +114,39 @@ jobs: uses: actions/cache@v2 with: path: vendor/gems - key: ${{ runner.os }}-nightly-${{ hashFiles('**/Gemfile') }} + key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }} restore-keys: | - ${{ runner.os }}-nightly- + ${{ runner.os }}-${{ github.event_name }}- ${{ runner.os }}- - - name: Install gems + - name: "Honeycomb: Record cache setup time" + if: ${{ always() }} run: | - bundle config path vendor/gems - bundle config jobs 8 - bundle config retry 3 - bundle install - bundle clean + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: bundler environment + - name: Bundler Setup run: | - bundle env + buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems + buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8 + buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3 + buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install + buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean + echo ::group::bundler environment + buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env + echo ::endgroup:: + + - name: "Honeycomb: Record Bundler Setup time" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Provision test environment run: | - bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]' + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]' echo ::group::=== REQUEST === cat request.json || true echo @@ -103,8 +163,8 @@ jobs: with: timeout_minutes: 30 max_attempts: 5 - retry_wait_seconds: 90 - command: bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' + retry_wait_seconds: 60 + command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' # The agent installer on windows does not finish in time for this to work. To # work around this for now, retry after a minute if installing the module failed. @@ -112,21 +172,45 @@ jobs: uses: nick-invision/retry@v1 with: timeout_minutes: 30 - max_attempts: 5 + max_attempts: 2 retry_wait_seconds: 60 - command: bundle exec rake 'litmus:install_module' + command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' + + - name: "Honeycomb: Record deployment times" + if: ${{ always() }} + run: | + echo ::group::honeycomb step + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + echo ::endgroup:: - name: Run acceptance tests - run: bundle exec rake 'litmus:acceptance:parallel' + run: | + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel' + + - name: "Honeycomb: Record acceptance testing times" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Remove test environment if: ${{ always() }} run: | - bundle exec rake 'litmus:tear_down' - echo ::group::=== REQUEST === - cat request.json || true - echo - echo ::endgroup:: + if [ -f inventory.yaml ]; then + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' + echo ::group::=== REQUEST === + cat request.json || true + echo + echo ::endgroup:: + fi + + - name: "Honeycomb: Record removal times" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment' slack-workflow-status: if: always() @@ -139,8 +223,8 @@ jobs: uses: Gamesight/slack-workflow-status@master with: # Required Input - repo_token: ${{secrets.GITHUB_TOKEN}} - slack_webhook_url: ${{secrets.SLACK_WEBHOOK}} + repo_token: ${{ secrets.GITHUB_TOKEN }} + slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} # Optional Input channel: '#team-ia-bots' name: 'GABot' diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index 7b47199f..17f5a649 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -12,35 +12,63 @@ jobs: runs-on: ubuntu-20.04 outputs: matrix: ${{ steps.get-matrix.outputs.matrix }} + steps: + - name: "Honeycomb: Start recording" + uses: kvrhdn/gha-buildevents@v1.0.2 + with: + apikey: ${{ env.HONEYCOMB_WRITEKEY }} + dataset: ${{ env.HONEYCOMB_DATASET }} + job-status: ${{ job.status }} + + - name: "Honeycomb: Start first step" + run: | + echo STEP_ID=0 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + - name: Checkout Source uses: actions/checkout@v2 + if: ${{ github.repository_owner == 'puppetlabs' }} - name: Activate Ruby 2.7 uses: actions/setup-ruby@v1 + if: ${{ github.repository_owner == 'puppetlabs' }} with: ruby-version: "2.7" - name: Cache gems uses: actions/cache@v2 + if: ${{ github.repository_owner == 'puppetlabs' }} with: path: vendor/gems - key: ${{ runner.os }}-pr-${{ hashFiles('**/Gemfile') }} + key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }} restore-keys: | - ${{ runner.os }}-pr- + ${{ runner.os }}-${{ github.event_name }}- ${{ runner.os }}- - name: Install gems + if: ${{ github.repository_owner == 'puppetlabs' }} run: | - bundle config path vendor/gems - bundle config jobs 8 - bundle config retry 3 - bundle install - bundle clean + buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems + buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8 + buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3 + buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install + buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean - name: Setup Acceptance Test Matrix id: get-matrix - run: "bundle exec matrix_from_metadata" + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then + buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata + else + echo "::set-output name=matrix::{}" + fi + + - name: "Honeycomb: Record setup time" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' Acceptance: needs: @@ -51,7 +79,27 @@ jobs: fail-fast: false matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} + env: + BUILDEVENT_FILE: '../buildevents.txt' + steps: + - run: | + echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE + echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE + + - name: "Honeycomb: Start recording" + uses: kvrhdn/gha-buildevents@v1.0.2 + with: + apikey: ${{ env.HONEYCOMB_WRITEKEY }} + dataset: ${{ env.HONEYCOMB_DATASET }} + job-status: ${{ job.status }} + matrix-key: ${{ matrix.platform }}-${{ matrix.collection }} + + - name: "Honeycomb: start first step" + run: | + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + - name: Checkout Source uses: actions/checkout@v2 @@ -64,26 +112,39 @@ jobs: uses: actions/cache@v2 with: path: vendor/gems - key: ${{ runner.os }}-pr-${{ hashFiles('**/Gemfile') }} + key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }} restore-keys: | - ${{ runner.os }}-pr- + ${{ runner.os }}-${{ github.event_name }}- ${{ runner.os }}- - - name: Install gems + - name: "Honeycomb: Record cache setup time" + if: ${{ always() }} run: | - bundle config path vendor/gems - bundle config jobs 8 - bundle config retry 3 - bundle install - bundle clean + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: bundler environment + - name: Bundler Setup run: | - bundle env + buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems + buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8 + buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3 + buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install + buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean + echo ::group::bundler environment + buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env + echo ::endgroup:: + + - name: "Honeycomb: Record Bundler Setup time" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Provision test environment run: | - bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]' + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]' echo ::group::=== REQUEST === cat request.json || true echo @@ -100,8 +161,8 @@ jobs: with: timeout_minutes: 30 max_attempts: 5 - retry_wait_seconds: 90 - command: bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' + retry_wait_seconds: 60 + command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' # The agent installer on windows does not finish in time for this to work. To # work around this for now, retry after a minute if installing the module failed. @@ -109,18 +170,42 @@ jobs: uses: nick-invision/retry@v1 with: timeout_minutes: 30 - max_attempts: 5 + max_attempts: 2 retry_wait_seconds: 60 - command: bundle exec rake 'litmus:install_module' + command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' + + - name: "Honeycomb: Record deployment times" + if: ${{ always() }} + run: | + echo ::group::honeycomb step + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + echo ::endgroup:: - name: Run acceptance tests - run: bundle exec rake 'litmus:acceptance:parallel' + run: | + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel' + + - name: "Honeycomb: Record acceptance testing times" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Remove test environment if: ${{ always() }} run: | - bundle exec rake 'litmus:tear_down' - echo ::group::=== REQUEST === - cat request.json || true - echo - echo ::endgroup:: + if [ -f inventory.yaml ]; then + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' + echo ::group::=== REQUEST === + cat request.json || true + echo + echo ::endgroup:: + fi + + - name: "Honeycomb: Record removal times" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment' diff --git a/.sync.yml b/.sync.yml index 04584769..2c0f5e1d 100644 --- a/.sync.yml +++ b/.sync.yml @@ -54,3 +54,7 @@ spec/spec_helper.rb: unmanaged: false .gitpod.yml: unmanaged: false +.github/workflows/nightly.yml: + unmanaged: false +.github/workflows/pr_test.yml: + unmanaged: false diff --git a/metadata.json b/metadata.json index d1d4aa83..480d4459 100644 --- a/metadata.json +++ b/metadata.json @@ -82,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-g874030e", + "template-ref": "heads/main-0-g5afcd3d", "pdk-version": "1.18.1" } From f3bfd78279b2cd09e9a9d884b8c4cff3c908e584 Mon Sep 17 00:00:00 2001 From: Ciaran McCrisken Date: Wed, 25 Nov 2020 13:28:27 +0000 Subject: [PATCH 089/259] (maint) Add release_checks_7 config to provision.yaml --- provision.yaml | 94 +++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 12 deletions(-) diff --git a/provision.yaml b/provision.yaml index 0029ac28..657a2a1a 100644 --- a/provision.yaml +++ b/provision.yaml @@ -1,32 +1,102 @@ --- default: - provisioner: docker - images: ['litmusimage/debian:8'] + provisioner: docker + images: + - litmusimage/debian:8 vagrant: provisioner: vagrant - images: ['centos/7', 'generic/ubuntu1804'] + images: + - centos/7 + - generic/ubuntu1804 travis_deb: provisioner: docker - images: ['litmusimage/debian:8', 'litmusimage/debian:9', 'litmusimage/debian:10'] + images: + - litmusimage/debian:8 + - litmusimage/debian:9 + - litmusimage/debian:10 travis_ub_5: provisioner: docker - images: ['litmusimage/ubuntu:14.04', 'litmusimage/ubuntu:16.04', 'litmusimage/ubuntu:18.04'] + images: + - litmusimage/ubuntu:14.04 + - litmusimage/ubuntu:16.04 + - litmusimage/ubuntu:18.04 travis_ub_6: provisioner: docker - images: ['litmusimage/ubuntu:14.04', 'litmusimage/ubuntu:16.04', 'litmusimage/ubuntu:18.04', 'litmusimage/ubuntu:20.04'] + images: + - litmusimage/ubuntu:14.04 + - litmusimage/ubuntu:16.04 + - litmusimage/ubuntu:18.04 + - litmusimage/ubuntu:20.04 travis_el6: provisioner: docker - images: ['litmusimage/centos:6', 'litmusimage/oraclelinux:6', 'litmusimage/scientificlinux:6'] + images: + - litmusimage/centos:6 + - litmusimage/oraclelinux:6 + - litmusimage/scientificlinux:6 travis_el7: provisioner: docker - images: ['litmusimage/centos:7', 'litmusimage/oraclelinux:7', 'litmusimage/scientificlinux:7'] + images: + - litmusimage/centos:7 + - litmusimage/oraclelinux:7 + - litmusimage/scientificlinux:7 travis_el8: provisioner: docker - images: ['litmusimage/centos:8'] + 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-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-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 +release_checks_7: + provisioner: abs + images: + - redhat-7-x86_64 + - redhat-8-x86_64 + - centos-7-x86_64 + - centos-8-x86_64 + - oracle-7-x86_64 + - debian-9-x86_64 + - debian-10-x86_64 + - ubuntu-1804-x86_64 + - ubuntu-2004-x86_64 + - sles-12-x86_64 + - sles-15-x86_64 From 6a8f03bb172577804ec780b9a3aebf4a153f8989 Mon Sep 17 00:00:00 2001 From: Daiana_Mezdrea Date: Thu, 3 Dec 2020 16:34:12 +0200 Subject: [PATCH 090/259] (feat) - Bump Puppet boundary --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 480d4459..65831595 100644 --- a/metadata.json +++ b/metadata.json @@ -78,7 +78,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 5.5.10 < 7.0.0" + "version_requirement": ">= 5.5.10 < 8.0.0" } ], "template-url": "https://github.com/puppetlabs/pdk-templates#main", From 3667063d073236b645deb7a746c82735aea4d3ec Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 7 Dec 2020 17:23:47 +0200 Subject: [PATCH 091/259] Remove EL6 testing from Travis --- .sync.yml | 1 - .travis.yml | 22 ---------------------- provision.yaml | 6 ------ 3 files changed, 29 deletions(-) diff --git a/.sync.yml b/.sync.yml index 2c0f5e1d..632c490a 100644 --- a/.sync.yml +++ b/.sync.yml @@ -13,7 +13,6 @@ provision_list: - ---travis_el - travis_deb - - travis_el6 - travis_el7 - travis_el8 complex: diff --git a/.travis.yml b/.travis.yml index 849bde0b..3af64e62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -60,17 +60,6 @@ jobs: script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - - before_script: - - "bundle exec rake 'litmus:provision_list[travis_el6]'" - - "bundle exec rake 'litmus:install_agent[puppet5]'" - - "bundle exec rake litmus:install_module" - bundler_args: - env: PLATFORMS=travis_el6_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_el7]'" @@ -104,17 +93,6 @@ jobs: script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - - before_script: - - "bundle exec rake 'litmus:provision_list[travis_el6]'" - - "bundle exec rake 'litmus:install_agent[puppet6]'" - - "bundle exec rake litmus:install_module" - bundler_args: - env: PLATFORMS=travis_el6_puppet6 - 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_el7]'" diff --git a/provision.yaml b/provision.yaml index 657a2a1a..7f9ab15a 100644 --- a/provision.yaml +++ b/provision.yaml @@ -27,12 +27,6 @@ travis_ub_6: - litmusimage/ubuntu:16.04 - litmusimage/ubuntu:18.04 - litmusimage/ubuntu:20.04 -travis_el6: - provisioner: docker - images: - - litmusimage/centos:6 - - litmusimage/oraclelinux:6 - - litmusimage/scientificlinux:6 travis_el7: provisioner: docker images: From 1dda22762e02b174af40aa415268f44bd82dfdba Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 16 Dec 2020 13:44:06 +0000 Subject: [PATCH 092/259] Update to pdk-templates and puppet-module-gems 1.0.0 --- .github/workflows/nightly.yml | 27 +-- .github/workflows/pr_test.yml | 25 +- .rubocop.yml | 439 ++++++++++++++++++++++++++++++++-- .sync.yml | 12 +- .travis.yml | 24 +- Gemfile | 21 +- metadata.json | 2 +- 7 files changed, 450 insertions(+), 100 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d59437aa..4021da76 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,7 +17,7 @@ jobs: steps: - name: "Honeycomb: Start recording" - uses: kvrhdn/gha-buildevents@v1.0.2 + uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2 with: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} @@ -90,7 +90,7 @@ jobs: echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE - name: "Honeycomb: Start recording" - uses: kvrhdn/gha-buildevents@v1.0.2 + uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2 with: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} @@ -155,26 +155,13 @@ jobs: sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true echo ::endgroup:: - # The provision service hands out machines as soon as they're provisioned. - # The GCP VMs might still take a while to spool up and configure themselves fully. - # This retry loop spins until all agents have been installed successfully. - name: Install agent - uses: nick-invision/retry@v1 - with: - timeout_minutes: 30 - max_attempts: 5 - retry_wait_seconds: 60 - command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' + run: | + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' - # The agent installer on windows does not finish in time for this to work. To - # work around this for now, retry after a minute if installing the module failed. - name: Install module - uses: nick-invision/retry@v1 - with: - timeout_minutes: 30 - max_attempts: 2 - retry_wait_seconds: 60 - command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' + run: | + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' - name: "Honeycomb: Record deployment times" if: ${{ always() }} @@ -220,7 +207,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Slack Workflow Notification - uses: Gamesight/slack-workflow-status@master + uses: Gamesight/slack-workflow-status@88ee95b73b4669825883ddf22747966204663e58 # pin@master with: # Required Input repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index 17f5a649..2b5ab1f5 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -15,7 +15,7 @@ jobs: steps: - name: "Honeycomb: Start recording" - uses: kvrhdn/gha-buildevents@v1.0.2 + uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2 with: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} @@ -88,7 +88,7 @@ jobs: echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE - name: "Honeycomb: Start recording" - uses: kvrhdn/gha-buildevents@v1.0.2 + uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2 with: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} @@ -153,26 +153,13 @@ jobs: sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true echo ::endgroup:: - # The provision service hands out machines as soon as they're provisioned. - # The GCP VMs might still take a while to spool up and configure themselves fully. - # This retry loop spins until all agents have been installed successfully. - name: Install agent - uses: nick-invision/retry@v1 - with: - timeout_minutes: 30 - max_attempts: 5 - retry_wait_seconds: 60 - command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' + run: | + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' - # The agent installer on windows does not finish in time for this to work. To - # work around this for now, retry after a minute if installing the module failed. - name: Install module - uses: nick-invision/retry@v1 - with: - timeout_minutes: 30 - max_attempts: 2 - retry_wait_seconds: 60 - command: buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' + run: | + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' - name: "Honeycomb: Record deployment times" if: ${{ always() }} diff --git a/.rubocop.yml b/.rubocop.yml index 858882d1..33c33fa5 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,12 +1,12 @@ --- require: +- rubocop-performance - rubocop-rspec -- rubocop-i18n AllCops: DisplayCopNames: true - TargetRubyVersion: '2.1' + TargetRubyVersion: '2.4' Include: - - "./**/*.rb" + - "**/*.rb" Exclude: - bin/* - ".vendor/**/*" @@ -18,16 +18,9 @@ AllCops: - "**/Puppetfile" - "**/Vagrantfile" - "**/Guardfile" -Metrics/LineLength: +Layout/LineLength: Description: People have wide screens, use them. Max: 200 -GetText: - Enabled: false -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. @@ -40,10 +33,6 @@ Style/BlockDelimiters: Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then. EnforcedStyle: braces_for_chaining -Style/BracesAroundHashParameters: - Description: Braces are required by Ruby 2.7. Cop removed from RuboCop v0.80.0. - See https://github.com/rubocop-hq/rubocop/pull/7643 - Enabled: false Style/ClassAndModuleChildren: Description: Compact style reduces the required amount of indentation. EnforcedStyle: compact @@ -72,7 +61,7 @@ Style/TrailingCommaInArguments: Description: Prefer always trailing comma on multiline argument lists. This makes diffs, and re-ordering nicer. EnforcedStyleForMultiline: comma -Style/TrailingCommaInLiteral: +Style/TrailingCommaInArrayLiteral: Description: Prefer always trailing comma on multiline literals. This makes diffs, and re-ordering nicer. EnforcedStyleForMultiline: comma @@ -87,21 +76,219 @@ Style/Documentation: - spec/**/* Style/WordArray: EnforcedStyle: brackets +Performance/AncestorsInclude: + Enabled: true +Performance/BigDecimalWithNumericArgument: + Enabled: true +Performance/BlockGivenWithExplicitBlock: + Enabled: true +Performance/Caller: + Enabled: true +Performance/CaseWhenSplat: + Enabled: true +Performance/Casecmp: + Enabled: true +Performance/CollectionLiteralInLoop: + Enabled: true +Performance/CompareWithBlock: + Enabled: true +Performance/ConstantRegexp: + Enabled: true +Performance/Count: + Enabled: true +Performance/Detect: + Enabled: true +Performance/DoubleStartEndWith: + Enabled: true +Performance/EndWith: + Enabled: true +Performance/FixedSize: + Enabled: true +Performance/FlatMap: + Enabled: true +Performance/MethodObjectAsBlock: + Enabled: true +Performance/RangeInclude: + Enabled: true +Performance/RedundantBlockCall: + Enabled: true +Performance/RedundantMatch: + Enabled: true +Performance/RedundantMerge: + Enabled: true +Performance/RedundantSortBlock: + Enabled: true +Performance/RedundantStringChars: + Enabled: true +Performance/RegexpMatch: + Enabled: true +Performance/ReverseEach: + Enabled: true +Performance/ReverseFirst: + Enabled: true +Performance/Size: + Enabled: true +Performance/SortReverse: + Enabled: true +Performance/Squeeze: + Enabled: true +Performance/StartWith: + Enabled: true +Performance/StringInclude: + Enabled: true +Performance/StringReplacement: + Enabled: true +Performance/Sum: + Enabled: true +Performance/TimesMap: + Enabled: true Style/CollectionMethods: Enabled: true Style/MethodCalledOnDoEndBlock: Enabled: true Style/StringMethods: Enabled: true -GetText/DecorateFunctionMessage: +Bundler/InsecureProtocolSource: + Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: Enabled: false -GetText/DecorateStringFormattingUsingInterpolation: +Gemspec/RequiredRubyVersion: Enabled: false -GetText/DecorateStringFormattingUsingPercent: +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +Layout/BeginEndAlignment: + Enabled: false +Layout/ClosingHeredocIndentation: + Enabled: false +Layout/EmptyComment: + Enabled: false +Layout/EmptyLineAfterGuardClause: + Enabled: false +Layout/EmptyLinesAroundArguments: + Enabled: false +Layout/EmptyLinesAroundAttributeAccessor: Enabled: false Layout/EndOfLine: Enabled: false -Layout/IndentHeredoc: +Layout/FirstArgumentIndentation: + Enabled: false +Layout/HashAlignment: + Enabled: false +Layout/HeredocIndentation: + Enabled: false +Layout/LeadingEmptyLines: + Enabled: false +Layout/SpaceAroundMethodCallOperator: + Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false +Layout/SpaceInsideReferenceBrackets: + Enabled: false +Lint/BigDecimalNew: + Enabled: false +Lint/BooleanSymbol: + Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateElsifCondition: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/DuplicateRequire: + Enabled: false +Lint/DuplicateRescueException: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/EmptyConditionalBody: + Enabled: false +Lint/EmptyFile: + Enabled: false +Lint/ErbNewArguments: + Enabled: false +Lint/FloatComparison: + Enabled: false +Lint/HashCompareByIdentity: + Enabled: false +Lint/IdentityComparison: + Enabled: false +Lint/InterpolationCheck: + Enabled: false +Lint/MissingCopEnableDirective: + Enabled: false +Lint/MixedRegexpCaptureTypes: + Enabled: false +Lint/NestedPercentLiteral: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/NonDeterministicRequireOrder: + Enabled: false +Lint/OrderedMagicComments: + Enabled: false +Lint/OutOfRangeRegexpRef: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/RedundantCopEnableDirective: + Enabled: false +Lint/RedundantRequireStatement: + Enabled: false +Lint/RedundantSafeNavigation: + Enabled: false +Lint/RedundantWithIndex: + Enabled: false +Lint/RedundantWithObject: + Enabled: false +Lint/RegexpAsCondition: + Enabled: false +Lint/ReturnInVoidContext: + Enabled: false +Lint/SafeNavigationConsistency: + Enabled: false +Lint/SafeNavigationWithEmpty: + Enabled: false +Lint/SelfAssignment: + Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/ShadowedArgument: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/ToJSON: + Enabled: false +Lint/TopLevelReturnWithArgument: + Enabled: false +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Lint/UnreachableLoop: + Enabled: false +Lint/UriEscapeUnescape: + Enabled: false +Lint/UriRegexp: + Enabled: false +Lint/UselessMethodDefinition: + Enabled: false +Lint/UselessTimes: Enabled: false Metrics/AbcSize: Enabled: false @@ -119,19 +306,229 @@ Metrics/ParameterLists: Enabled: false Metrics/PerceivedComplexity: Enabled: false +Migration/DepartmentName: + Enabled: false +Naming/BlockParameterName: + Enabled: false +Naming/HeredocDelimiterCase: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Naming/MemoizedInstanceVariableName: + Enabled: false +Naming/MethodParameterName: + Enabled: false +Naming/RescuedExceptionsVariableName: + Enabled: false +RSpec/Be: + Enabled: false +RSpec/Capybara/CurrentPathExpectation: + Enabled: false +RSpec/Capybara/FeatureMethods: + Enabled: false +RSpec/Capybara/VisibilityMatcher: + Enabled: false +RSpec/ContextMethod: + Enabled: false +RSpec/ContextWording: + Enabled: false RSpec/DescribeClass: Enabled: false +RSpec/EmptyHook: + Enabled: false +RSpec/EmptyLineAfterExample: + Enabled: false +RSpec/EmptyLineAfterExampleGroup: + Enabled: false +RSpec/EmptyLineAfterHook: + Enabled: false RSpec/ExampleLength: Enabled: false -RSpec/MessageExpectation: +RSpec/ExampleWithoutDescription: + Enabled: false +RSpec/ExpectChange: + Enabled: false +RSpec/ExpectInHook: + Enabled: false +RSpec/FactoryBot/AttributeDefinedStatically: + Enabled: false +RSpec/FactoryBot/CreateList: + Enabled: false +RSpec/FactoryBot/FactoryClassName: + Enabled: false +RSpec/HooksBeforeExamples: + Enabled: false +RSpec/ImplicitBlockExpectation: + Enabled: false +RSpec/ImplicitSubject: + Enabled: false +RSpec/LeakyConstantDeclaration: + Enabled: false +RSpec/LetBeforeExamples: + Enabled: false +RSpec/MissingExampleGroupArgument: Enabled: false RSpec/MultipleExpectations: Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpec/MultipleSubjects: + Enabled: false RSpec/NestedGroups: Enabled: false +RSpec/PredicateMatcher: + Enabled: false +RSpec/ReceiveCounts: + Enabled: false +RSpec/ReceiveNever: + Enabled: false +RSpec/RepeatedExampleGroupBody: + Enabled: false +RSpec/RepeatedExampleGroupDescription: + Enabled: false +RSpec/RepeatedIncludeExample: + Enabled: false +RSpec/ReturnFromStub: + Enabled: false +RSpec/SharedExamples: + Enabled: false +RSpec/StubbedMock: + Enabled: false +RSpec/UnspecifiedException: + Enabled: false +RSpec/VariableDefinition: + Enabled: false +RSpec/VoidExpect: + Enabled: false +RSpec/Yield: + Enabled: false +Security/Open: + Enabled: false +Style/AccessModifierDeclarations: + Enabled: false +Style/AccessorGrouping: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false Style/AsciiComments: Enabled: false +Style/BisectedAttrAccessor: + Enabled: false +Style/CaseLikeIf: + Enabled: false +Style/ClassEqualityComparison: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/ColonMethodDefinition: + Enabled: false +Style/CombinableLoops: + Enabled: false +Style/CommentedKeyword: + Enabled: false +Style/Dir: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/DoubleCopDisableDirective: + Enabled: false +Style/EmptyBlockParameter: + Enabled: false +Style/EmptyLambdaParameter: + Enabled: false +Style/Encoding: + Enabled: false +Style/EvalWithLocation: + Enabled: false +Style/ExpandPathArguments: + Enabled: false +Style/ExplicitBlockArgument: + Enabled: false +Style/ExponentialNotation: + Enabled: false +Style/FloatDivision: + Enabled: false +Style/GlobalStdStream: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Style/HashLikeCase: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false Style/IfUnlessModifier: Enabled: false +Style/KeywordParametersOrder: + Enabled: false +Style/MinMax: + Enabled: false +Style/MixinUsage: + Enabled: false +Style/MultilineWhenThen: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NegatedUnless: + Enabled: false +Style/NilLambda: + Enabled: false +Style/NumericPredicate: + Enabled: false +Style/OptionalBooleanParameter: + Enabled: false +Style/OrAssignment: + Enabled: false +Style/RandomWithOffset: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/RedundantAssignment: + Enabled: false +Style/RedundantCondition: + Enabled: false +Style/RedundantConditional: + Enabled: false +Style/RedundantFetchBlock: + Enabled: false +Style/RedundantFileExtensionInRequire: + Enabled: false +Style/RedundantRegexpCharacterClass: + Enabled: false +Style/RedundantRegexpEscape: + Enabled: false +Style/RedundantSelfAssignment: + Enabled: false +Style/RedundantSort: + Enabled: false +Style/RescueStandardError: + Enabled: false +Style/SingleArgumentDig: + Enabled: false +Style/SlicingWithRange: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/StderrPuts: + Enabled: false +Style/StringConcatenation: + Enabled: false +Style/Strip: + Enabled: false +Style/SwapValues: + Enabled: false Style/SymbolProc: Enabled: false +Style/TrailingBodyOnClass: + Enabled: false +Style/TrailingBodyOnMethodDefinition: + Enabled: false +Style/TrailingBodyOnModule: + Enabled: false +Style/TrailingCommaInHashLiteral: + Enabled: false +Style/TrailingMethodEndStatement: + Enabled: false +Style/UnpackFirst: + Enabled: false diff --git a/.sync.yml b/.sync.yml index 632c490a..8a29bb75 100644 --- a/.sync.yml +++ b/.sync.yml @@ -2,7 +2,7 @@ ".gitlab-ci.yml": delete: true ".travis.yml": - global_env: + global_env: - HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests" deploy_to_forge: enabled: false @@ -36,16 +36,6 @@ 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') - - gem: puppet_litmus - git: https://github.com/puppetlabs/puppet_litmus - ref: main - condition: Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0') - - gem: bolt - version: '2.32.0' - condition: Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0') spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true diff --git a/.travis.yml b/.travis.yml index 3af64e62..c6546915 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,89 +27,81 @@ stages: jobs: fast_finish: true include: - - + - bundler_args: --with system_tests before_script: - "bundle exec rake 'litmus:provision_list[travis_ub_6]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - bundler_args: env: PLATFORMS=travis_ub_6_puppet6 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - + - bundler_args: --with system_tests before_script: - "bundle exec rake 'litmus:provision_list[travis_ub_5]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - bundler_args: env: PLATFORMS=travis_ub_5_puppet5 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - + - bundler_args: --with system_tests before_script: - "bundle exec rake 'litmus:provision_list[travis_deb]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - bundler_args: env: PLATFORMS=travis_deb_puppet5 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - + - bundler_args: --with system_tests before_script: - "bundle exec rake 'litmus:provision_list[travis_el7]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - bundler_args: env: PLATFORMS=travis_el7_puppet5 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - + - bundler_args: --with system_tests 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 - - + - bundler_args: --with system_tests before_script: - "bundle exec rake 'litmus:provision_list[travis_deb]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - bundler_args: env: PLATFORMS=travis_deb_puppet6 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - + - bundler_args: --with system_tests before_script: - "bundle exec rake 'litmus:provision_list[travis_el7]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - bundler_args: env: PLATFORMS=travis_el7_puppet6 rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - + - bundler_args: --with system_tests 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"] diff --git a/Gemfile b/Gemfile index 84b04e80..ae2b430d 100644 --- a/Gemfile +++ b/Gemfile @@ -17,21 +17,18 @@ ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments minor_version = ruby_version_segments[0..1].join('.') group :development do - gem "fast_gettext", '1.1.0', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.1.0') - gem "fast_gettext", require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.1.0') - gem "json_pure", '<= 2.0.1', require: false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') - 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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.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.4', require: false, platforms: [:ruby] - gem "puppet-module-posix-dev-r#{minor_version}", '~> 0.4', require: false, platforms: [:ruby] - 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 "puppet_litmus", require: false, git: 'https://github.com/puppetlabs/puppet_litmus', ref: 'main' if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0') - gem "bolt", '2.32.0', require: false if Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.5.0') + gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] + gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] + gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "github_changelog_generator", require: false +end +group :system_tests do + gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] + gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/metadata.json b/metadata.json index 65831595..b9a50ebb 100644 --- a/metadata.json +++ b/metadata.json @@ -82,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-g5afcd3d", + "template-ref": "heads/main-0-g4543421", "pdk-version": "1.18.1" } From fdbccc3435cc01d3500318cec934801a7ef7ff7e Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 16 Dec 2020 13:44:14 +0000 Subject: [PATCH 093/259] Add the FrozenStrings magic comment --- lib/facter/java_default_home.rb | 2 ++ lib/facter/java_libjvm_path.rb | 2 ++ lib/facter/java_major_version.rb | 2 ++ lib/facter/java_patch_level.rb | 2 ++ lib/facter/java_version.rb | 2 ++ spec/acceptance/install_spec.rb | 2 ++ spec/classes/java_spec.rb | 2 ++ spec/defines/adopt_spec.rb | 2 ++ spec/defines/download_spec.rb | 2 ++ spec/defines/sap_spec.rb | 2 ++ spec/spec_helper_acceptance_local.rb | 2 ++ spec/spec_helper_local.rb | 2 ++ spec/unit/facter/java_default_home_spec.rb | 2 ++ spec/unit/facter/java_libjvm_path_spec.rb | 2 ++ spec/unit/facter/java_major_version_spec.rb | 2 ++ spec/unit/facter/java_patch_level_spec.rb | 2 ++ spec/unit/facter/java_version_spec.rb | 2 ++ 17 files changed, 34 insertions(+) diff --git a/lib/facter/java_default_home.rb b/lib/facter/java_default_home.rb index 0f4d58ed..c198c2cb 100644 --- a/lib/facter/java_default_home.rb +++ b/lib/facter/java_default_home.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Fact: java_default_home # # Purpose: get absolute path of java system home diff --git a/lib/facter/java_libjvm_path.rb b/lib/facter/java_libjvm_path.rb index 7ae549f0..cc3085bd 100644 --- a/lib/facter/java_libjvm_path.rb +++ b/lib/facter/java_libjvm_path.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Fact: java_libjvm_path # # Purpose: get path to libjvm.so diff --git a/lib/facter/java_major_version.rb b/lib/facter/java_major_version.rb index 3afd9949..6ba4ec18 100644 --- a/lib/facter/java_major_version.rb +++ b/lib/facter/java_major_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Fact: java_major_version # # Purpose: get Java's major version diff --git a/lib/facter/java_patch_level.rb b/lib/facter/java_patch_level.rb index 2722d0b0..d6451551 100644 --- a/lib/facter/java_patch_level.rb +++ b/lib/facter/java_patch_level.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Fact: java_patch_level # # Purpose: get Java's patch level diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index 6de4bb45..07468dae 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Fact: java_version # # Purpose: get full java version string diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 7d315642..e79b4ce9 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper_acceptance' require 'pry' diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 0480ea6d..0792d6ec 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'java', type: :class do diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index 514e788e..400aa1f6 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'java::adopt', type: :define do diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index ae8ca756..f120c50a 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'java::download', type: :define do diff --git a/spec/defines/sap_spec.rb b/spec/defines/sap_spec.rb index 9d106863..ee4fb883 100644 --- a/spec/defines/sap_spec.rb +++ b/spec/defines/sap_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'java::sap', type: :define do diff --git a/spec/spec_helper_acceptance_local.rb b/spec/spec_helper_acceptance_local.rb index 3c3b4020..664fc0e7 100644 --- a/spec/spec_helper_acceptance_local.rb +++ b/spec/spec_helper_acceptance_local.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + UNSUPPORTED_PLATFORMS = ['darwin', 'windows'].freeze diff --git a/spec/spec_helper_local.rb b/spec/spec_helper_local.rb index 2e897cb5..ce4d0623 100644 --- a/spec/spec_helper_local.rb +++ b/spec/spec_helper_local.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + if ENV['COVERAGE'] == 'yes' require 'simplecov' require 'simplecov-console' diff --git a/spec/unit/facter/java_default_home_spec.rb b/spec/unit/facter/java_default_home_spec.rb index 31ecd68b..11fb2060 100644 --- a/spec/unit/facter/java_default_home_spec.rb +++ b/spec/unit/facter/java_default_home_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' java_7_path = '/usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java' diff --git a/spec/unit/facter/java_libjvm_path_spec.rb b/spec/unit/facter/java_libjvm_path_spec.rb index 3efcb474..dde5aa51 100644 --- a/spec/unit/facter/java_libjvm_path_spec.rb +++ b/spec/unit/facter/java_libjvm_path_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'java_libjvm_path' do diff --git a/spec/unit/facter/java_major_version_spec.rb b/spec/unit/facter/java_major_version_spec.rb index 3b50e003..62a3df7d 100644 --- a/spec/unit/facter/java_major_version_spec.rb +++ b/spec/unit/facter/java_major_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'java_major_version' do diff --git a/spec/unit/facter/java_patch_level_spec.rb b/spec/unit/facter/java_patch_level_spec.rb index 4287b297..216fdec2 100644 --- a/spec/unit/facter/java_patch_level_spec.rb +++ b/spec/unit/facter/java_patch_level_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' describe 'java_patch_level' do diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index 5d65a04e..bb4b167b 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' openjdk_7_output = "Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true\n"\ From d3c3598349305e1259f02fe757bbd3d4879f8c18 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 16 Dec 2020 13:44:18 +0000 Subject: [PATCH 094/259] Add all safe auto corrects --- lib/facter/java_default_home.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/facter/java_default_home.rb b/lib/facter/java_default_home.rb index c198c2cb..dccbaf2a 100644 --- a/lib/facter/java_default_home.rb +++ b/lib/facter/java_default_home.rb @@ -21,7 +21,7 @@ nil else java_path = File.realpath(java_bin) - java_default_home = if java_path =~ %r{/jre/} + java_default_home = if %r{/jre/}.match?(java_path) File.dirname(File.dirname(File.dirname(java_path))) else File.dirname(File.dirname(java_path)) From 58edff7fd0ff556c78fceeaf8bf5ee8ba60d000c Mon Sep 17 00:00:00 2001 From: Auto-release Date: Wed, 16 Dec 2020 14:47:44 +0000 Subject: [PATCH 095/259] Release version 6.5.0 --- CHANGELOG.md | 12 +++++- REFERENCE.md | 107 +++++++++++++++++++++++++------------------------- metadata.json | 2 +- 3 files changed, 65 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d7e765b4..a8dc6b07 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,17 @@ 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.4.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.3.0) (2020-11-09) +## [v6.5.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.5.0) (2020-12-16) -[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.3.0...v6.3.0) +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.4.0...v6.5.0) + +### Added + +- pdksync - \(feat\) Add support for Puppet 7 [\#454](https://github.com/puppetlabs/puppetlabs-java/pull/454) ([daianamezdrea](https://github.com/daianamezdrea)) + +## [v6.4.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.4.0) (2020-11-09) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.3.0...v6.4.0) ### Added diff --git a/REFERENCE.md b/REFERENCE.md index f9f6450c..a54ce039 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -1,22 +1,23 @@ # Reference + ## Table of Contents -**Classes** +### Classes -_Public Classes_ +#### Public Classes * [`java`](#java): This module manages the Java runtime package -_Private Classes_ +#### Private Classes -* `java::config`: +* `java::config` * `java::params`: This class builds a hash of JDK/JRE packages and (for Debian) alternatives. For wheezy/precise, we provide Oracle JDK/JRE options, even though those are not in the package repositories. -**Defined types** +### Defined types * [`java::adopt`](#javaadopt): Install one or more versions of AdoptOpenJDK Java. * [`java::download`](#javadownload): Installs Java from a url location. @@ -24,7 +25,7 @@ options, even though those are not in the package repositories. ## Classes -### java +### `java` This module manages the Java runtime package @@ -40,7 +41,7 @@ The java distribution to install. Can be one of "jdk" or "jre", or other platform-specific options where there are multiple implementations available (eg: OpenJDK vs Oracle JDK). -Default value: 'jdk' +Default value: `'jdk'` ##### `version` @@ -49,7 +50,7 @@ Data type: `Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/]` The version of java to install. By default, this module simply ensures that java is present, and does not require a specific version. -Default value: 'present' +Default value: `'present'` ##### `package` @@ -58,7 +59,7 @@ Data type: `Optional[String]` The name of the java package. This is configurable in case a non-standard java package is desired. -Default value: `undef` +Default value: ``undef`` ##### `package_options` @@ -67,7 +68,7 @@ Data type: `Optional[Array]` Array of strings to pass installation options to the 'package' Puppet resource. Options available depend on the 'package' provider for the target OS. -Default value: `undef` +Default value: ``undef`` ##### `java_alternative` @@ -79,7 +80,7 @@ If you specify a particular package, you will almost always also want to specify which java_alternative to choose. If you set this, you also need to set the path below. -Default value: `undef` +Default value: ``undef`` ##### `java_alternative_path` @@ -90,7 +91,7 @@ alternatives system makes it difficult to verify which alternative is actually enabled, this is required to ensure the correct JVM is enabled. -Default value: `undef` +Default value: ``undef`` ##### `java_home` @@ -99,11 +100,11 @@ Data type: `Optional[String]` The path to where the JRE is installed. This will be set as an environment variable. -Default value: `undef` +Default value: ``undef`` ## Defined types -### java::adopt +### `java::adopt` Defined Type java::adopt @@ -117,7 +118,7 @@ Data type: `Any` Install or remove the package. -Default value: 'present' +Default value: `'present'` ##### `version` @@ -125,7 +126,7 @@ Data type: `Any` Version of Java to install, e.g. '8' or '9'. Default values for major and minor versions will be used. -Default value: '8' +Default value: `'8'` ##### `version_major` @@ -133,7 +134,7 @@ Data type: `Any` Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor. -Default value: `undef` +Default value: ``undef`` ##### `version_minor` @@ -141,7 +142,7 @@ Data type: `Any` Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major. -Default value: `undef` +Default value: ``undef`` ##### `java` @@ -149,7 +150,7 @@ Data type: `Any` Type of Java Standard Edition to install, jdk or jre. -Default value: 'jdk' +Default value: `'jdk'` ##### `proxy_server` @@ -157,7 +158,7 @@ Data type: `Any` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) -Default value: `undef` +Default value: ``undef`` ##### `proxy_type` @@ -165,7 +166,7 @@ Data type: `Any` Proxy server type (none|http|https|ftp). (passed to archive) -Default value: `undef` +Default value: ``undef`` ##### `basedir` @@ -174,7 +175,7 @@ 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` +Default value: ``undef`` ##### `manage_basedir` @@ -183,7 +184,7 @@ 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` +Default value: ``true`` ##### `package_type` @@ -193,7 +194,7 @@ Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. Optional forced package types: rpm, rpmbin, tar.gz -Default value: `undef` +Default value: ``undef`` ##### `manage_symlink` @@ -201,7 +202,7 @@ Data type: `Any` Whether to manage a symlink that points to the installation directory. Defaults to false. -Default value: `false` +Default value: ``false`` ##### `symlink_name` @@ -209,9 +210,9 @@ Data type: `Any` The name for the optional symlink in the installation directory. -Default value: `undef` +Default value: ``undef`` -### java::download +### `java::download` Defined Type java::download @@ -225,7 +226,7 @@ Data type: `Any` Install or remove the package. -Default value: 'present' +Default value: `'present'` ##### `version` @@ -233,7 +234,7 @@ Data type: `Any` Version of Java to install, e.g. '7' or '8'. Default values for major and minor versions will be used. -Default value: '8' +Default value: `'8'` ##### `version_major` @@ -241,7 +242,7 @@ Data type: `Any` Major version which should be installed, e.g. '8u101'. Must be used together with version_minor. -Default value: `undef` +Default value: ``undef`` ##### `version_minor` @@ -249,7 +250,7 @@ Data type: `Any` Minor version which should be installed, e.g. 'b12'. Must be used together with version_major. -Default value: `undef` +Default value: ``undef`` ##### `java_se` @@ -257,7 +258,7 @@ Data type: `Any` Type of Java Standard Edition to install, jdk or jre. -Default value: 'jdk' +Default value: `'jdk'` ##### `proxy_server` @@ -265,7 +266,7 @@ Data type: `Any` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) -Default value: `undef` +Default value: ``undef`` ##### `proxy_type` @@ -273,7 +274,7 @@ Data type: `Any` Proxy server type (none|http|https|ftp). (passed to archive) -Default value: `undef` +Default value: ``undef`` ##### `url` @@ -281,7 +282,7 @@ Data type: `Any` Full URL -Default value: `undef` +Default value: ``undef`` ##### `jce` @@ -289,7 +290,7 @@ Data type: `Any` Install Oracles Java Cryptographic Extensions into the JRE or JDK -Default value: `false` +Default value: ``false`` ##### `jce_url` @@ -297,7 +298,7 @@ Data type: `Any` Full URL to the jce zip file -Default value: `undef` +Default value: ``undef`` ##### `basedir` @@ -306,7 +307,7 @@ 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` +Default value: ``undef`` ##### `manage_basedir` @@ -315,7 +316,7 @@ 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: `false` +Default value: ``false`` ##### `package_type` @@ -325,7 +326,7 @@ Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. Optional forced package types: rpm, rpmbin, tar.gz -Default value: `undef` +Default value: ``undef`` ##### `manage_symlink` @@ -333,7 +334,7 @@ Data type: `Any` Whether to manage a symlink that points to the installation directory. Defaults to false. -Default value: `false` +Default value: ``false`` ##### `symlink_name` @@ -341,9 +342,9 @@ Data type: `Any` The name for the optional symlink in the installation directory. -Default value: `undef` +Default value: ``undef`` -### java::sap +### `java::sap` Defined Type java::sap @@ -357,7 +358,7 @@ Data type: `Any` Install or remove the package. -Default value: 'present' +Default value: `'present'` ##### `version` @@ -365,7 +366,7 @@ Data type: `Any` Version of Java to install, e.g. '8' or '9'. Default values for full versions will be used. -Default value: '8' +Default value: `'8'` ##### `version_full` @@ -373,7 +374,7 @@ 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` +Default value: ``undef`` ##### `java` @@ -381,7 +382,7 @@ Data type: `Any` Type of Java Edition to install, jdk or jre. -Default value: 'jdk' +Default value: `'jdk'` ##### `proxy_server` @@ -389,7 +390,7 @@ Data type: `Any` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) -Default value: `undef` +Default value: ``undef`` ##### `proxy_type` @@ -397,7 +398,7 @@ Data type: `Any` Proxy server type (none|http|https|ftp). (passed to archive) -Default value: `undef` +Default value: ``undef`` ##### `basedir` @@ -406,7 +407,7 @@ 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` +Default value: ``undef`` ##### `manage_basedir` @@ -415,7 +416,7 @@ 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` +Default value: ``true`` ##### `manage_symlink` @@ -423,7 +424,7 @@ Data type: `Any` Whether to manage a symlink that points to the installation directory. Defaults to false. -Default value: `false` +Default value: ``false`` ##### `symlink_name` @@ -431,5 +432,5 @@ Data type: `Any` The name for the optional symlink in the installation directory. -Default value: `undef` +Default value: ``undef`` diff --git a/metadata.json b/metadata.json index 65831595..afbc9f87 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "6.4.0", + "version": "6.5.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From f9d03a10ac7b47afc7b8d632493ce0078bf98f28 Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Wed, 16 Dec 2020 17:36:26 +0000 Subject: [PATCH 096/259] Apply remaining rubocop fixes --- .rubocop.yml | 6 ++ .rubocop_todo.yml | 0 lib/facter/java_version.rb | 2 +- spec/acceptance/install_spec.rb | 136 ++++++++++++++++---------------- 4 files changed, 76 insertions(+), 68 deletions(-) delete mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 33c33fa5..07b68b89 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -89,6 +89,8 @@ Performance/CaseWhenSplat: Performance/Casecmp: Enabled: true Performance/CollectionLiteralInLoop: + Exclude: + - spec/**/* Enabled: true Performance/CompareWithBlock: Enabled: true @@ -294,6 +296,8 @@ Metrics/AbcSize: Enabled: false Metrics/BlockLength: Enabled: false +Metrics/BlockNesting: + Enabled: false Metrics/ClassLength: Enabled: false Metrics/CyclomaticComplexity: @@ -308,6 +312,8 @@ Metrics/PerceivedComplexity: Enabled: false Migration/DepartmentName: Enabled: false +Naming/AccessorMethodName: + Enabled: false Naming/BlockParameterName: Enabled: false Naming/HeredocDelimiterCase: diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml deleted file mode 100644 index e69de29b..00000000 diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index 07468dae..1c427a82 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -37,7 +37,7 @@ confine operatingsystem: 'Darwin' has_weight 100 setcode do - unless %r{Unable to find any JVMs matching version} =~ Facter::Util::Resolution.exec('/usr/libexec/java_home --failfast 2>&1') + unless Facter::Util::Resolution.exec('/usr/libexec/java_home --failfast 2>&1').include?('Unable to find any JVMs matching version') version = nil Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = Regexp.last_match(1) if %r{^.+ version \"(.+)\"} =~ line } version diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index e79b4ce9..ddefb71c 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -189,94 +189,96 @@ } EOL -context 'installing java jre', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do - it 'installs jre' do - idempotent_apply(java_class_jre) +describe 'installing' do + context 'installing java jre' do + it 'installs jre' do + idempotent_apply(java_class_jre) + end end -end -context 'installing java jdk', unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do - it 'installs jdk' do - idempotent_apply(java_class) + context 'installing java jdk' do + it 'installs jdk' do + idempotent_apply(java_class) + end end -end -context 'with failure cases' do - it 'fails to install java with a blank version' do - apply_manifest(blank_version, expect_failures: true) - end + context 'with failure cases' do + it 'fails to install java with a blank version' do + apply_manifest(blank_version, expect_failures: true) + end - it 'fails to install java with an incorrect distribution' do - apply_manifest(incorrect_distro, expect_failures: true) - end + it 'fails to install java with an incorrect distribution' do + apply_manifest(incorrect_distro, expect_failures: true) + end - it 'fails to install java with a blank distribution' do - apply_manifest(blank_distro, expect_failures: true) - end + it 'fails to install java with a blank distribution' do + apply_manifest(blank_distro, expect_failures: true) + end - it 'fails to install java with an incorrect package' do - apply_manifest(incorrect_package, expect_failures: true) - end + it 'fails to install java with an incorrect package' do + apply_manifest(incorrect_package, expect_failures: true) + end - it 'fails on debian or RHEL when passed fake java_alternative and path' do - if os[:family] == 'sles' - apply_manifest(bogus_alternative, catch_failures: true) - else - apply_manifest(bogus_alternative, expect_failures: true) + it 'fails on debian or RHEL when passed fake java_alternative and path' do + if os[:family] == 'sles' + apply_manifest(bogus_alternative, catch_failures: true) + else + apply_manifest(bogus_alternative, expect_failures: true) + end end end -end -context 'java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do - let(:install_path) do - (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' - end + context 'java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do + let(:install_path) do + (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' + end - let(:version_suffix) do - (os[:family] == 'redhat') ? '-amd64' : '' - end + let(:version_suffix) do + (os[:family] == 'redhat') ? '-amd64' : '' + end - it 'installs oracle jdk and jre' do - idempotent_apply(install_oracle_jdk_jre) - jdk_result = shell("test ! -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") - jre_result = shell("test ! -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") - expect(jdk_result.exit_code).to eq(0) - expect(jre_result.exit_code).to eq(0) - end + it 'installs oracle jdk and jre' do + idempotent_apply(install_oracle_jdk_jre) + jdk_result = shell("test ! -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") + jre_result = shell("test ! -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") + expect(jdk_result.exit_code).to eq(0) + expect(jre_result.exit_code).to eq(0) + end - it 'installs oracle jdk with jce' do - idempotent_apply(install_oracle_jdk_jce) - result = shell("test -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") - expect(result.exit_code).to eq(0) - end + it 'installs oracle jdk with jce' do + idempotent_apply(install_oracle_jdk_jce) + result = shell("test -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") + expect(result.exit_code).to eq(0) + end - it 'installs oracle jre with jce' do - idempotent_apply(install_oracle_jre_jce) - result = shell("test -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") - expect(result.exit_code).to eq(0) + it 'installs oracle jre with jce' do + idempotent_apply(install_oracle_jre_jce) + result = shell("test -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") + expect(result.exit_code).to eq(0) + end end -end -context 'java::adopt', if: adopt_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do - let(:install_path) do - (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' - end + context 'java::adopt', if: adopt_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do + let(:install_path) do + (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' + end - let(:version_suffix) do - (os[:family] == 'redhat') ? '-amd64' : '' - end + let(:version_suffix) do + (os[:family] == 'redhat') ? '-amd64' : '' + end - it 'installs adopt jdk and jre' do - idempotent_apply(install_adopt_jdk_jre) + it 'installs adopt jdk and jre' do + idempotent_apply(install_adopt_jdk_jre) + end 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 + 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) + it 'installs adopt jdk and jre' do + idempotent_apply(install_sap_jdk_jre) + end end end From dcdbec85656405c639c3e466dab2c00fed61d56d Mon Sep 17 00:00:00 2001 From: David Schmitt Date: Tue, 26 Jan 2021 17:16:54 +0000 Subject: [PATCH 097/259] (maint) Update github actions --- .github/workflows/nightly.yml | 73 +++++++-------------- .github/workflows/pr_test.yml | 73 +++++++-------------- .rubocop.yml | 118 +++++++++++++--------------------- .travis.yml | 56 +++++++++------- Rakefile | 1 + metadata.json | 6 +- 6 files changed, 132 insertions(+), 195 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 4021da76..0c1fd28b 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,7 +17,7 @@ jobs: steps: - name: "Honeycomb: Start recording" - uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2 + uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} @@ -25,7 +25,7 @@ jobs: - name: "Honeycomb: Start first step" run: | - echo STEP_ID=0 >> $GITHUB_ENV + echo STEP_ID=setup-environment >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Checkout Source @@ -33,29 +33,25 @@ jobs: if: ${{ github.repository_owner == 'puppetlabs' }} - name: Activate Ruby 2.7 - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 if: ${{ github.repository_owner == 'puppetlabs' }} with: ruby-version: "2.7" + bundler-cache: true - - name: Cache gems - uses: actions/cache@v2 + - name: Print bundle environment if: ${{ github.repository_owner == 'puppetlabs' }} - with: - path: vendor/gems - key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }} - restore-keys: | - ${{ runner.os }}-${{ github.event_name }}- - ${{ runner.os }}- + run: | + echo ::group::bundler environment + buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env + echo ::endgroup:: - - name: Install gems + - name: "Honeycomb: Record Setup Environment time" if: ${{ github.repository_owner == 'puppetlabs' }} run: | - buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems - buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8 - buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3 - buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install - buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' + echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Setup Acceptance Test Matrix id: get-matrix @@ -67,7 +63,7 @@ jobs: echo "::set-output name=matrix::{}" fi - - name: "Honeycomb: Record setup time" + - name: "Honeycomb: Record Setup Test Matrix time" if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' @@ -90,7 +86,7 @@ jobs: echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE - name: "Honeycomb: Start recording" - uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2 + uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} @@ -106,42 +102,22 @@ jobs: uses: actions/checkout@v2 - name: Activate Ruby 2.7 - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: "2.7" + bundler-cache: true - - name: Cache gems - uses: actions/cache@v2 - with: - path: vendor/gems - key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }} - restore-keys: | - ${{ runner.os }}-${{ github.event_name }}- - ${{ runner.os }}- - - - name: "Honeycomb: Record cache setup time" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - - name: Bundler Setup + - name: Print bundle environment run: | - buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems - buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8 - buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3 - buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install - buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean echo ::group::bundler environment buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env echo ::endgroup:: - - name: "Honeycomb: Record Bundler Setup time" + - name: "Honeycomb: Record Setup Environment time" if: ${{ always() }} run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Provision test environment @@ -168,7 +144,7 @@ jobs: run: | echo ::group::honeycomb step buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV echo ::endgroup:: @@ -180,11 +156,12 @@ jobs: if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Remove test environment if: ${{ always() }} + continue-on-error: true run: | if [ -f inventory.yaml ]; then buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' @@ -207,7 +184,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Slack Workflow Notification - uses: Gamesight/slack-workflow-status@88ee95b73b4669825883ddf22747966204663e58 # pin@master + uses: puppetlabs/Gamesight-slack-workflow-status@pdk-templates-v1 with: # Required Input repo_token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index 2b5ab1f5..207dfcad 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -15,7 +15,7 @@ jobs: steps: - name: "Honeycomb: Start recording" - uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2 + uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} @@ -23,7 +23,7 @@ jobs: - name: "Honeycomb: Start first step" run: | - echo STEP_ID=0 >> $GITHUB_ENV + echo STEP_ID=setup-environment >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Checkout Source @@ -31,33 +31,28 @@ jobs: if: ${{ github.repository_owner == 'puppetlabs' }} - name: Activate Ruby 2.7 - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 if: ${{ github.repository_owner == 'puppetlabs' }} with: ruby-version: "2.7" + bundler-cache: true - - name: Cache gems - uses: actions/cache@v2 + - name: Print bundle environment if: ${{ github.repository_owner == 'puppetlabs' }} - with: - path: vendor/gems - key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }} - restore-keys: | - ${{ runner.os }}-${{ github.event_name }}- - ${{ runner.os }}- + run: | + echo ::group::bundler environment + buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env + echo ::endgroup:: - - name: Install gems + - name: "Honeycomb: Record Setup Environment time" if: ${{ github.repository_owner == 'puppetlabs' }} run: | - buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems - buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8 - buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3 - buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install - buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' + echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Setup Acceptance Test Matrix id: get-matrix - if: ${{ github.repository_owner == 'puppetlabs' }} run: | if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata @@ -65,7 +60,7 @@ jobs: echo "::set-output name=matrix::{}" fi - - name: "Honeycomb: Record setup time" + - name: "Honeycomb: Record Setup Test Matrix time" if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' @@ -73,6 +68,7 @@ jobs: Acceptance: needs: - setup_matrix + if: ${{ needs.setup_matrix.outputs.matrix != '{}' }} runs-on: ubuntu-20.04 strategy: @@ -88,7 +84,7 @@ jobs: echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE - name: "Honeycomb: Start recording" - uses: kvrhdn/gha-buildevents@5be4636b81803713c94d7cb7e3a4b85d759df112 # pin@v1.0.2 + uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} @@ -104,42 +100,22 @@ jobs: uses: actions/checkout@v2 - name: Activate Ruby 2.7 - uses: actions/setup-ruby@v1 + uses: ruby/setup-ruby@v1 with: ruby-version: "2.7" + bundler-cache: true - - name: Cache gems - uses: actions/cache@v2 - with: - path: vendor/gems - key: ${{ runner.os }}-${{ github.event_name }}-${{ hashFiles('**/Gemfile') }} - restore-keys: | - ${{ runner.os }}-${{ github.event_name }}- - ${{ runner.os }}- - - - name: "Honeycomb: Record cache setup time" - if: ${{ always() }} + - name: Print bundle environment run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Cache retrieval' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - - name: Bundler Setup - run: | - buildevents cmd $TRACE_ID $STEP_ID 'bundle config path vendor/gems' -- bundle config path vendor/gems - buildevents cmd $TRACE_ID $STEP_ID 'bundle config jobs 8' -- bundle config jobs 8 - buildevents cmd $TRACE_ID $STEP_ID 'bundle config retry 3' -- bundle config retry 3 - buildevents cmd $TRACE_ID $STEP_ID 'bundle install' -- bundle install - buildevents cmd $TRACE_ID $STEP_ID 'bundle clean' -- bundle clean echo ::group::bundler environment buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env echo ::endgroup:: - - name: "Honeycomb: Record Bundler Setup time" + - name: "Honeycomb: Record Setup Environment time" if: ${{ always() }} run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Bundler Setup' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Provision test environment @@ -166,7 +142,7 @@ jobs: run: | echo ::group::honeycomb step buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV echo ::endgroup:: @@ -178,11 +154,12 @@ jobs: if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-5 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Remove test environment if: ${{ always() }} + continue-on-error: true run: | if [ -f inventory.yaml ]; then buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' diff --git a/.rubocop.yml b/.rubocop.yml index 07b68b89..8dcd675f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -82,68 +82,26 @@ Performance/BigDecimalWithNumericArgument: Enabled: true Performance/BlockGivenWithExplicitBlock: Enabled: true -Performance/Caller: - Enabled: true Performance/CaseWhenSplat: Enabled: true -Performance/Casecmp: - Enabled: true -Performance/CollectionLiteralInLoop: - Exclude: - - spec/**/* - Enabled: true -Performance/CompareWithBlock: - Enabled: true Performance/ConstantRegexp: Enabled: true -Performance/Count: - Enabled: true -Performance/Detect: - Enabled: true -Performance/DoubleStartEndWith: - Enabled: true -Performance/EndWith: - Enabled: true -Performance/FixedSize: - Enabled: true -Performance/FlatMap: - Enabled: true Performance/MethodObjectAsBlock: Enabled: true -Performance/RangeInclude: - Enabled: true -Performance/RedundantBlockCall: - Enabled: true -Performance/RedundantMatch: - Enabled: true -Performance/RedundantMerge: - Enabled: true Performance/RedundantSortBlock: Enabled: true Performance/RedundantStringChars: Enabled: true -Performance/RegexpMatch: - Enabled: true -Performance/ReverseEach: - Enabled: true Performance/ReverseFirst: Enabled: true -Performance/Size: - Enabled: true Performance/SortReverse: Enabled: true Performance/Squeeze: Enabled: true -Performance/StartWith: - Enabled: true Performance/StringInclude: Enabled: true -Performance/StringReplacement: - Enabled: true Performance/Sum: Enabled: true -Performance/TimesMap: - Enabled: true Style/CollectionMethods: Enabled: true Style/MethodCalledOnDoEndBlock: @@ -200,20 +158,12 @@ Lint/DeprecatedOpenSSLConstant: Enabled: false Lint/DisjunctiveAssignmentInConstructor: Enabled: false -Lint/DuplicateBranch: - Enabled: false Lint/DuplicateElsifCondition: Enabled: false -Lint/DuplicateRegexpCharacterClassElement: - Enabled: false Lint/DuplicateRequire: Enabled: false Lint/DuplicateRescueException: Enabled: false -Lint/EmptyBlock: - Enabled: false -Lint/EmptyClass: - Enabled: false Lint/EmptyConditionalBody: Enabled: false Lint/EmptyFile: @@ -234,8 +184,6 @@ Lint/MixedRegexpCaptureTypes: Enabled: false Lint/NestedPercentLiteral: Enabled: false -Lint/NoReturnInBeginEndBlocks: - Enabled: false Lint/NonDeterministicRequireOrder: Enabled: false Lint/OrderedMagicComments: @@ -270,18 +218,12 @@ Lint/ShadowedArgument: Enabled: false Lint/StructNewOverride: Enabled: false -Lint/ToEnumArguments: - Enabled: false Lint/ToJSON: Enabled: false Lint/TopLevelReturnWithArgument: Enabled: false Lint/TrailingCommaInAttributeDeclaration: Enabled: false -Lint/UnexpectedBlockArity: - Enabled: false -Lint/UnmodifiedReduceAccumulator: - Enabled: false Lint/UnreachableLoop: Enabled: false Lint/UriEscapeUnescape: @@ -326,6 +268,20 @@ Naming/MethodParameterName: Enabled: false Naming/RescuedExceptionsVariableName: Enabled: false +Naming/VariableNumber: + Enabled: false +Performance/BindCall: + Enabled: false +Performance/DeletePrefix: + Enabled: false +Performance/DeleteSuffix: + Enabled: false +Performance/InefficientHashSearch: + Enabled: false +Performance/UnfreezeString: + Enabled: false +Performance/UriDefaultParser: + Enabled: false RSpec/Be: Enabled: false RSpec/Capybara/CurrentPathExpectation: @@ -414,8 +370,6 @@ Style/AccessModifierDeclarations: Enabled: false Style/AccessorGrouping: Enabled: false -Style/ArgumentsForwarding: - Enabled: false Style/AsciiComments: Enabled: false Style/BisectedAttrAccessor: @@ -424,8 +378,6 @@ Style/CaseLikeIf: Enabled: false Style/ClassEqualityComparison: Enabled: false -Style/CollectionCompact: - Enabled: false Style/ColonMethodDefinition: Enabled: false Style/CombinableLoops: @@ -434,8 +386,6 @@ Style/CommentedKeyword: Enabled: false Style/Dir: Enabled: false -Style/DocumentDynamicEvalDefinition: - Enabled: false Style/DoubleCopDisableDirective: Enabled: false Style/EmptyBlockParameter: @@ -474,12 +424,8 @@ Style/MixinUsage: Enabled: false Style/MultilineWhenThen: Enabled: false -Style/NegatedIfElseCondition: - Enabled: false Style/NegatedUnless: Enabled: false -Style/NilLambda: - Enabled: false Style/NumericPredicate: Enabled: false Style/OptionalBooleanParameter: @@ -488,8 +434,6 @@ Style/OrAssignment: Enabled: false Style/RandomWithOffset: Enabled: false -Style/RedundantArgument: - Enabled: false Style/RedundantAssignment: Enabled: false Style/RedundantCondition: @@ -522,8 +466,6 @@ Style/StringConcatenation: Enabled: false Style/Strip: Enabled: false -Style/SwapValues: - Enabled: false Style/SymbolProc: Enabled: false Style/TrailingBodyOnClass: @@ -538,3 +480,35 @@ Style/TrailingMethodEndStatement: Enabled: false Style/UnpackFirst: Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NilLambda: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/SwapValues: + Enabled: false diff --git a/.travis.yml b/.travis.yml index c6546915..887c3e0a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,82 +27,90 @@ stages: jobs: fast_finish: true include: - - bundler_args: --with system_tests - before_script: + - before_script: - "bundle exec rake 'litmus:provision_list[travis_ub_6]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - env: PLATFORMS=travis_ub_6_puppet6 + env: + PLATFORMS: travis_ub_6_puppet6 + BUNDLE_WITH: system_tests rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - bundler_args: --with system_tests - before_script: + - before_script: - "bundle exec rake 'litmus:provision_list[travis_ub_5]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - env: PLATFORMS=travis_ub_5_puppet5 + env: + PLATFORMS: travis_ub_5_puppet5 + BUNDLE_WITH: system_tests rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - bundler_args: --with system_tests - before_script: + - before_script: - "bundle exec rake 'litmus:provision_list[travis_deb]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - env: PLATFORMS=travis_deb_puppet5 + env: + PLATFORMS: travis_deb_puppet5 + BUNDLE_WITH: system_tests rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - bundler_args: --with system_tests - before_script: + - before_script: - "bundle exec rake 'litmus:provision_list[travis_el7]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - env: PLATFORMS=travis_el7_puppet5 + env: + PLATFORMS: travis_el7_puppet5 + BUNDLE_WITH: system_tests rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - bundler_args: --with system_tests - before_script: + - before_script: - "bundle exec rake 'litmus:provision_list[travis_el8]'" - "bundle exec rake 'litmus:install_agent[puppet5]'" - "bundle exec rake litmus:install_module" - env: PLATFORMS=travis_el8_puppet5 + env: + PLATFORMS: travis_el8_puppet5 + BUNDLE_WITH: system_tests rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - bundler_args: --with system_tests - before_script: + - before_script: - "bundle exec rake 'litmus:provision_list[travis_deb]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - env: PLATFORMS=travis_deb_puppet6 + env: + PLATFORMS: travis_deb_puppet6 + BUNDLE_WITH: system_tests rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - bundler_args: --with system_tests - before_script: + - before_script: - "bundle exec rake 'litmus:provision_list[travis_el7]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - env: PLATFORMS=travis_el7_puppet6 + env: + PLATFORMS: travis_el7_puppet6 + BUNDLE_WITH: system_tests rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - bundler_args: --with system_tests - before_script: + - before_script: - "bundle exec rake 'litmus:provision_list[travis_el8]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" - "bundle exec rake litmus:install_module" - env: PLATFORMS=travis_el8_puppet6 + env: + PLATFORMS: travis_el8_puppet6 + BUNDLE_WITH: system_tests rvm: 2.5.7 script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker diff --git a/Rakefile b/Rakefile index 0a5093b3..2906c15b 100644 --- a/Rakefile +++ b/Rakefile @@ -1,5 +1,6 @@ # frozen_string_literal: true +require 'bundler' require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' diff --git a/metadata.json b/metadata.json index 71c1e3ce..47519b47 100644 --- a/metadata.json +++ b/metadata.json @@ -81,7 +81,7 @@ "version_requirement": ">= 5.5.10 < 8.0.0" } ], - "template-url": "https://github.com/puppetlabs/pdk-templates#main", - "template-ref": "heads/main-0-g4543421", - "pdk-version": "1.18.1" + "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", + "template-ref": "heads/main-0-g1862b96", + "pdk-version": "1.19.0.pre (47)" } From 595dc6df93f842b84ecfb738fa7204dafedab243 Mon Sep 17 00:00:00 2001 From: Ryan Dill Date: Mon, 8 Feb 2021 03:28:11 -0800 Subject: [PATCH 098/259] (MODULES-10935) - Switch legacy operatingsystem fact to modern kernel --- lib/facter/java_version.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index 1c427a82..a9d9c184 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -23,7 +23,7 @@ # Additionally, facter versions prior to 2.0.1 only support # positive matches, so this needs to be done manually in setcode. setcode do - unless ['darwin'].include? Facter.value(:operatingsystem).downcase + unless ['darwin'].include? Facter.value(:kernel).downcase version = nil if Facter::Util::Resolution.which('java') Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = Regexp.last_match(1) if %r{^.+ version \"(.+)\"} =~ line } @@ -34,7 +34,7 @@ end Facter.add(:java_version) do - confine operatingsystem: 'Darwin' + confine kernel: 'Darwin' has_weight 100 setcode do unless Facter::Util::Resolution.exec('/usr/libexec/java_home --failfast 2>&1').include?('Unable to find any JVMs matching version') From a78feaa17e7fd6dce5dc1232d732e771c0822f7d Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 15 Feb 2021 17:20:03 +0200 Subject: [PATCH 099/259] Remove Puppet 5 testing --- .travis.yml | 48 ------------------------------------------------ provision.yaml | 27 --------------------------- 2 files changed, 75 deletions(-) diff --git a/.travis.yml b/.travis.yml index 887c3e0a..8e824d6b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -38,50 +38,6 @@ jobs: script: ["travis_wait 45 bundle exec rake litmus:acceptance:parallel"] services: docker stage: acceptance - - before_script: - - "bundle exec rake 'litmus:provision_list[travis_ub_5]'" - - "bundle exec rake 'litmus:install_agent[puppet5]'" - - "bundle exec rake litmus:install_module" - env: - PLATFORMS: travis_ub_5_puppet5 - BUNDLE_WITH: system_tests - 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]'" - - "bundle exec rake 'litmus:install_agent[puppet5]'" - - "bundle exec rake litmus:install_module" - env: - PLATFORMS: travis_deb_puppet5 - BUNDLE_WITH: system_tests - 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_el7]'" - - "bundle exec rake 'litmus:install_agent[puppet5]'" - - "bundle exec rake litmus:install_module" - env: - PLATFORMS: travis_el7_puppet5 - BUNDLE_WITH: system_tests - 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_el8]'" - - "bundle exec rake 'litmus:install_agent[puppet5]'" - - "bundle exec rake litmus:install_module" - env: - PLATFORMS: travis_el8_puppet5 - BUNDLE_WITH: system_tests - 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]'" - "bundle exec rake 'litmus:install_agent[puppet6]'" @@ -118,10 +74,6 @@ jobs: - env: CHECK="check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop syntax lint metadata_lint" stage: static - - - env: PUPPET_GEM_VERSION="~> 5.0" CHECK=parallel_spec - rvm: 2.4.5 - stage: spec - env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec rvm: 2.5.7 diff --git a/provision.yaml b/provision.yaml index 7f9ab15a..c6697ad4 100644 --- a/provision.yaml +++ b/provision.yaml @@ -14,12 +14,6 @@ travis_deb: - litmusimage/debian:8 - litmusimage/debian:9 - litmusimage/debian:10 -travis_ub_5: - provisioner: docker - images: - - litmusimage/ubuntu:14.04 - - litmusimage/ubuntu:16.04 - - litmusimage/ubuntu:18.04 travis_ub_6: provisioner: docker images: @@ -37,27 +31,6 @@ 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-12-x86_64 - - sles-15-x86_64 release_checks_6: provisioner: abs images: From d871ee97c1f8b24514420be4e0e6babdd825a707 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 15 Feb 2021 17:36:26 +0200 Subject: [PATCH 100/259] Bump minimal puppet version to 6.0.0 in metadata.json --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 47519b47..fd0ae4ce 100644 --- a/metadata.json +++ b/metadata.json @@ -78,7 +78,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 5.5.10 < 8.0.0" + "version_requirement": ">= 6.0.0 < 8.0.0" } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", From 0d2dda559009f844f9489a5b98842c8ec59382d3 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Tue, 16 Feb 2021 09:50:57 +0200 Subject: [PATCH 101/259] Update .sync.yml --- .sync.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.sync.yml b/.sync.yml index 8a29bb75..4c6ce9ed 100644 --- a/.sync.yml +++ b/.sync.yml @@ -21,11 +21,6 @@ - puppet6 provision_list: - travis_ub_6 - - collection: - puppet_collection: - - puppet5 - provision_list: - - travis_ub_5 simplecov: true notifications: slack: From 1abf0ac15cfe0bf566b36b060f27887b774bdb67 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Tue, 16 Feb 2021 15:36:50 +0200 Subject: [PATCH 102/259] pdk update --- .github/workflows/auto_release.yml | 81 ++++++++++++++++++++++++++++++ .rubocop.yml | 5 ++ metadata.json | 4 +- 3 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/auto_release.yml diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml new file mode 100644 index 00000000..a88b99ca --- /dev/null +++ b/.github/workflows/auto_release.yml @@ -0,0 +1,81 @@ +name: "Auto release" + +on: + schedule: + - cron: '0 3 * * 6' + workflow_dispatch: + +env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 + HONEYCOMB_DATASET: litmus tests + CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + +jobs: + auto_release: + name: "Automatic release prep" + runs-on: ubuntu-20.04 + + steps: + - name: "Honeycomb: Start recording" + uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 + with: + apikey: ${{ env.HONEYCOMB_WRITEKEY }} + dataset: ${{ env.HONEYCOMB_DATASET }} + job-status: ${{ job.status }} + + - name: "Honeycomb: start first step" + run: | + echo STEP_ID="auto-release" >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + + - name: "Checkout Source" + if: ${{ github.repository_owner == 'puppetlabs' }} + uses: actions/checkout@v2 + with: + fetch-depth: 0 + persist-credentials: false + + - name: "PDK Release prep" + uses: docker://puppet/pdk:nightly + with: + args: 'release prep --force' + env: + CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Get Version" + if: ${{ github.repository_owner == 'puppetlabs' }} + id: gv + run: | + echo "::set-output name=ver::$(cat metadata.json | jq .version | tr -d \")" + + - name: "Commit changes" + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + git add . + git commit -m "Release prep v${{ steps.gv.outputs.ver }}" + + - name: Create Pull Request + id: cpr + uses: puppetlabs/peter-evans-create-pull-request@v3 + if: ${{ github.repository_owner == 'puppetlabs' }} + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "Release prep v${{ steps.gv.outputs.ver }}" + branch: "release-prep" + delete-branch: true + title: "Release prep v${{ steps.gv.outputs.ver }}" + body: "Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb)" + labels: "maintenance" + + - name: PR outputs + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" + + - name: "Honeycomb: Record finish step" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow' diff --git a/.rubocop.yml b/.rubocop.yml index 8dcd675f..8f782e74 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -29,6 +29,9 @@ RSpec/BeforeAfterAll: RSpec/HookArgument: Description: Prefer explicit :each argument, matching existing module's style EnforcedStyle: each +RSpec/DescribeSymbol: + Exclude: + - spec/unit/facter/**/*.rb Style/BlockDelimiters: Description: Prefer braces for chaining. Mostly an aesthetical choice. Better to be consistent then. @@ -404,6 +407,8 @@ Style/ExponentialNotation: Enabled: false Style/FloatDivision: Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false Style/GlobalStdStream: Enabled: false Style/HashAsLastArrayItem: diff --git a/metadata.json b/metadata.json index fd0ae4ce..4b36b02d 100644 --- a/metadata.json +++ b/metadata.json @@ -82,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g1862b96", - "pdk-version": "1.19.0.pre (47)" + "template-ref": "heads/main-0-g44cc7ed", + "pdk-version": "1.18.1" } From f48ed2fbe9e4f4c19597a47a4308811237f5dfd8 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Tue, 16 Feb 2021 19:19:04 +0200 Subject: [PATCH 103/259] Add auto_release.yml to sync.yml --- .sync.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.sync.yml b/.sync.yml index 4c6ce9ed..39bd1f92 100644 --- a/.sync.yml +++ b/.sync.yml @@ -42,3 +42,5 @@ spec/spec_helper.rb: unmanaged: false .github/workflows/pr_test.yml: unmanaged: false +.github/workflows/auto_release.yml: + unmanaged: false From c3a5d5598934553415742d92ba736a0377618c10 Mon Sep 17 00:00:00 2001 From: Ryan Dill Date: Tue, 16 Feb 2021 20:39:24 -0800 Subject: [PATCH 104/259] (MODULES-10935) - Update fact used on Darwin in java_version unit test --- spec/unit/facter/java_version_spec.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index bb4b167b..2f31f6b0 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -32,9 +32,9 @@ end context 'when on Darwin' do before(:each) do - allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('Darwin') + allow(Facter.fact(:kernel)).to receive(:value).and_return('Darwin') end - let(:facts) { { operatingsystem: 'Darwin' } } + let(:facts) { { kernel: 'Darwin' } } it do expect(Facter::Util::Resolution).to receive(:exec).with('/usr/libexec/java_home --failfast 2>&1').and_return('/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home') @@ -71,9 +71,9 @@ end context 'when on Darwin' do before(:each) do - allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('Darwin') + allow(Facter.fact(:kernel)).to receive(:value).and_return('Darwin') end - let(:facts) { { operatingsystem: 'Darwin' } } + let(:facts) { { kernel: 'Darwin' } } it do expect(Facter::Util::Resolution).to receive(:exec).with('/usr/libexec/java_home --failfast 2>&1').at_least(1).and_return('Unable to find any JVMs matching version "(null)".') From 8169c6684ede09b3d141e24a1340e1e025f56960 Mon Sep 17 00:00:00 2001 From: Paula Muir Date: Mon, 22 Feb 2021 16:33:42 +0000 Subject: [PATCH 105/259] (maint) Update major dependencies prior to release --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 4b36b02d..a3e6a434 100644 --- a/metadata.json +++ b/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.13.1 < 7.0.0" + "version_requirement": ">= 4.13.1 < 8.0.0" }, { "name": "puppet/archive", From 0547a5aef91d03f05c072731bbc448f8c8b54e12 Mon Sep 17 00:00:00 2001 From: Ciaran McCrisken Date: Wed, 24 Feb 2021 13:56:20 +0000 Subject: [PATCH 106/259] (MAINT) Remove RHEL 5 OS family support --- metadata.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/metadata.json b/metadata.json index a3e6a434..32f5ab68 100644 --- a/metadata.json +++ b/metadata.json @@ -21,7 +21,6 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "5", "6", "7", "8" @@ -30,7 +29,6 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "5", "6", "7", "8" From f5350ff75b95bf8765f8473595394096b59251bb Mon Sep 17 00:00:00 2001 From: Ciaran McCrisken Date: Wed, 24 Feb 2021 16:23:56 +0000 Subject: [PATCH 107/259] (MAINT) Remove SLES 11 support --- metadata.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata.json b/metadata.json index 32f5ab68..6de75a00 100644 --- a/metadata.json +++ b/metadata.json @@ -67,7 +67,6 @@ { "operatingsystem": "SLES", "operatingsystemrelease": [ - "11", "12", "15" ] From ee6eb4e4a1ae349d635f41c626bf86815554f9f8 Mon Sep 17 00:00:00 2001 From: Ciaran McCrisken Date: Thu, 25 Feb 2021 16:14:52 +0000 Subject: [PATCH 108/259] (MAINT) pdk update --- .github/workflows/auto_release.yml | 6 +++--- .github/workflows/nightly.yml | 19 +++++++++++-------- .github/workflows/pr_test.yml | 18 ++++++++++-------- metadata.json | 2 +- 4 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index a88b99ca..56b38d52 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -46,12 +46,12 @@ jobs: if: ${{ github.repository_owner == 'puppetlabs' }} id: gv run: | - echo "::set-output name=ver::$(cat metadata.json | jq .version | tr -d \")" + echo "::set-output name=ver::$(jq --raw-output .version metadata.json)" - name: "Commit changes" if: ${{ github.repository_owner == 'puppetlabs' }} run: | - git config --local user.email "action@github.com" + git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com" git config --local user.name "GitHub Action" git add . git commit -m "Release prep v${{ steps.gv.outputs.ver }}" @@ -66,7 +66,7 @@ jobs: branch: "release-prep" delete-branch: true title: "Release prep v${{ steps.gv.outputs.ver }}" - body: "Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb)" + body: "Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}" labels: "maintenance" - name: PR outputs diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0c1fd28b..abf8e7d7 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -58,7 +58,7 @@ jobs: if: ${{ github.repository_owner == 'puppetlabs' }} run: | if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata + buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 else echo "::set-output name=matrix::{}" fi @@ -69,6 +69,7 @@ jobs: buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' Acceptance: + name: "${{matrix.platforms.label}}, ${{matrix.collection}}" needs: - setup_matrix @@ -82,8 +83,10 @@ jobs: steps: - run: | - echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE + echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE + echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE + - name: "Honeycomb: Start recording" uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 @@ -91,11 +94,11 @@ jobs: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} job-status: ${{ job.status }} - matrix-key: ${{ matrix.platform }}-${{ matrix.collection }} + matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }} - name: "Honeycomb: start first step" run: | - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Checkout Source @@ -117,12 +120,12 @@ jobs: if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Provision test environment run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]' + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]' echo ::group::=== REQUEST === cat request.json || true echo @@ -144,7 +147,7 @@ jobs: run: | echo ::group::honeycomb step buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV echo ::endgroup:: @@ -156,7 +159,7 @@ jobs: if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Remove test environment diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index 207dfcad..fb9ff976 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -55,7 +55,7 @@ jobs: id: get-matrix run: | if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata + buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 else echo "::set-output name=matrix::{}" fi @@ -66,6 +66,7 @@ jobs: buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' Acceptance: + name: "${{matrix.platforms.label}}, ${{matrix.collection}}" needs: - setup_matrix if: ${{ needs.setup_matrix.outputs.matrix != '{}' }} @@ -80,8 +81,9 @@ jobs: steps: - run: | - echo 'platform=${{ matrix.platform }}' >> $BUILDEVENT_FILE + echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE + echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE - name: "Honeycomb: Start recording" uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 @@ -89,11 +91,11 @@ jobs: apikey: ${{ env.HONEYCOMB_WRITEKEY }} dataset: ${{ env.HONEYCOMB_DATASET }} job-status: ${{ job.status }} - matrix-key: ${{ matrix.platform }}-${{ matrix.collection }} + matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }} - name: "Honeycomb: start first step" run: | - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-1 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Checkout Source @@ -115,12 +117,12 @@ jobs: if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-2 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Provision test environment run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platform }}' -- bundle exec rake 'litmus:provision[provision::provision_service,${{ matrix.platform }}]' + buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]' echo ::group::=== REQUEST === cat request.json || true echo @@ -142,7 +144,7 @@ jobs: run: | echo ::group::honeycomb step buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-3 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV echo ::endgroup:: @@ -154,7 +156,7 @@ jobs: if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' - echo STEP_ID=${{ matrix.platform }}-${{ matrix.collection }}-4 >> $GITHUB_ENV + echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - name: Remove test environment diff --git a/metadata.json b/metadata.json index 6de75a00..bd3182c3 100644 --- a/metadata.json +++ b/metadata.json @@ -79,6 +79,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g44cc7ed", + "template-ref": "heads/main-0-g2bf2de6", "pdk-version": "1.18.1" } From 4ed5c8b966e105dce9a30688b044ae6c673c2264 Mon Sep 17 00:00:00 2001 From: Auto-release Date: Mon, 1 Mar 2021 15:44:13 +0000 Subject: [PATCH 109/259] Release version 7.0.0 --- CHANGELOG.md | 14 ++++- REFERENCE.md | 152 +++++++++++++++++++++++++++++++++----------------- metadata.json | 2 +- 3 files changed, 114 insertions(+), 54 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a8dc6b07..23fbe382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ 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). +## [v7.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.0) (2021-03-01) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.5.0...v7.0.0) + +### Changed + +- pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [\#463](https://github.com/puppetlabs/puppetlabs-java/pull/463) ([carabasdaniel](https://github.com/carabasdaniel)) + +### Fixed + +- \(MODULES-10935\) - Switch legacy operatingsystem fact to modern kernel one [\#461](https://github.com/puppetlabs/puppetlabs-java/pull/461) ([rjd1](https://github.com/rjd1)) + ## [v6.5.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.5.0) (2020-12-16) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.4.0...v6.5.0) @@ -463,4 +475,4 @@ Jeff McCune [2.2.0]:https://github.com/puppetlabs/puppetlabs-java/compare/2.1.1...2.2.0 -\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)* +\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* diff --git a/REFERENCE.md b/REFERENCE.md index a54ce039..654ee16d 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -25,15 +25,23 @@ options, even though those are not in the package repositories. ## Classes -### `java` +### `java` This module manages the Java runtime package #### Parameters -The following parameters are available in the `java` class. +The following parameters are available in the `java` class: -##### `distribution` +* [`distribution`](#distribution) +* [`version`](#version) +* [`package`](#package) +* [`package_options`](#package_options) +* [`java_alternative`](#java_alternative) +* [`java_alternative_path`](#java_alternative_path) +* [`java_home`](#java_home) + +##### `distribution` Data type: `String` @@ -43,7 +51,7 @@ implementations available (eg: OpenJDK vs Oracle JDK). Default value: `'jdk'` -##### `version` +##### `version` Data type: `Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/]` @@ -52,7 +60,7 @@ that java is present, and does not require a specific version. Default value: `'present'` -##### `package` +##### `package` Data type: `Optional[String]` @@ -61,7 +69,7 @@ java package is desired. Default value: ``undef`` -##### `package_options` +##### `package_options` Data type: `Optional[Array]` @@ -70,7 +78,7 @@ Options available depend on the 'package' provider for the target OS. Default value: ``undef`` -##### `java_alternative` +##### `java_alternative` Data type: `Optional[String]` @@ -82,7 +90,7 @@ this, you also need to set the path below. Default value: ``undef`` -##### `java_alternative_path` +##### `java_alternative_path` Data type: `Optional[String]` @@ -93,7 +101,7 @@ correct JVM is enabled. Default value: ``undef`` -##### `java_home` +##### `java_home` Data type: `Optional[String]` @@ -104,15 +112,28 @@ Default value: ``undef`` ## Defined types -### `java::adopt` +### `java::adopt` Defined Type java::adopt #### Parameters -The following parameters are available in the `java::adopt` defined type. +The following parameters are available in the `java::adopt` defined type: + +* [`ensure`](#ensure) +* [`version`](#version) +* [`version_major`](#version_major) +* [`version_minor`](#version_minor) +* [`java`](#java) +* [`proxy_server`](#proxy_server) +* [`proxy_type`](#proxy_type) +* [`basedir`](#basedir) +* [`manage_basedir`](#manage_basedir) +* [`package_type`](#package_type) +* [`manage_symlink`](#manage_symlink) +* [`symlink_name`](#symlink_name) -##### `ensure` +##### `ensure` Data type: `Any` @@ -120,7 +141,7 @@ Install or remove the package. Default value: `'present'` -##### `version` +##### `version` Data type: `Any` @@ -128,7 +149,7 @@ Version of Java to install, e.g. '8' or '9'. Default values for major and minor Default value: `'8'` -##### `version_major` +##### `version_major` Data type: `Any` @@ -136,7 +157,7 @@ Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used t Default value: ``undef`` -##### `version_minor` +##### `version_minor` Data type: `Any` @@ -144,7 +165,7 @@ Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' Default value: ``undef`` -##### `java` +##### `java` Data type: `Any` @@ -152,7 +173,7 @@ Type of Java Standard Edition to install, jdk or jre. Default value: `'jdk'` -##### `proxy_server` +##### `proxy_server` Data type: `Any` @@ -160,7 +181,7 @@ Specify a proxy server, with port number if needed. ie: https://example.com:8080 Default value: ``undef`` -##### `proxy_type` +##### `proxy_type` Data type: `Any` @@ -168,7 +189,7 @@ Proxy server type (none|http|https|ftp). (passed to archive) Default value: ``undef`` -##### `basedir` +##### `basedir` Data type: `Any` @@ -177,7 +198,7 @@ Directory under which the installation will occur. If not set, defaults to Default value: ``undef`` -##### `manage_basedir` +##### `manage_basedir` Data type: `Any` @@ -186,7 +207,7 @@ Note: /usr/lib/jvm is managed for Debian by default, separate from this paramete Default value: ``true`` -##### `package_type` +##### `package_type` Data type: `Any` @@ -196,7 +217,7 @@ Optional forced package types: rpm, rpmbin, tar.gz Default value: ``undef`` -##### `manage_symlink` +##### `manage_symlink` Data type: `Any` @@ -204,7 +225,7 @@ Whether to manage a symlink that points to the installation directory. Defaults Default value: ``false`` -##### `symlink_name` +##### `symlink_name` Data type: `Any` @@ -212,15 +233,31 @@ The name for the optional symlink in the installation directory. Default value: ``undef`` -### `java::download` +### `java::download` Defined Type java::download #### Parameters -The following parameters are available in the `java::download` defined type. +The following parameters are available in the `java::download` defined type: -##### `ensure` +* [`ensure`](#ensure) +* [`version`](#version) +* [`version_major`](#version_major) +* [`version_minor`](#version_minor) +* [`java_se`](#java_se) +* [`proxy_server`](#proxy_server) +* [`proxy_type`](#proxy_type) +* [`url`](#url) +* [`jce`](#jce) +* [`jce_url`](#jce_url) +* [`basedir`](#basedir) +* [`manage_basedir`](#manage_basedir) +* [`package_type`](#package_type) +* [`manage_symlink`](#manage_symlink) +* [`symlink_name`](#symlink_name) + +##### `ensure` Data type: `Any` @@ -228,7 +265,7 @@ Install or remove the package. Default value: `'present'` -##### `version` +##### `version` Data type: `Any` @@ -236,7 +273,7 @@ Version of Java to install, e.g. '7' or '8'. Default values for major and minor Default value: `'8'` -##### `version_major` +##### `version_major` Data type: `Any` @@ -244,7 +281,7 @@ Major version which should be installed, e.g. '8u101'. Must be used together wit Default value: ``undef`` -##### `version_minor` +##### `version_minor` Data type: `Any` @@ -252,7 +289,7 @@ Minor version which should be installed, e.g. 'b12'. Must be used together with Default value: ``undef`` -##### `java_se` +##### `java_se` Data type: `Any` @@ -260,7 +297,7 @@ Type of Java Standard Edition to install, jdk or jre. Default value: `'jdk'` -##### `proxy_server` +##### `proxy_server` Data type: `Any` @@ -268,7 +305,7 @@ Specify a proxy server, with port number if needed. ie: https://example.com:8080 Default value: ``undef`` -##### `proxy_type` +##### `proxy_type` Data type: `Any` @@ -276,7 +313,7 @@ Proxy server type (none|http|https|ftp). (passed to archive) Default value: ``undef`` -##### `url` +##### `url` Data type: `Any` @@ -284,7 +321,7 @@ Full URL Default value: ``undef`` -##### `jce` +##### `jce` Data type: `Any` @@ -292,7 +329,7 @@ Install Oracles Java Cryptographic Extensions into the JRE or JDK Default value: ``false`` -##### `jce_url` +##### `jce_url` Data type: `Any` @@ -300,7 +337,7 @@ Full URL to the jce zip file Default value: ``undef`` -##### `basedir` +##### `basedir` Data type: `Any` @@ -309,7 +346,7 @@ Directory under which the installation will occur. If not set, defaults to Default value: ``undef`` -##### `manage_basedir` +##### `manage_basedir` Data type: `Any` @@ -318,7 +355,7 @@ Note: /usr/lib/jvm is managed for Debian by default, separate from this paramete Default value: ``false`` -##### `package_type` +##### `package_type` Data type: `Any` @@ -328,7 +365,7 @@ Optional forced package types: rpm, rpmbin, tar.gz Default value: ``undef`` -##### `manage_symlink` +##### `manage_symlink` Data type: `Any` @@ -336,7 +373,7 @@ Whether to manage a symlink that points to the installation directory. Defaults Default value: ``false`` -##### `symlink_name` +##### `symlink_name` Data type: `Any` @@ -344,15 +381,26 @@ The name for the optional symlink in the installation directory. Default value: ``undef`` -### `java::sap` +### `java::sap` Defined Type java::sap #### Parameters -The following parameters are available in the `java::sap` defined type. +The following parameters are available in the `java::sap` defined type: + +* [`ensure`](#ensure) +* [`version`](#version) +* [`version_full`](#version_full) +* [`java`](#java) +* [`proxy_server`](#proxy_server) +* [`proxy_type`](#proxy_type) +* [`basedir`](#basedir) +* [`manage_basedir`](#manage_basedir) +* [`manage_symlink`](#manage_symlink) +* [`symlink_name`](#symlink_name) -##### `ensure` +##### `ensure` Data type: `Any` @@ -360,7 +408,7 @@ Install or remove the package. Default value: `'present'` -##### `version` +##### `version` Data type: `Any` @@ -368,7 +416,7 @@ Version of Java to install, e.g. '8' or '9'. Default values for full versions wi Default value: `'8'` -##### `version_full` +##### `version_full` Data type: `Any` @@ -376,7 +424,7 @@ Major version which should be installed, e.g. '8.1.063' or '11.0.7'. If used, "v Default value: ``undef`` -##### `java` +##### `java` Data type: `Any` @@ -384,7 +432,7 @@ Type of Java Edition to install, jdk or jre. Default value: `'jdk'` -##### `proxy_server` +##### `proxy_server` Data type: `Any` @@ -392,7 +440,7 @@ Specify a proxy server, with port number if needed. ie: https://example.com:8080 Default value: ``undef`` -##### `proxy_type` +##### `proxy_type` Data type: `Any` @@ -400,7 +448,7 @@ Proxy server type (none|http|https|ftp). (passed to archive) Default value: ``undef`` -##### `basedir` +##### `basedir` Data type: `Any` @@ -409,7 +457,7 @@ Directory under which the installation will occur. If not set, defaults to Default value: ``undef`` -##### `manage_basedir` +##### `manage_basedir` Data type: `Any` @@ -418,7 +466,7 @@ Note: /usr/lib/jvm is managed for Debian by default, separate from this paramete Default value: ``true`` -##### `manage_symlink` +##### `manage_symlink` Data type: `Any` @@ -426,7 +474,7 @@ Whether to manage a symlink that points to the installation directory. Defaults Default value: ``false`` -##### `symlink_name` +##### `symlink_name` Data type: `Any` diff --git a/metadata.json b/metadata.json index bd3182c3..a5206cd2 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "6.5.0", + "version": "7.0.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From a83c5a60bcf27952f79a53dbe05d005b3ee25046 Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 15 Mar 2021 18:45:24 +0200 Subject: [PATCH 110/259] Replace Travis and Appveyor with Github Actions --- .github/workflows/auto_release.yml | 2 +- .github/workflows/nightly.yml | 11 ++- .github/workflows/pr_test.yml | 11 ++- .github/workflows/release.yml | 47 +++++++++++ .github/workflows/spec.yml | 128 +++++++++++++++++++++++++++++ .pdkignore | 1 + .sync.yml | 32 ++------ .travis.yml | 89 -------------------- metadata.json | 2 +- 9 files changed, 204 insertions(+), 119 deletions(-) create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/spec.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index 56b38d52..affeca90 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -36,7 +36,7 @@ jobs: persist-credentials: false - name: "PDK Release prep" - uses: docker://puppet/pdk:nightly + uses: docker://puppet/iac_release:ci with: args: 'release prep --force' env: diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index abf8e7d7..865578cf 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -131,7 +131,14 @@ jobs: echo echo ::endgroup:: echo ::group::=== INVENTORY === - sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true + if [ -f 'spec/fixtures/litmus_inventory.yaml' ]; + then + FILE='spec/fixtures/litmus_inventory.yaml' + elif [ -f 'inventory.yaml' ]; + then + FILE='inventory.yaml' + fi + sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true echo ::endgroup:: - name: Install agent @@ -166,7 +173,7 @@ jobs: if: ${{ always() }} continue-on-error: true run: | - if [ -f inventory.yaml ]; then + if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' echo ::group::=== REQUEST === cat request.json || true diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index fb9ff976..69e414b5 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -128,7 +128,14 @@ jobs: echo echo ::endgroup:: echo ::group::=== INVENTORY === - sed -e 's/password: .*/password: "[redacted]"/' < inventory.yaml || true + if [ -f 'spec/fixtures/litmus_inventory.yaml' ]; + then + FILE='spec/fixtures/litmus_inventory.yaml' + elif [ -f 'inventory.yaml' ]; + then + FILE='inventory.yaml' + fi + sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true echo ::endgroup:: - name: Install agent @@ -163,7 +170,7 @@ jobs: if: ${{ always() }} continue-on-error: true run: | - if [ -f inventory.yaml ]; then + if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' echo ::group::=== REQUEST === cat request.json || true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..1509f6e9 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: "Publish module" + +on: + workflow_dispatch: + +jobs: + create-github-release: + name: Deploy GitHub Release + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + clean: true + fetch-depth: 0 + - name: Get Version + id: gv + run: | + echo "::set-output name=ver::$(jq --raw-output .version metadata.json)" + - name: Create Release + uses: actions/create-release@v1 + id: create_release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: "v${{ steps.gv.outputs.ver }}" + draft: false + prerelease: false + + deploy-forge: + name: Deploy to Forge + runs-on: ubuntu-20.04 + steps: + - name: Checkout code + uses: actions/checkout@v2 + with: + ref: ${{ github.ref }} + clean: true + - name: "PDK Build" + uses: docker://puppet/pdk:nightly + with: + args: 'build' + - name: "Push to Forge" + uses: docker://puppet/pdk:nightly + with: + args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force' diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml new file mode 100644 index 00000000..03e2cb8d --- /dev/null +++ b/.github/workflows/spec.yml @@ -0,0 +1,128 @@ +name: "Spec Tests" + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + pull_request: + +env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 + HONEYCOMB_DATASET: litmus tests + +jobs: + setup_matrix: + name: "Setup Test Matrix" + runs-on: ubuntu-20.04 + outputs: + spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }} + + steps: + - name: "Honeycomb: Start recording" + uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 + with: + apikey: ${{ env.HONEYCOMB_WRITEKEY }} + dataset: ${{ env.HONEYCOMB_DATASET }} + job-status: ${{ job.status }} + + - name: "Honeycomb: Start first step" + run: | + echo STEP_ID=setup-environment >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + + - name: Checkout Source + uses: actions/checkout@v2 + if: ${{ github.repository_owner == 'puppetlabs' }} + + - name: Activate Ruby 2.7 + uses: ruby/setup-ruby@v1 + if: ${{ github.repository_owner == 'puppetlabs' }} + with: + ruby-version: "2.7" + bundler-cache: true + + - name: Print bundle environment + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + echo ::group::bundler environment + buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env + echo ::endgroup:: + + - name: "Honeycomb: Record Setup Environment time" + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' + echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + + - name: Setup Spec Test Matrix + id: get-matrix + run: | + if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then + buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 + else + echo "::set-output name=spec_matrix::{}" + fi + + - name: "Honeycomb: Record Setup Test Matrix time" + if: ${{ always() }} + run: | + buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' + + Spec: + name: "Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})" + needs: + - setup_matrix + if: ${{ needs.setup_matrix.outputs.spec_matrix != '{}' }} + + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + matrix: ${{fromJson(needs.setup_matrix.outputs.spec_matrix)}} + + env: + BUILDEVENT_FILE: '../buildevents.txt' + PUPPET_GEM_VERSION: ${{ matrix.puppet_version }} + + steps: + - run: | + echo "SANITIZED_PUPPET_VERSION=$(echo '${{ matrix.puppet_version }}' | sed 's/~> //g')" >> $GITHUB_ENV + + - run: | + echo 'puppet_version=${{ env.SANITIZED_PUPPET_VERSION }}' >> $BUILDEVENT_FILE + + - name: "Honeycomb: Start first step" + run: | + echo "STEP_ID=${{ env.SANITIZED_PUPPET_VERSION }}-spec" >> $GITHUB_ENV + echo STEP_START=$(date +%s) >> $GITHUB_ENV + + - name: "Honeycomb: Start recording" + uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 + with: + apikey: ${{ env.HONEYCOMB_WRITEKEY }} + dataset: ${{ env.HONEYCOMB_DATASET }} + job-status: ${{ job.status }} + matrix-key: ${{ env.SANITIZED_PUPPET_VERSION }} + + - name: Checkout Source + uses: actions/checkout@v2 + + - name: "Activate Ruby ${{ matrix.ruby_version }}" + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{matrix.ruby_version}} + bundler-cache: true + + - name: Print bundle environment + run: | + echo ::group::bundler environment + buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env + echo ::endgroup:: + + - name: Run Static & Syntax Tests + run: | + buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop + + - name: Run parallel_spec tests + run: | + buildevents cmd $TRACE_ID $STEP_ID 'rake parallel_spec Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake parallel_spec diff --git a/.pdkignore b/.pdkignore index 254808c8..a74c4c4f 100644 --- a/.pdkignore +++ b/.pdkignore @@ -42,3 +42,4 @@ /spec/ /.vscode/ /.sync.yml +/.devcontainer/ diff --git a/.sync.yml b/.sync.yml index 39bd1f92..d03bffc6 100644 --- a/.sync.yml +++ b/.sync.yml @@ -1,32 +1,9 @@ --- ".gitlab-ci.yml": delete: true -".travis.yml": - global_env: - - HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests" - deploy_to_forge: - enabled: false - branches: - - release - use_litmus: true - litmus: - provision_list: - - ---travis_el - - travis_deb - - travis_el7 - - travis_el8 - complex: - - collection: - puppet_collection: - - puppet6 - provision_list: - - travis_ub_6 - simplecov: true - notifications: - slack: - secure: Wf7Wz3KC0G9ngPiDcOIpSqcCfdvwKQqZdNH/z3GMcj/OipMAdyFSAVnBvikIl7L1c0LMU9ATEpub+jYzViT7RZywaNyer6SRAfs6MIgAYo4xxF/mOnDHAxXeUYAsBXXL4sS3NX2XWMPa9ZWUeuUQKth8O4STWgAX298QZLyYx5k= appveyor.yml: delete: true + Gemfile: optional: ":development": @@ -44,3 +21,10 @@ spec/spec_helper.rb: unmanaged: false .github/workflows/auto_release.yml: unmanaged: false +.github/workflows/spec.yml: + checks: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop' + unmanaged: false +.github/workflows/release.yml: + unmanaged: false +.travis.yml: + delete: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 8e824d6b..00000000 --- a/.travis.yml +++ /dev/null @@ -1,89 +0,0 @@ ---- -os: linux -dist: xenial -language: ruby -cache: bundler -before_install: - - bundle -v - - rm -f Gemfile.lock - - "# Update system gems if requested. This is useful to temporarily workaround troubles in the test runner" - - "# See https://github.com/puppetlabs/pdk-templates/commit/705154d5c437796b821691b707156e1b056d244f for an example of how this was used" - - "# Ignore exit code of SIGPIPE'd yes to not fail with shell's pipefail set" - - '[ -z "$RUBYGEMS_VERSION" ] || (yes || true) | gem update --system $RUBYGEMS_VERSION' - - gem --version - - bundle -v -script: - - 'SIMPLECOV=yes bundle exec rake $CHECK' -bundler_args: --without system_tests -rvm: - - 2.5.7 -env: - global: - - HONEYCOMB_WRITEKEY="7f3c63a70eecc61d635917de46bea4e6",HONEYCOMB_DATASET="litmus tests" -stages: - - static - - spec - - acceptance -jobs: - fast_finish: true - include: - - before_script: - - "bundle exec rake 'litmus:provision_list[travis_ub_6]'" - - "bundle exec rake 'litmus:install_agent[puppet6]'" - - "bundle exec rake litmus:install_module" - env: - PLATFORMS: travis_ub_6_puppet6 - BUNDLE_WITH: system_tests - 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]'" - - "bundle exec rake 'litmus:install_agent[puppet6]'" - - "bundle exec rake litmus:install_module" - env: - PLATFORMS: travis_deb_puppet6 - BUNDLE_WITH: system_tests - 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_el7]'" - - "bundle exec rake 'litmus:install_agent[puppet6]'" - - "bundle exec rake litmus:install_module" - env: - PLATFORMS: travis_el7_puppet6 - BUNDLE_WITH: system_tests - 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_el8]'" - - "bundle exec rake 'litmus:install_agent[puppet6]'" - - "bundle exec rake litmus:install_module" - env: - PLATFORMS: travis_el8_puppet6 - BUNDLE_WITH: system_tests - 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 - - - env: PUPPET_GEM_VERSION="~> 6.0" CHECK=parallel_spec - rvm: 2.5.7 - stage: spec -branches: - only: - - main - - /^v\d/ - - release -notifications: - email: false - slack: - secure: Wf7Wz3KC0G9ngPiDcOIpSqcCfdvwKQqZdNH/z3GMcj/OipMAdyFSAVnBvikIl7L1c0LMU9ATEpub+jYzViT7RZywaNyer6SRAfs6MIgAYo4xxF/mOnDHAxXeUYAsBXXL4sS3NX2XWMPa9ZWUeuUQKth8O4STWgAX298QZLyYx5k= diff --git a/metadata.json b/metadata.json index a5206cd2..09507105 100644 --- a/metadata.json +++ b/metadata.json @@ -79,6 +79,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g2bf2de6", + "template-ref": "heads/main-0-g7be43a3", "pdk-version": "1.18.1" } From 7b8c7ba42faccbe0c6d0ee5f046b16ecc53f844d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bobinec?= Date: Tue, 23 Mar 2021 08:57:37 +0100 Subject: [PATCH 111/259] add url parameter for adoptopenjdk --- manifests/adopt.pp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index c460069f..e01a85ef 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -24,6 +24,9 @@ # @param proxy_type # Proxy server type (none|http|https|ftp). (passed to archive) # +# @param url +# Full URL +# # @param basedir # Directory under which the installation will occur. If not set, defaults to # /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -51,6 +54,7 @@ $java = 'jdk', $proxy_server = undef, $proxy_type = undef, + $url = undef, $basedir = undef, $manage_basedir = true, $package_type = undef, @@ -234,7 +238,15 @@ $spacer = '%2B' $download_folder_prefix = 'jdk-' } - $source = "https://github.com/AdoptOpenJDK/openjdk${_version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor}/${package_name}" + + # if complete URL is provided, use this value for source in archive resource + if $url { + $source = $url + } + else { + $source = "https://github.com/AdoptOpenJDK/openjdk${_version}-binaries/releases/download/${download_folder_prefix}${release_major}${spacer}${release_minor}/${package_name}" + notice ("Default source url : ${source}") + } # full path to the installer $destination = "${destination_dir}${package_name}" From 4e2217986e648bbe259fccd8d5496199be3c5b97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Bobinec?= Date: Fri, 2 Apr 2021 12:20:13 +0200 Subject: [PATCH 112/259] update documentation with puppet strings --- REFERENCE.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index 654ee16d..61fdc790 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -127,6 +127,7 @@ The following parameters are available in the `java::adopt` defined type: * [`java`](#java) * [`proxy_server`](#proxy_server) * [`proxy_type`](#proxy_type) +* [`url`](#url) * [`basedir`](#basedir) * [`manage_basedir`](#manage_basedir) * [`package_type`](#package_type) @@ -189,6 +190,14 @@ Proxy server type (none|http|https|ftp). (passed to archive) Default value: ``undef`` +##### `url` + +Data type: `Any` + +Full URL + +Default value: ``undef`` + ##### `basedir` Data type: `Any` @@ -481,4 +490,3 @@ Data type: `Any` The name for the optional symlink in the installation directory. Default value: ``undef`` - From 56f3f10b1d1d1487d84a9d53cb95ed20c7ff576c Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Fri, 2 Apr 2021 14:19:37 +0300 Subject: [PATCH 113/259] PDK Update for release prep workflow --- .github/workflows/auto_release.yml | 7 ++++++- Gemfile | 10 ---------- metadata.json | 2 +- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index affeca90..d15d148d 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -66,7 +66,12 @@ jobs: branch: "release-prep" delete-branch: true title: "Release prep v${{ steps.gv.outputs.ver }}" - body: "Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}" + body: | + Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}. + Please verify before merging: + - [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green + - [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests + - [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match labels: "maintenance" - name: PR outputs diff --git a/Gemfile b/Gemfile index ae2b430d..135373d0 100644 --- a/Gemfile +++ b/Gemfile @@ -45,16 +45,6 @@ gems['puppet'] = location_for(puppet_version) gems['facter'] = location_for(facter_version) if facter_version gems['hiera'] = location_for(hiera_version) if hiera_version -if Gem.win_platform? && puppet_version =~ %r{^(file:///|git://)} - # If we're using a Puppet gem on Windows which handles its own win32-xxx gem - # dependencies (>= 3.5.0), set the maximum versions (see PUP-6445). - gems['win32-dir'] = ['<= 0.4.9', require: false] - gems['win32-eventlog'] = ['<= 0.6.5', require: false] - gems['win32-process'] = ['<= 0.7.5', require: false] - gems['win32-security'] = ['<= 0.2.5', require: false] - gems['win32-service'] = ['0.8.8', require: false] -end - gems.each do |gem_name, gem_params| gem gem_name, *gem_params end diff --git a/metadata.json b/metadata.json index 09507105..e341db7b 100644 --- a/metadata.json +++ b/metadata.json @@ -79,6 +79,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g7be43a3", + "template-ref": "heads/main-0-g12a5dea", "pdk-version": "1.18.1" } From 57c94e86e3ffd4fd3adec11d7f832ee6d9c6a0c4 Mon Sep 17 00:00:00 2001 From: David Swan Date: Wed, 7 Apr 2021 15:40:51 +0100 Subject: [PATCH 114/259] (maint) - Removal of Locales Folder --- locales/config.yaml | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 locales/config.yaml diff --git a/locales/config.yaml b/locales/config.yaml deleted file mode 100644 index 15a2d5eb..00000000 --- a/locales/config.yaml +++ /dev/null @@ -1,26 +0,0 @@ ---- -# This is the project-specific configuration file for setting up -# fast_gettext for your project. -gettext: - # This is used for the name of the .pot and .po files; they will be - # called .pot? - project_name: puppetlabs-java - # This is used in comments in the .pot and .po files to indicate what - # project the files belong to and should bea little more desctiptive than - # - package_name: puppetlabs-java - # The locale that the default messages in the .pot file are in - default_locale: en - # The email used for sending bug reports. - bugs_address: docs@puppet.com - # The holder of the copyright. - copyright_holder: Puppet, Inc. - # This determines which comments in code should be eligible for translation. - # Any comments that start with this string will be externalized. (Leave - # empty to include all.) - comments_tag: TRANSLATOR - # Patterns for +Dir.glob+ used to find all files that might contain - # translatable content, relative to the project root directory - source_files: - - './lib/**/*.rb' - From 69e9ffb19eab52a1e8cdc1b9b12c1fcf8a19a3ae Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 16 Apr 2021 13:13:21 +0200 Subject: [PATCH 115/259] puppet/archive: allow 5.x --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index e341db7b..18247ac8 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppet/archive", - "version_requirement": ">= 1.1.0 < 5.0.0" + "version_requirement": ">= 1.1.0 < 6.0.0" } ], "operatingsystem_support": [ From c76a66eb7ec8eed4f5435479c2aa9d6ff4b01470 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Sat, 17 Apr 2021 03:10:19 +0000 Subject: [PATCH 116/259] Release prep v7.0.1 --- CHANGELOG.md | 8 ++++++++ metadata.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 23fbe382..11285fbc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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). +## [v7.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.1) (2021-04-17) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.0...v7.0.1) + +### Fixed + +- allow v5.x of puppet/archive [\#476](https://github.com/puppetlabs/puppetlabs-java/pull/476) ([bastelfreak](https://github.com/bastelfreak)) + ## [v7.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.0) (2021-03-01) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.5.0...v7.0.0) diff --git a/metadata.json b/metadata.json index 18247ac8..00062bd1 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "7.0.0", + "version": "7.0.1", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 1c64b30c5dcb0b675d2eb7ad415829793a8c94c8 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 26 Apr 2021 08:48:51 +0000 Subject: [PATCH 117/259] Release prep v7.0.2 --- CHANGELOG.md | 10 +++++++++- metadata.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11285fbc..9ea24a29 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,15 @@ 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). -## [v7.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.1) (2021-04-17) +## [v7.0.2](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.2) (2021-04-26) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.1...v7.0.2) + +### Fixed + +- add url parameter for adoptopenjdk [\#473](https://github.com/puppetlabs/puppetlabs-java/pull/473) ([cbobinec](https://github.com/cbobinec)) + +## [v7.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.1) (2021-04-19) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.0...v7.0.1) diff --git a/metadata.json b/metadata.json index 00062bd1..cd6a1f86 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "7.0.1", + "version": "7.0.2", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From c0ce63019e13335b60b2596ac695642c2b74bb90 Mon Sep 17 00:00:00 2001 From: Paula Muir Date: Mon, 26 Apr 2021 21:07:54 +0100 Subject: [PATCH 118/259] (maint) Running a pdk update to consume latest pdk-template changes --- .github/workflows/release.yml | 4 ++-- .gitignore | 1 + .gitpod.yml | 2 +- .pdkignore | 1 + metadata.json | 4 ++-- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1509f6e9..76cf31ca 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,10 +38,10 @@ jobs: ref: ${{ github.ref }} clean: true - name: "PDK Build" - uses: docker://puppet/pdk:nightly + uses: docker://puppet/pdk:2.1.0.0 with: args: 'build' - name: "Push to Forge" - uses: docker://puppet/pdk:nightly + uses: docker://puppet/pdk:2.1.0.0 with: args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force' diff --git a/.gitignore b/.gitignore index 2767022c..988dcbbe 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ .project .envrc /inventory.yaml +/spec/fixtures/litmus_inventory.yaml diff --git a/.gitpod.yml b/.gitpod.yml index 18406c50..9d89d9fa 100644 --- a/.gitpod.yml +++ b/.gitpod.yml @@ -6,4 +6,4 @@ tasks: vscode: extensions: - - puppet.puppet-vscode@1.0.0:oSzfTkDf6Cmc1jOjgW33VA== + - puppet.puppet-vscode@1.2.0:f5iEPbmOj6FoFTOV6q8LTg== diff --git a/.pdkignore b/.pdkignore index a74c4c4f..33a13477 100644 --- a/.pdkignore +++ b/.pdkignore @@ -25,6 +25,7 @@ .project .envrc /inventory.yaml +/spec/fixtures/litmus_inventory.yaml /appveyor.yml /.fixtures.yml /Gemfile diff --git a/metadata.json b/metadata.json index cd6a1f86..e6ccfac6 100644 --- a/metadata.json +++ b/metadata.json @@ -79,6 +79,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g12a5dea", - "pdk-version": "1.18.1" + "template-ref": "heads/main-0-ge04486b", + "pdk-version": "2.0.0" } From e9a1c62f0de1c42471120665bbfc9675a2fa63af Mon Sep 17 00:00:00 2001 From: Daniel Carabas Date: Mon, 7 Jun 2021 13:07:20 +0300 Subject: [PATCH 119/259] (maint) pdksync - PDK Update --- .github/workflows/auto_release.yml | 2 -- .github/workflows/release.yml | 4 ++-- .github/workflows/spec.yml | 1 + .pdkignore | 1 + metadata.json | 4 ++-- spec/spec_helper.rb | 12 ++++++++++++ 6 files changed, 18 insertions(+), 6 deletions(-) diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index d15d148d..e0284836 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -1,8 +1,6 @@ name: "Auto release" on: - schedule: - - cron: '0 3 * * 6' workflow_dispatch: env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 76cf31ca..1509f6e9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -38,10 +38,10 @@ jobs: ref: ${{ github.ref }} clean: true - name: "PDK Build" - uses: docker://puppet/pdk:2.1.0.0 + uses: docker://puppet/pdk:nightly with: args: 'build' - name: "Push to Forge" - uses: docker://puppet/pdk:2.1.0.0 + uses: docker://puppet/pdk:nightly with: args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force' diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 03e2cb8d..16f93160 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -83,6 +83,7 @@ jobs: env: BUILDEVENT_FILE: '../buildevents.txt' PUPPET_GEM_VERSION: ${{ matrix.puppet_version }} + FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' steps: - run: | diff --git a/.pdkignore b/.pdkignore index 33a13477..c538bea8 100644 --- a/.pdkignore +++ b/.pdkignore @@ -27,6 +27,7 @@ /inventory.yaml /spec/fixtures/litmus_inventory.yaml /appveyor.yml +/.editorconfig /.fixtures.yml /Gemfile /.gitattributes diff --git a/metadata.json b/metadata.json index e6ccfac6..c77ea265 100644 --- a/metadata.json +++ b/metadata.json @@ -79,6 +79,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-ge04486b", - "pdk-version": "2.0.0" + "template-ref": "heads/main-0-g03daa92", + "pdk-version": "2.1.0" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 16764b6f..07db7342 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -48,6 +48,18 @@ c.after(:suite) do RSpec::Puppet::Coverage.report!(0) end + + # Filter backtrace noise + backtrace_exclusion_patterns = [ + %r{spec_helper}, + %r{gems}, + ] + + if c.respond_to?(:backtrace_exclusion_patterns) + c.backtrace_exclusion_patterns = backtrace_exclusion_patterns + elsif c.respond_to?(:backtrace_clean_patterns) + c.backtrace_clean_patterns = backtrace_exclusion_patterns + end end # Ensures that a module is defined From 4b58529ad510c992688c544cb881f6723267a523 Mon Sep 17 00:00:00 2001 From: Paula Muir Date: Tue, 20 Jul 2021 15:28:53 +0100 Subject: [PATCH 120/259] (maint) Updating CONTRIBUTING guidelines --- CONTRIBUTING.md | 270 +----------------------------------------------- 1 file changed, 1 insertion(+), 269 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9c171f99..e7a3a7c3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,271 +1,3 @@ # Contributing to Puppet modules -So you want to contribute to a Puppet module: Great! Below are some instructions to get you started doing -that very thing while setting expectations around code quality as well as a few tips for making the -process as easy as possible. - -### Table of Contents - -1. [Getting Started](#getting-started) -1. [Commit Checklist](#commit-checklist) -1. [Submission](#submission) -1. [More about commits](#more-about-commits) -1. [Testing](#testing) - - [Running Tests](#running-tests) - - [Writing Tests](#writing-tests) -1. [Get Help](#get-help) - -## Getting Started - -- Fork the module repository on GitHub and clone to your workspace - -- Make your changes! - -## Commit Checklist - -### The Basics - -- [x] my commit is a single logical unit of work - -- [x] I have checked for unnecessary whitespace with "git diff --check" - -- [x] my commit does not include commented out code or unneeded files - -### The Content - -- [x] my commit includes tests for the bug I fixed or feature I added - -- [x] my commit includes appropriate documentation changes if it is introducing a new feature or changing existing functionality - -- [x] my code passes existing test suites - -### The Commit Message - -- [x] the first line of my commit message includes: - - - [x] an issue number (if applicable), e.g. "(MODULES-xxxx) This is the first line" - - - [x] a short description (50 characters is the soft limit, excluding ticket number(s)) - -- [x] the body of my commit message: - - - [x] is meaningful - - - [x] uses the imperative, present tense: "change", not "changed" or "changes" - - - [x] includes motivation for the change, and contrasts its implementation with the previous behavior - -## Submission - -### Pre-requisites - -- Make sure you have a [GitHub account](https://github.com/join) - -- [Create a ticket](https://tickets.puppet.com/secure/CreateIssue!default.jspa), or [watch the ticket](https://tickets.puppet.com/browse/) you are patching for. - -### Push and PR - -- Push your changes to your fork - -- [Open a Pull Request](https://help.github.com/articles/creating-a-pull-request-from-a-fork/) against the repository in the puppetlabs organization - -## More about commits - - 1. Make separate commits for logically separate changes. - - Please break your commits down into logically consistent units - which include new or changed tests relevant to the rest of the - change. The goal of doing this is to make the diff easier to - read for whoever is reviewing your code. In general, the easier - your diff is to read, the more likely someone will be happy to - review it and get it into the code base. - - If you are going to refactor a piece of code, please do so as a - separate commit from your feature or bug fix changes. - - We also really appreciate changes that include tests to make - sure the bug is not re-introduced, and that the feature is not - accidentally broken. - - Describe the technical detail of the change(s). If your - description starts to get too long, that is a good sign that you - probably need to split up your commit into more finely grained - pieces. - - Commits which plainly describe the things which help - reviewers check the patch and future developers understand the - code are much more likely to be merged in with a minimum of - bike-shedding or requested changes. Ideally, the commit message - would include information, and be in a form suitable for - inclusion in the release notes for the version of Puppet that - includes them. - - Please also check that you are not introducing any trailing - whitespace or other "whitespace errors". You can do this by - running "git diff --check" on your changes before you commit. - - 2. Sending your patches - - To submit your changes via a GitHub pull request, we _highly_ - recommend that you have them on a topic branch, instead of - 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. - - GitHub has some pretty good - [general documentation](http://help.github.com/) on using - their site. They also have documentation on - [creating pull requests](https://help.github.com/articles/creating-a-pull-request-from-a-fork/). - - In general, after pushing your topic branch up to your - repository on GitHub, you can switch to the branch in the - GitHub UI and click "Pull Request" towards the top of the page - in order to open a pull request. - - 3. Update the related JIRA issue. - - If there is a JIRA issue associated with the change you - submitted, then you should update the ticket to include the - location of your branch, along with any other commentary you - may wish to make. - -# Testing - -## Getting Started - -Our Puppet modules provide [`Gemfile`](./Gemfile)s, which can tell a Ruby package manager such as [bundler](http://bundler.io/) what Ruby packages, -or Gems, are required to build, develop, and test this software. - -Please make sure you have [bundler installed](http://bundler.io/#getting-started) on your system, and then use it to -install all dependencies needed for this project in the project root by running - -```shell -% bundle install --path .bundle/gems -Fetching gem metadata from https://rubygems.org/........ -Fetching gem metadata from https://rubygems.org/.. -Using rake (10.1.0) -Using builder (3.2.2) --- 8><-- many more --><8 -- -Using rspec-system-puppet (2.2.0) -Using serverspec (0.6.3) -Using rspec-system-serverspec (1.0.0) -Using bundler (1.3.5) -Your bundle is complete! -Use `bundle show [gemname]` to see where a bundled gem is installed. -``` - -NOTE: some systems may require you to run this command with sudo. - -If you already have those gems installed, make sure they are up-to-date: - -```shell -% bundle update -``` - -## Running Tests - -With all dependencies in place and up-to-date, run the tests: - -### Unit Tests - -```shell -% bundle exec rake spec -``` - -This executes all the [rspec tests](http://rspec-puppet.com/) in the directories defined [here](https://github.com/puppetlabs/puppetlabs_spec_helper/blob/699d9fbca1d2489bff1736bb254bb7b7edb32c74/lib/puppetlabs_spec_helper/rake_tasks.rb#L17) and so on. -rspec tests may have the same kind of dependencies as the module they are testing. Although the module defines these dependencies in its [metadata.json](./metadata.json), -rspec tests define them in [.fixtures.yml](./fixtures.yml). - -### Acceptance Tests - -Some Puppet modules also come with acceptance tests, which use [beaker][]. These tests spin up a virtual machine under -[VirtualBox](https://www.virtualbox.org/), controlled with [Vagrant](http://www.vagrantup.com/), to simulate scripted test -scenarios. In order to run these, you need both Virtualbox and Vagrant installed on your system. - -Run the tests by issuing the following command - -```shell -% bundle exec rake spec_clean -% bundle exec rspec spec/acceptance -``` - -This will now download a pre-fabricated image configured in the [default node-set](./spec/acceptance/nodesets/default.yml), -install Puppet, copy this module, and install its dependencies per [spec/spec_helper_acceptance.rb](./spec/spec_helper_acceptance.rb) -and then run all the tests under [spec/acceptance](./spec/acceptance). - -## Writing Tests - -### Unit Tests - -When writing unit tests for Puppet, [rspec-puppet][] is your best friend. It provides tons of helper methods for testing your manifests against a -catalog (e.g. contain_file, contain_package, with_params, etc). It would be ridiculous to try and top rspec-puppet's [documentation][rspec-puppet_docs] -but here's a tiny sample: - -Sample manifest: - -```puppet -file { "a test file": - ensure => present, - path => "/etc/sample", -} -``` - -Sample test: - -```ruby -it 'does a thing' do - expect(subject).to contain_file("a test file").with({:path => "/etc/sample"}) -end -``` - -### Acceptance Tests - -Writing acceptance tests for Puppet involves [beaker][] and its cousin [beaker-rspec][]. A common pattern for acceptance tests is to create a test manifest, apply it -twice to check for idempotency or errors, then run expectations. - -```ruby -it 'does an end-to-end thing' do - pp = <<-EOF - file { 'a test file': - ensure => present, - path => "/etc/sample", - content => "test string", - } - - apply_manifest(pp, :catch_failures => true) - apply_manifest(pp, :catch_changes => true) - -end - -describe file("/etc/sample") do - it { is_expected.to contain "test string" } -end - -``` - -# If you have commit access to the repository - -Even if you have commit access to the repository, you still need to go through the process above, and have someone else review and merge -in your changes. The rule is that **all changes must be reviewed by a project developer that did not write the code to ensure that -all changes go through a code review process.** - -The record of someone performing the merge is the record that they performed the code review. Again, this should be someone other than the author of the topic branch. - -# Get Help - -### On the web -* [Puppet help messageboard](http://puppet.com/community/get-help) -* [Writing tests](https://docs.puppet.com/guides/module_guides/bgtm.html#step-three-module-testing) -* [General GitHub documentation](http://help.github.com/) -* [GitHub pull request documentation](http://help.github.com/send-pull-requests/) - -### On chat -* Slack (slack.puppet.com) #forge-modules, #puppet-dev, #windows, #voxpupuli -* IRC (freenode) #puppet-dev, #voxpupuli - - -[rspec-puppet]: http://rspec-puppet.com/ -[rspec-puppet_docs]: http://rspec-puppet.com/documentation/ -[beaker]: https://github.com/puppetlabs/beaker -[beaker-rspec]: https://github.com/puppetlabs/beaker-rspec +Check out our [Contributing to Supported Modules Blog Post](https://puppetlabs.github.io/iac/docs/contributing_to_a_module.html) to find all the information that you will need. From 8817a44d622a009b2269e3c1671b76887a97f7a9 Mon Sep 17 00:00:00 2001 From: Peter Jensen <5846642+pmjensen@users.noreply.github.com> Date: Thu, 29 Jul 2021 15:57:09 -0700 Subject: [PATCH 121/259] Enabling Rocky Linux for Install --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 909eb9cf..c4e0d214 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -9,7 +9,7 @@ case $facts['os']['family'] { 'RedHat': { case $facts['os']['name'] { - 'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL', 'SLC', 'CloudLinux': { + 'Rocky', 'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL', 'SLC', 'CloudLinux': { if (versioncmp($facts['os']['release']['full'], '5.0') < 0) { $jdk_package = 'java-1.6.0-sun-devel' $jre_package = 'java-1.6.0-sun' From e943b8654cab8f26e4dcbc0625698f9f4db91b14 Mon Sep 17 00:00:00 2001 From: David Swan Date: Wed, 4 Aug 2021 15:42:27 +0100 Subject: [PATCH 122/259] (IAC-1709) - Add Support for Debian 11 --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index c77ea265..23a6bcdb 100644 --- a/metadata.json +++ b/metadata.json @@ -52,7 +52,8 @@ "operatingsystemrelease": [ "8", "9", - "10" + "10", + "11" ] }, { From 13acbba4c8ee2f049b27d7e7e6853e950c8c9994 Mon Sep 17 00:00:00 2001 From: Adrian Iurca <45214757+adrianiurca@users.noreply.github.com> Date: Mon, 9 Aug 2021 05:16:13 +0300 Subject: [PATCH 123/259] add debian-11 to params.pp --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 909eb9cf..9eb50a6e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -142,7 +142,7 @@ }, } } - '10', '18.04', '18.10', '19.04', '19.10', '20.04': { + '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04': { $java = { 'jdk' => { 'package' => 'openjdk-11-jdk', From 49ef4596d1a01885cb966888237bd192031972dd Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Thu, 12 Aug 2021 10:19:23 +0000 Subject: [PATCH 124/259] Release prep v7.1.0 --- CHANGELOG.md | 8 ++++++++ REFERENCE.md | 1 + metadata.json | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ea24a29..dbf1e5a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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). +## [v7.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.0) (2021-08-12) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.2...v7.1.0) + +### Added + +- pdksync - \(IAC-1709\) - Add Support for Debian 11 [\#489](https://github.com/puppetlabs/puppetlabs-java/pull/489) ([david22swan](https://github.com/david22swan)) + ## [v7.0.2](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.2) (2021-04-26) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.1...v7.0.2) diff --git a/REFERENCE.md b/REFERENCE.md index 61fdc790..ea7300f8 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -490,3 +490,4 @@ Data type: `Any` The name for the optional symlink in the installation directory. Default value: ``undef`` + diff --git a/metadata.json b/metadata.json index 23a6bcdb..68e79ede 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "7.0.2", + "version": "7.1.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 8a6d5038bbb7874c309fe8236f188a1dffaab0c2 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 25 Aug 2021 11:30:09 +0100 Subject: [PATCH 125/259] (IAC-1741) Allow stdlib v8.0.0 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 68e79ede..16774a9e 100644 --- a/metadata.json +++ b/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.13.1 < 8.0.0" + "version_requirement": ">= 4.13.1 < 9.0.0" }, { "name": "puppet/archive", From 8fdefc4c898d64f6d585d7ae8fddfcb9a66bea41 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 25 Aug 2021 15:43:57 +0000 Subject: [PATCH 126/259] Release prep v7.1.1 --- CHANGELOG.md | 8 ++++++++ metadata.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dbf1e5a4..1cb8b03e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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). +## [v7.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.1) (2021-08-25) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.1.0...v7.1.1) + +### Fixed + +- \(IAC-1741\) Allow stdlib v8.0.0 [\#491](https://github.com/puppetlabs/puppetlabs-java/pull/491) ([david22swan](https://github.com/david22swan)) + ## [v7.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.0) (2021-08-12) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.2...v7.1.0) diff --git a/metadata.json b/metadata.json index 16774a9e..c70e1dc0 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "7.1.0", + "version": "7.1.1", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 529a37ca4ebef785e9e7200f4d05f762198f7422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Tarti=C3=A8re?= Date: Thu, 26 Aug 2021 06:47:13 -1000 Subject: [PATCH 127/259] Allow archive 6.x A new major version of the archive module was released which add support for new operating systems and drop support of legacy ones. --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index c70e1dc0..321826a0 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppet/archive", - "version_requirement": ">= 1.1.0 < 6.0.0" + "version_requirement": ">= 1.1.0 < 7.0.0" } ], "operatingsystem_support": [ From 745f0917a76270a47e7f255dfc7103ae2bc28d37 Mon Sep 17 00:00:00 2001 From: David Swan Date: Wed, 15 Sep 2021 13:43:38 +0100 Subject: [PATCH 128/259] (IAC-1598) - Remove Support for Debian 8 --- metadata.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata.json b/metadata.json index 321826a0..5e258427 100644 --- a/metadata.json +++ b/metadata.json @@ -50,7 +50,6 @@ { "operatingsystem": "Debian", "operatingsystemrelease": [ - "8", "9", "10", "11" From 5b8b12525cd31fcf745b2334779655717975157c Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 20 Sep 2021 14:21:34 +0000 Subject: [PATCH 129/259] Release prep v7.2.0 --- CHANGELOG.md | 14 +++++++++++++- metadata.json | 2 +- pdk.yaml | 2 ++ 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 pdk.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cb8b03e..dffd6343 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,19 @@ 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). -## [v7.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.1) (2021-08-25) +## [v7.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.2.0) (2021-09-20) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.1.1...v7.2.0) + +### Added + +- Enabling Rocky Linux for Install [\#488](https://github.com/puppetlabs/puppetlabs-java/pull/488) ([pmjensen](https://github.com/pmjensen)) + +### Fixed + +- Allow archive 6.x [\#493](https://github.com/puppetlabs/puppetlabs-java/pull/493) ([smortex](https://github.com/smortex)) + +## [v7.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.1) (2021-08-26) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.1.0...v7.1.1) diff --git a/metadata.json b/metadata.json index 321826a0..937ea91f 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "7.1.1", + "version": "7.2.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", diff --git a/pdk.yaml b/pdk.yaml new file mode 100644 index 00000000..4bef4bd0 --- /dev/null +++ b/pdk.yaml @@ -0,0 +1,2 @@ +--- +ignore: [] From d33cb0f51ca194840bc2b3454ce7d48aca5143b3 Mon Sep 17 00:00:00 2001 From: David Swan Date: Tue, 28 Sep 2021 10:32:52 +0100 Subject: [PATCH 130/259] (IAC-1751) - Add Support for Rocky 8 --- metadata.json | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/metadata.json b/metadata.json index a65c6735..aee0d018 100644 --- a/metadata.json +++ b/metadata.json @@ -70,6 +70,12 @@ "12", "15" ] + }, + { + "operatingsystem": "Rocky", + "operatingsystemrelease": [ + "8" + ] } ], "requirements": [ From 1388863f4fc228cd4d35afc4f144284c0cc98c91 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 11 Oct 2021 13:59:15 +0100 Subject: [PATCH 131/259] pdksync - (IAC-1753) - Add Support for AlmaLinux 8 (#500) * (IAC-1752) - Add Support for AlmaLinux 8 * Update params.pp * Fix lint error * Update params.pp Co-authored-by: daianamezdrea <46529728+daianamezdrea@users.noreply.github.com> Co-authored-by: daiana --- manifests/params.pp | 2 +- metadata.json | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 0b09028f..54a990eb 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -9,7 +9,7 @@ case $facts['os']['family'] { 'RedHat': { case $facts['os']['name'] { - 'Rocky', 'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL', 'SLC', 'CloudLinux': { + 'AlmaLinux', 'Rocky', 'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL', 'SLC', 'CloudLinux': { if (versioncmp($facts['os']['release']['full'], '5.0') < 0) { $jdk_package = 'java-1.6.0-sun-devel' $jre_package = 'java-1.6.0-sun' diff --git a/metadata.json b/metadata.json index aee0d018..5dac8df2 100644 --- a/metadata.json +++ b/metadata.json @@ -76,6 +76,12 @@ "operatingsystemrelease": [ "8" ] + }, + { + "operatingsystem": "AlmaLinux", + "operatingsystemrelease": [ + "8" + ] } ], "requirements": [ From b0b9d9d035ea613e6d2121bc1e4aad7a816440fa Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 11 Oct 2021 13:24:57 +0000 Subject: [PATCH 132/259] Release prep v7.3.0 --- CHANGELOG.md | 13 +++++++++++++ metadata.json | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dffd6343..47c927e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ 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). +## [v7.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.3.0) (2021-10-11) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.2.0...v7.3.0) + +### Added + +- pdksync - \(IAC-1753\) - Add Support for AlmaLinux 8 [\#500](https://github.com/puppetlabs/puppetlabs-java/pull/500) ([david22swan](https://github.com/david22swan)) +- pdksync - \(IAC-1751\) - Add Support for Rocky 8 [\#499](https://github.com/puppetlabs/puppetlabs-java/pull/499) ([david22swan](https://github.com/david22swan)) + +### Fixed + +- pdksync - \(IAC-1598\) - Remove Support for Debian 8 [\#498](https://github.com/puppetlabs/puppetlabs-java/pull/498) ([david22swan](https://github.com/david22swan)) + ## [v7.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.2.0) (2021-09-20) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.1.1...v7.2.0) diff --git a/metadata.json b/metadata.json index 5dac8df2..fdf10bd9 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "7.2.0", + "version": "7.3.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 3aac15caa7d7352e86e7bbdfec6f490ed9e1b496 Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Fri, 3 Dec 2021 07:28:47 +0100 Subject: [PATCH 133/259] (MODULES-11234) Support Adoptium Temurin --- README.md | 58 +++++- manifests/adoptium.pp | 190 ++++++++++++++++++++ spec/acceptance/install_spec.rb | 37 +++- spec/defines/adoptium_spec.rb | 308 ++++++++++++++++++++++++++++++++ 4 files changed, 591 insertions(+), 2 deletions(-) create mode 100644 manifests/adoptium.pp create mode 100644 spec/defines/adoptium_spec.rb diff --git a/README.md b/README.md index 4d816197..00b8cdeb 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,56 @@ java::adopt { 'jdk8' : } ``` +## Adoptium Temurin + +Adoptium Temurin is the successor of AdoptOpenJDK and is supported using the defined type `java::adoptium`. It depends on [puppet/archive](https://github.com/voxpupuli/puppet-archive). + +The `java::adoptium` defined type expects a major, minor, patch and build version to download the specific release. It doesn't support jre downloads as the other distributions. + +```puppet +java::adoptium { 'jdk16' : + ensure => 'present', + version_major => '16', + version_minor => '0', + version_patch => '2', + version_build => '7', +} +java::adoptium { 'jdk17' : + ensure => 'present', + version_major => '17', + version_minor => '0', + version_patch => '1', + version_build => '12', +} +``` + +To install Adoptium to a non-default basedir (defaults: /usr/lib/jvm for Debian; /usr/java for RedHat): + +```puppet +java::adoptium { 'jdk7' : + ensure => 'present', + version_major => '17', + version_minor => '0', + version_patch => '1', + version_build => '12', + basedir => '/custom/java', +} +``` + +To ensure that a custom basedir is a directory before Adoptium is installed (note: manage separately for custom ownership or perms): + +```puppet +java::adoptium { 'jdk8' : + ensure => 'present', + version_major => '17', + version_minor => '0', + version_patch => '1', + version_build => '12', + manage_basedir => true, + basedir => '/custom/java', +} +``` + ## 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". @@ -215,6 +265,13 @@ AdoptOpenJDK Java is supported on: * Amazon Linux * Debian +Adoptium Temurin Java is supported on: + +* CentOS +* Red Hat Enterprise Linux (RHEL) +* Amazon Linux +* Debian + SAP Java 7 and 8 (=sapjvm) are supported (by SAP) on: * SLES 12, 15 @@ -225,7 +282,6 @@ SAP Java 7 and 8 (=sapjvm) are supported (by SAP) on: 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. diff --git a/manifests/adoptium.pp b/manifests/adoptium.pp new file mode 100644 index 00000000..c17ceab7 --- /dev/null +++ b/manifests/adoptium.pp @@ -0,0 +1,190 @@ +# Defined Type java::adoptium +# +# @summary +# Install one or more versions of Adoptium Temurin OpenJDK (former AdoptOpenJDK). +# +# @param ensure +# Install or remove the package. +# +# @param version_major +# Major version which should be installed, e.g. '16' or '17' +# +# @param version_minor +# Minor version which should be installed, e.g. '0' +# +# @param version_patch +# Minor version which should be installed, e.g. '2' +# +# @param version_build +# Build version which should be installed, e.g. '07' +# +# @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 url +# Full URL +# +# @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::adoptium ( + $ensure = 'present', + $version_major = undef, + $version_minor = undef, + $version_patch = undef, + $version_build = undef, + $proxy_server = undef, + $proxy_type = undef, + $url = undef, + $basedir = undef, + $manage_basedir = true, + $manage_symlink = false, + $symlink_name = undef, +) { + + # archive module is used to download the java package + include ::archive + + $install_path = "jdk-${version_major}.${version_minor}.${version_patch}+${version_build}" + + # determine package type (exe/tar/rpm), 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 platform ${$facts['os']['name']}") } + } + + $creates_path = "${_basedir}/${install_path}" + $os = 'linux_hotspot' + } + default : { + fail ( "unsupported platform ${$facts['kernel']}" ) } + } + + # set java architecture nomenclature + $os_architecture = $facts['os']['architecture'] ? { + undef => $facts['architecture'], + default => $facts['os']['architecture'] + } + + case $os_architecture { + 'i386' : { $arch = 'x86-32' } + 'x86_64' : { $arch = 'x64' } + 'amd64' : { $arch = 'x64' } + default : { + fail ("unsupported platform ${$os_architecture}") + } + } + + # package name and path for download from github + # + # following are build based on this real life example full URLs: + # + # https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%2B12/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz + # https://github.com/adoptium/temurin16-binaries/releases/download/jdk-16.0.2%2B7/OpenJDK16U-jdk_x64_alpine-linux_hotspot_16.0.2_7.tar.gz + + $package_name = "OpenJDK${version_major}U-jdk_${arch}_${os}_${version_major}.${version_minor}.${version_patch}_${version_build}.tar.gz" + + # if complete URL is provided, use this value for source in archive resource + if $url { + $source = $url + } + else { + $source = "https://github.com/adoptium/temurin${version_major}-binaries/releases/download/jdk-${version_major}.${version_minor}.${version_patch}%2B${version_build}/${package_name}" + notice ("Default source url : ${source}") + } + + # full path to the installer + $destination = "/tmp/${package_name}" + notice ("Destination is ${destination}") + + case $ensure { + 'present' : { + archive { $destination : + ensure => present, + source => $source, + extract_path => '/tmp', + cleanup => false, + creates => $creates_path, + proxy_server => $proxy_server, + proxy_type => $proxy_type, + } + case $facts['kernel'] { + 'Linux' : { + case $facts['os']['family'] { + 'Debian' : { + ensure_resource('file', $_basedir, { + ensure => directory, + }) + $install_requires = [Archive[$destination], File[$_basedir]] + } + default : { + $install_requires = [Archive[$destination]] + } + } + + if $manage_basedir { + if (!defined(File[$_basedir])) { + file { $_basedir: + ensure => 'directory', + before => Exec["Install Adoptium Temurin java ${version_major} ${version_minor} ${version_patch} ${version_build}"], + } + } + } + + exec { "Install Adoptium Temurin java ${version_major} ${version_minor} ${version_patch} ${version_build}" : + path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', + command => "tar -zxf ${destination} -C ${_basedir}", + creates => $creates_path, + require => $install_requires + } + + if ($manage_symlink and $symlink_name) { + file { "${_basedir}/${symlink_name}": + ensure => link, + target => $creates_path, + require => Exec["Install Adoptium Temurin java ${version_major} ${version_minor} ${version_patch} ${version_build}"], + } + } + + } + default : { + fail ("unsupported platform ${$facts['kernel']}") + } + } + } + default : { + notice ("Action ${ensure} not supported.") + } + } + +} diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index ddefb71c..3dd4cb91 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -140,6 +140,27 @@ } EOL +# Adoptium + +adoptium_enabled = true unless os[:family].casecmp('SLES').zero? + +install_adoptium_jdk = < '16', + version_minor => '0', + version_patch => '2', + version_build => '7', + } + java::adoptium { + 'test_adoptium_jdk_version17': + version_major => '17', + version_minor => '0', + version_patch => '1', + version_build => '12', + } +EOL + sap_enabled = true sap_version7 = '7' sap_version7_full = '7.1.072' @@ -272,7 +293,21 @@ end end - context 'java::adopt', if: sap_enabled && ['Sles'].include?(os[:family]), unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do + context 'java::adoptium', if: adoptium_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do + let(:install_path) do + (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' + end + + let(:version_suffix) do + (os[:family] == 'redhat') ? '-amd64' : '' + end + + it 'installs adopt jdk and jre' do + idempotent_apply(install_adoptium_jdk) + end + end + + context 'java::sap', 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 diff --git a/spec/defines/adoptium_spec.rb b/spec/defines/adoptium_spec.rb new file mode 100644 index 00000000..ff200372 --- /dev/null +++ b/spec/defines/adoptium_spec.rb @@ -0,0 +1,308 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'java::adoptium', 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_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + basedir: '/usr/java', + manage_symlink: true, + symlink_name: 'java_home', + } + end + let(:title) { 'jdk16_symlink' } + + it { is_expected.to contain_file('/usr/java/java_home') } + end + + context 'when manage_symlink is not set' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + basedir: '/usr/java', + symlink_name: 'java_home', + } + end + let(:title) { 'jdk16_nosymlink' } + + it { is_expected.not_to contain_file('/usr/java/java_home') } + end + + context 'when Adoptium Temurin Java 16 JDK' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + basedir: '/usr/java', + symlink_name: 'java_home', + } + end + let(:title) { 'jdk16' } + + it { is_expected.to contain_archive('/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command('tar -zxf /tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } + end + + context 'when Adoptium Temurin Java 17 JDK' do + let(:params) do + { + ensure: 'present', + version_major: '17', + version_minor: '0', + version_patch: '1', + version_build: '12', + basedir: '/usr/java', + symlink_name: 'java_home', + } + end + let(:title) { 'jdk17' } + + it { is_expected.to contain_archive('/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').with_command('tar -zxf /tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').that_requires('Archive[/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz]') } + end + + context 'when installing multiple versions' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + } + end + let(:title) { 'jdk16' } + + let(:pre_condition) do + <<-EOL + java::adoptium { + 'jdk17': + ensure => 'present', + version_major => '17', + version_minor => '0', + version_patch => '1', + version_build => '12', + } + EOL + end + + it { is_expected.to compile } + end + + context 'when specifying package_type tar.gz and basedir' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + basedir: '/usr/java', + } + end + let(:title) { 'jdk16' } + + it { is_expected.to contain_archive('/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command('tar -zxf /tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } + end + context 'when manage_basedir is set to true' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + basedir: '/usr/java', + manage_basedir: true, + } + end + let(:title) { 'jdk16' } + + 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 Adoptium Temurin Java 16 JDK' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + symlink_name: 'java_home', + } + end + let(:title) { 'jdk16' } + + it { is_expected.to contain_archive('/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command('tar -zxf /tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } + end + + context 'when Adoptium Temurin Java 17 JDK' do + let(:params) do + { + ensure: 'present', + version_major: '17', + version_minor: '0', + version_patch: '1', + version_build: '12', + symlink_name: 'java_home', + } + end + let(:title) { 'jdk17' } + + it { is_expected.to contain_archive('/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').with_command('tar -zxf /tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').that_requires('Archive[/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz]') } + end + + context 'when installing multiple versions' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + } + end + let(:title) { 'jdk16' } + + let(:pre_condition) do + <<-EOL + java::adoptium { + 'jdk17': + ensure => 'present', + version_major => '17', + version_minor => '0', + version_patch => '1', + version_build => '12', + } + EOL + end + + it { is_expected.to compile } + end + + context 'when specifying package_type tar.gz and basedir' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + basedir: '/usr/lib/jvm', + } + end + let(:title) { 'jdk16' } + + it { is_expected.to contain_archive('/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command('tar -zxf /tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } + end + context 'when manage_basedir is set to true' do + let(:params) do + { + ensure: 'present', + version_major: '16', + version_minor: '0', + version_patch: '2', + version_build: '7', + basedir: '/usr/lib/jvm', + manage_basedir: true, + } + end + let(:title) { 'jdk16' } + + it { is_expected.to contain_file('/usr/lib/jvm') } + 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 From af04d1eba351e631adf250f322fa112aa5b97196 Mon Sep 17 00:00:00 2001 From: 22swan Date: Tue, 8 Feb 2022 15:22:13 +0000 Subject: [PATCH 134/259] (IAC-1787) Remove Support for CentOS 6 --- metadata.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata.json b/metadata.json index fdf10bd9..1341b7c8 100644 --- a/metadata.json +++ b/metadata.json @@ -29,7 +29,6 @@ { "operatingsystem": "CentOS", "operatingsystemrelease": [ - "6", "7", "8" ] From 369219732b481c909b7b06be75dd5d2d2716cdaa Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 16 Mar 2022 15:38:40 +0000 Subject: [PATCH 135/259] pdksync_heads/main-0-gf3911d3 --- .devcontainer/README.md | 34 ++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 16 +++++--------- .github/workflows/auto_release.yml | 16 +++++++++----- .github/workflows/nightly.yml | 14 ++++++------ .github/workflows/pr_test.yml | 29 +++++++++++++------------ .github/workflows/spec.yml | 17 ++++++--------- .rubocop.yml | 2 +- Gemfile | 1 + Rakefile | 1 + metadata.json | 4 ++-- 10 files changed, 84 insertions(+), 50 deletions(-) create mode 100644 .devcontainer/README.md diff --git a/.devcontainer/README.md b/.devcontainer/README.md new file mode 100644 index 00000000..cc4675e5 --- /dev/null +++ b/.devcontainer/README.md @@ -0,0 +1,34 @@ +# devcontainer + + +For format details, see https://aka.ms/devcontainer.json. + +For config options, see the README at: +https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet + +``` json +{ + "name": "Puppet Development Kit (Community)", + "dockerFile": "Dockerfile", + + // Set *default* container specific settings.json values on container create. + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + + // Add the IDs of extensions you want installed when the container is created. + "extensions": [ + "puppet.puppet-vscode", + "rebornix.Ruby" + ] + + // Use 'forwardPorts' to make a list of ports inside the container available locally. + "forwardPorts": [], + + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "pdk --version", +} +``` + + + diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index f1a55dc3..fe7a8b12 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,23 +1,17 @@ -// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: -// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet { "name": "Puppet Development Kit (Community)", "dockerFile": "Dockerfile", - // Set *default* container specific settings.json values on container create. "settings": { - "terminal.integrated.shell.linux": "/bin/bash" + "terminal.integrated.profiles.linux": { + "bash": { + "path": "bash", + } + } }, - // Add the IDs of extensions you want installed when the container is created. "extensions": [ "puppet.puppet-vscode", "rebornix.Ruby" ] - - // Use 'forwardPorts' to make a list of ports inside the container available locally. - // "forwardPorts": [], - - // Use 'postCreateCommand' to run commands after the container is created. - // "postCreateCommand": "pdk --version", } diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index e0284836..f4aed440 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -14,6 +14,7 @@ jobs: runs-on: ubuntu-20.04 steps: + - name: "Honeycomb: Start recording" uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: @@ -25,7 +26,6 @@ jobs: run: | echo STEP_ID="auto-release" >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: "Checkout Source" if: ${{ github.repository_owner == 'puppetlabs' }} uses: actions/checkout@v2 @@ -46,8 +46,14 @@ jobs: run: | echo "::set-output name=ver::$(jq --raw-output .version metadata.json)" - - name: "Commit changes" + - name: "Check if a release is necessary" if: ${{ github.repository_owner == 'puppetlabs' }} + id: check + run: | + git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true" + + - name: "Commit changes" + if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} run: | git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com" git config --local user.name "GitHub Action" @@ -57,7 +63,7 @@ jobs: - name: Create Pull Request id: cpr uses: puppetlabs/peter-evans-create-pull-request@v3 - if: ${{ github.repository_owner == 'puppetlabs' }} + if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} with: token: ${{ secrets.GITHUB_TOKEN }} commit-message: "Release prep v${{ steps.gv.outputs.ver }}" @@ -73,11 +79,11 @@ jobs: labels: "maintenance" - name: PR outputs - if: ${{ github.repository_owner == 'puppetlabs' }} + if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} run: | echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" - + - name: "Honeycomb: Record finish step" if: ${{ always() }} run: | diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 865578cf..c8fe88a5 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -4,18 +4,21 @@ on: schedule: - cron: '0 0 * * *' + env: HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 HONEYCOMB_DATASET: litmus tests jobs: setup_matrix: + if: ${{ github.repository_owner == 'puppetlabs' }} name: "Setup Test Matrix" runs-on: ubuntu-20.04 outputs: matrix: ${{ steps.get-matrix.outputs.matrix }} steps: + - name: "Honeycomb: Start recording" uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: @@ -27,7 +30,6 @@ jobs: run: | echo STEP_ID=setup-environment >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Checkout Source uses: actions/checkout@v2 if: ${{ github.repository_owner == 'puppetlabs' }} @@ -45,29 +47,27 @@ jobs: echo ::group::bundler environment buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env echo ::endgroup:: - + - name: "Honeycomb: Record Setup Environment time" if: ${{ github.repository_owner == 'puppetlabs' }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Setup Acceptance Test Matrix id: get-matrix if: ${{ github.repository_owner == 'puppetlabs' }} run: | if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 + buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 else echo "::set-output name=matrix::{}" fi - + - name: "Honeycomb: Record Setup Test Matrix time" if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' - Acceptance: name: "${{matrix.platforms.label}}, ${{matrix.collection}}" needs: @@ -187,7 +187,7 @@ jobs: buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment' slack-workflow-status: - if: always() + if: ${{ github.repository_owner == 'puppetlabs' }} name: Post Workflow Status To Slack needs: - Acceptance diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml index 69e414b5..fd310e65 100644 --- a/.github/workflows/pr_test.yml +++ b/.github/workflows/pr_test.yml @@ -2,7 +2,9 @@ name: "PR Testing" on: [pull_request] + env: + HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 HONEYCOMB_DATASET: litmus tests @@ -14,6 +16,7 @@ jobs: matrix: ${{ steps.get-matrix.outputs.matrix }} steps: + - name: "Honeycomb: Start recording" uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: @@ -25,7 +28,6 @@ jobs: run: | echo STEP_ID=setup-environment >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Checkout Source uses: actions/checkout@v2 if: ${{ github.repository_owner == 'puppetlabs' }} @@ -43,28 +45,31 @@ jobs: echo ::group::bundler environment buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env echo ::endgroup:: - + - name: "Honeycomb: Record Setup Environment time" if: ${{ github.repository_owner == 'puppetlabs' }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV + - name: Run validation steps + run: | + bundle exec rake validate + if: ${{ github.repository_owner == 'puppetlabs' }} - name: Setup Acceptance Test Matrix id: get-matrix run: | if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 + buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 else echo "::set-output name=matrix::{}" fi - + - name: "Honeycomb: Record Setup Test Matrix time" if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' - Acceptance: name: "${{matrix.platforms.label}}, ${{matrix.collection}}" needs: @@ -84,7 +89,7 @@ jobs: echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE - + - name: "Honeycomb: Start recording" uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: @@ -97,7 +102,6 @@ jobs: run: | echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Checkout Source uses: actions/checkout@v2 @@ -112,14 +116,13 @@ jobs: echo ::group::bundler environment buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env echo ::endgroup:: - + - name: "Honeycomb: Record Setup Environment time" if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Provision test environment run: | buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]' @@ -145,7 +148,7 @@ jobs: - name: Install module run: | buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' - + - name: "Honeycomb: Record deployment times" if: ${{ always() }} run: | @@ -154,18 +157,16 @@ jobs: echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV echo ::endgroup:: - - name: Run acceptance tests run: | buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel' - + - name: "Honeycomb: Record acceptance testing times" if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Remove test environment if: ${{ always() }} continue-on-error: true @@ -177,7 +178,7 @@ jobs: echo echo ::endgroup:: fi - + - name: "Honeycomb: Record removal times" if: ${{ always() }} run: | diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 16f93160..6c1ae10d 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -6,6 +6,7 @@ on: workflow_dispatch: pull_request: + env: HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 HONEYCOMB_DATASET: litmus tests @@ -18,6 +19,7 @@ jobs: spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }} steps: + - name: "Honeycomb: Start recording" uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 with: @@ -29,7 +31,6 @@ jobs: run: | echo STEP_ID=setup-environment >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Checkout Source uses: actions/checkout@v2 if: ${{ github.repository_owner == 'puppetlabs' }} @@ -47,13 +48,16 @@ jobs: echo ::group::bundler environment buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env echo ::endgroup:: - - name: "Honeycomb: Record Setup Environment time" if: ${{ github.repository_owner == 'puppetlabs' }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV + - name: Run Static & Syntax Tests + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop - name: Setup Spec Test Matrix id: get-matrix @@ -63,12 +67,10 @@ jobs: else echo "::set-output name=spec_matrix::{}" fi - - name: "Honeycomb: Record Setup Test Matrix time" if: ${{ always() }} run: | buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' - Spec: name: "Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})" needs: @@ -91,7 +93,6 @@ jobs: - run: | echo 'puppet_version=${{ env.SANITIZED_PUPPET_VERSION }}' >> $BUILDEVENT_FILE - - name: "Honeycomb: Start first step" run: | echo "STEP_ID=${{ env.SANITIZED_PUPPET_VERSION }}-spec" >> $GITHUB_ENV @@ -104,7 +105,6 @@ jobs: dataset: ${{ env.HONEYCOMB_DATASET }} job-status: ${{ job.status }} matrix-key: ${{ env.SANITIZED_PUPPET_VERSION }} - - name: Checkout Source uses: actions/checkout@v2 @@ -120,10 +120,7 @@ jobs: buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env echo ::endgroup:: - - name: Run Static & Syntax Tests - run: | - buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop - + - name: Run parallel_spec tests run: | buildevents cmd $TRACE_ID $STEP_ID 'rake parallel_spec Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake parallel_spec diff --git a/.rubocop.yml b/.rubocop.yml index 8f782e74..31e8248f 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -4,7 +4,7 @@ require: - rubocop-rspec AllCops: DisplayCopNames: true - TargetRubyVersion: '2.4' + TargetRubyVersion: '2.5' Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index 135373d0..a14223db 100644 --- a/Gemfile +++ b/Gemfile @@ -24,6 +24,7 @@ group :development do gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false, platforms: [:ruby] gem "github_changelog_generator", require: false end group :system_tests do diff --git a/Rakefile b/Rakefile index 2906c15b..0f8754eb 100644 --- a/Rakefile +++ b/Rakefile @@ -43,6 +43,7 @@ end PuppetLint.configuration.send('disable_relative') + if Bundler.rubygems.find_name('github_changelog_generator').any? GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? diff --git a/metadata.json b/metadata.json index 1341b7c8..63b2d787 100644 --- a/metadata.json +++ b/metadata.json @@ -90,6 +90,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g03daa92", - "pdk-version": "2.1.0" + "template-ref": "heads/main-0-gf3911d3", + "pdk-version": "2.3.0" } From a98d0801d78f7699621f54ceadffdf74e9578c78 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 23 Mar 2022 12:34:20 +0000 Subject: [PATCH 136/259] (GH-iac-334) Remove Support for Ubuntu 16.04 --- metadata.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata.json b/metadata.json index 63b2d787..af743f3b 100644 --- a/metadata.json +++ b/metadata.json @@ -58,7 +58,6 @@ "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "14.04", - "16.04", "18.04", "20.04" ] From 2b2e79ba5dd142dd394f9ab4b6bf4f66b00814cf Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 23 Mar 2022 16:11:57 +0000 Subject: [PATCH 137/259] (GH-iac-334) Remove Support for Ubuntu 14.04 --- metadata.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata.json b/metadata.json index af743f3b..91753165 100644 --- a/metadata.json +++ b/metadata.json @@ -57,7 +57,6 @@ { "operatingsystem": "Ubuntu", "operatingsystemrelease": [ - "14.04", "18.04", "20.04" ] From 3c030d73d3b98f042c270e79a0bc0dd341e65d20 Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Fri, 25 Mar 2022 15:12:33 +0000 Subject: [PATCH 138/259] (MAINT) Add labeller and stale GHA workflows --- .github/workflows/labeller.yml | 22 ++++++++++++++++++++++ .github/workflows/stale.yml | 19 +++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/workflows/labeller.yml create mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml new file mode 100644 index 00000000..cb3a9307 --- /dev/null +++ b/.github/workflows/labeller.yml @@ -0,0 +1,22 @@ +name: community-labeller + +on: + issues: + types: + - opened + pull_request: + types: + - opened + +jobs: + label: + runs-on: ubuntu-latest + steps: + + - uses: puppetlabs/community-labeller@v0 + name: Label issues or pull requests + with: + label_name: community + label_color: '5319e7' + org_membership: puppetlabs + token: ${{ secrets.IAC_COMMUNITY_LABELER }} \ No newline at end of file diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml new file mode 100644 index 00000000..c6edd6de --- /dev/null +++ b/.github/workflows/stale.yml @@ -0,0 +1,19 @@ +name: Mark stale issues and pull requests + +on: + schedule: + - cron: "30 1 * * *" + +jobs: + stale: + runs-on: ubuntu-latest + steps: + - uses: actions/stale@v3 + with: + repo-token: ${{ secrets.GITHUB_TOKEN }} + days-before-stale: 60 + days-before-close: 7 + stale-issue-message: 'This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.' + stale-issue-label: 'stale' + stale-pr-message: 'This PR has been marked as stale because it has been open for a while and has had no recent activity. If this PR is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.' + stale-pr-label: 'stale' From a744c14662c1b695d3fcb627957009ebb949f196 Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Fri, 25 Mar 2022 15:33:44 +0000 Subject: [PATCH 139/259] (MAINT) Fixes no new line at EOF --- .github/workflows/labeller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml index cb3a9307..104370aa 100644 --- a/.github/workflows/labeller.yml +++ b/.github/workflows/labeller.yml @@ -19,4 +19,4 @@ jobs: label_name: community label_color: '5319e7' org_membership: puppetlabs - token: ${{ secrets.IAC_COMMUNITY_LABELER }} \ No newline at end of file + token: ${{ secrets.IAC_COMMUNITY_LABELER }} From d6bccd4097495d61476ce03c97deacbdcbaf5461 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 30 Mar 2022 12:54:15 +0100 Subject: [PATCH 140/259] (GH-C&T-7) Remove code specific to unsupported OSs Removes compatibility for all Debian below 9, all Ubuntu below 18.04 --- README.md | 12 +++----- manifests/params.pp | 54 +---------------------------------- provision.yaml | 6 ---- spec/classes/java_spec.rb | 34 ++++++---------------- spec/defines/adopt_spec.rb | 2 +- spec/defines/adoptium_spec.rb | 2 +- spec/defines/download_spec.rb | 2 +- spec/defines/sap_spec.rb | 2 +- 8 files changed, 18 insertions(+), 96 deletions(-) diff --git a/README.md b/README.md index 00b8cdeb..4877fd25 100644 --- a/README.md +++ b/README.md @@ -239,19 +239,15 @@ This module is officially [supported](https://forge.puppetlabs.com/supported) fo OpenJDK is supported on: -* Red Hat Enterprise Linux (RHEL) 5, 6, 7 -* CentOS 5, 6, 7 +* Red Hat Enterprise Linux (RHEL) 6, 7 +* CentOS 6, 7 * Oracle Linux 6, 7 * Scientific Linux 6 -* Debian 8, 9 -* Ubuntu 14.04, 16.04, 18.04, 20.04 +* Debian 9 +* Ubuntu 18.04, 20.04 * Solaris 11 * SLES 11, 12 -Sun Java is supported on: - -* Debian 6 - Oracle Java is supported on: * CentOS 6 diff --git a/manifests/params.pp b/manifests/params.pp index 54a990eb..c2d506e6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -74,59 +74,7 @@ default => $facts['os']['architecture'] } case $facts['os']['release']['major'] { - '7', '8', '14.04': { - $java = { - 'jdk' => { - 'package' => 'openjdk-7-jdk', - 'alternative' => "java-1.7.0-openjdk-${openjdk_architecture}", - 'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/", - }, - 'jre' => { - 'package' => 'openjdk-7-jre-headless', - 'alternative' => "java-1.7.0-openjdk-${facts['os']['architecture']}", - 'alternative_path' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/java-1.7.0-openjdk-${openjdk_architecture}/", - }, - 'oracle-jre' => { - 'package' => 'oracle-j2re1.7', - 'alternative' => 'j2re1.7-oracle', - 'alternative_path' => '/usr/lib/jvm/j2re1.7-oracle/bin/java', - 'java_home' => '/usr/lib/jvm/j2re1.7-oracle/', - }, - 'oracle-jdk' => { - 'package' => 'oracle-j2sdk1.7', - 'alternative' => 'j2sdk1.7-oracle', - 'alternative_path' => '/usr/lib/jvm/j2sdk1.7-oracle/jre/bin/java', - 'java_home' => '/usr/lib/jvm/j2sdk1.7-oracle/jre/', - }, - 'oracle-j2re' => { - 'package' => 'oracle-j2re1.8', - 'alternative' => 'j2re1.8-oracle', - 'alternative_path' => '/usr/lib/jvm/j2re1.8-oracle/bin/java', - 'java_home' => '/usr/lib/jvm/j2re1.8-oracle/', - }, - 'oracle-j2sdk' => { - 'package' => 'oracle-j2sdk1.8', - 'alternative' => 'j2sdk1.8-oracle', - 'alternative_path' => '/usr/lib/jvm/j2sdk1.8-oracle/bin/java', - 'java_home' => '/usr/lib/jvm/j2sdk1.8-oracle/', - }, - 'oracle-java8-jre' => { - 'package' => 'oracle-java8-jre', - 'alternative' => "jre-8-oracle-${oracle_architecture}", - 'alternative_path' => "/usr/lib/jvm/jre-8-oracle-${oracle_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/jre-8-oracle-${oracle_architecture}/", - }, - 'oracle-java8-jdk' => { - 'package' => 'oracle-java8-jdk', - 'alternative' => "jdk-8-oracle-${oracle_architecture}", - 'alternative_path' => "/usr/lib/jvm/jdk-8-oracle-${oracle_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/jdk-8-oracle-${oracle_architecture}/", - }, - } - } - '9', '15.04', '15.10', '16.04', '16.10', '17.04', '17.10': { + '9': { $java = { 'jdk' => { 'package' => 'openjdk-8-jdk', diff --git a/provision.yaml b/provision.yaml index c6697ad4..6ab21074 100644 --- a/provision.yaml +++ b/provision.yaml @@ -11,14 +11,11 @@ vagrant: travis_deb: provisioner: docker images: - - litmusimage/debian:8 - litmusimage/debian:9 - litmusimage/debian:10 travis_ub_6: provisioner: docker images: - - litmusimage/ubuntu:14.04 - - litmusimage/ubuntu:16.04 - litmusimage/ubuntu:18.04 - litmusimage/ubuntu:20.04 travis_el7: @@ -44,11 +41,8 @@ release_checks_6: - 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 diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 0792d6ec..d0019a43 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -71,36 +71,20 @@ 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) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'trusty' }, release: { major: '14.04' }, architecture: 'amd64' } } } + context 'when select jdk for Ubuntu Bionic (18.04)' do + let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jdk' } } - it { is_expected.to contain_package('java').with_name('openjdk-7-jdk') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64/') } + 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 Ubuntu Trusty (14.04)' do - let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'trusty' }, release: { major: '14.04' }, architecture: 'amd64' } } } + context 'when select jre for Ubuntu Bionic (18.04)' do + let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jre' } } - it { is_expected.to contain_package('java').with_name('openjdk-7-jre-headless') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64/') } - end - - context 'when select jdk for Ubuntu xenial (16.04) on ARM' do - let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'xenial' }, release: { major: '16.04' }, architecture: 'armv7l' } } } - let(:params) { { 'distribution' => 'jdk' } } - - it { is_expected.to contain_package('java').with_name('openjdk-8-jdk') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-armhf/') } - end - - context 'when select jdk for Ubuntu xenial (16.04) on ARM64' do - let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'xenial' }, release: { major: '16.04' }, architecture: 'aarch64' } } } - let(:params) { { 'distribution' => 'jdk' } } - - it { is_expected.to contain_package('java').with_name('openjdk-8-jdk') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-arm64/') } + 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 openjdk for Oracle Linux' do @@ -174,7 +158,7 @@ end describe 'custom java package' do - let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'jessie' }, release: { major: '8' }, architecture: 'amd64' } } } + let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'bullseye' }, release: { major: '11' }, architecture: 'amd64' } } } context 'when all params provided' do let(:params) do diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index 400aa1f6..03fe3238 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -178,7 +178,7 @@ end context 'with Ubuntu 64-bit' do - let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '16.04' } } } } + let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '18.04' } } } } context 'when AdoptOpenJDK Java 8 JDK' do let(:params) { { ensure: 'present', version: '8', java: 'jdk' } } diff --git a/spec/defines/adoptium_spec.rb b/spec/defines/adoptium_spec.rb index ff200372..1c4cbe07 100644 --- a/spec/defines/adoptium_spec.rb +++ b/spec/defines/adoptium_spec.rb @@ -143,7 +143,7 @@ end context 'with Ubuntu 64-bit' do - let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '16.04' } } } } + let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '18.04' } } } } context 'when Adoptium Temurin Java 16 JDK' do let(:params) do diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index f120c50a..100cc86e 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -75,7 +75,7 @@ end context 'with Ubuntu 64-bit' do - let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '16.04' } } } } + let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '18.04' } } } } context 'when passing URL to url parameter' do let(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: url } } diff --git a/spec/defines/sap_spec.rb b/spec/defines/sap_spec.rb index ee4fb883..97f23076 100644 --- a/spec/defines/sap_spec.rb +++ b/spec/defines/sap_spec.rb @@ -125,7 +125,7 @@ end context 'with Ubuntu 64-bit' do - let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '16.04' } } } } + let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '18.04' } } } } context 'when sapjvm 7' do let(:params) { { ensure: 'present', version: '7', java: 'jdk' } } From 367d1972788ab73057d9621ea244a4a5ec04ea63 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 30 Mar 2022 12:54:15 +0100 Subject: [PATCH 141/259] (GH-C&T-9) Temporarily disable syntax checks --- .github/workflows/spec.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index 6c1ae10d..f51476d7 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -54,10 +54,10 @@ jobs: buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Run Static & Syntax Tests - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop + # - name: Run Static & Syntax Tests + # if: ${{ github.repository_owner == 'puppetlabs' }} + # run: | + # buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop - name: Setup Spec Test Matrix id: get-matrix From 8be3cb1e64d8bfe5b7a5074030958319396b8cc6 Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Mon, 4 Apr 2022 14:09:47 +0100 Subject: [PATCH 142/259] "This commit changes the workflow trigger for pull requests to pull_request_target" --- .github/workflows/labeller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml index 104370aa..5434d3ff 100644 --- a/.github/workflows/labeller.yml +++ b/.github/workflows/labeller.yml @@ -4,7 +4,7 @@ on: issues: types: - opened - pull_request: + pull_request_target: types: - opened From 8fe60c71be6a5375131bd098158591ba7be473c5 Mon Sep 17 00:00:00 2001 From: david22swan Date: Tue, 5 Apr 2022 12:55:54 +0100 Subject: [PATCH 143/259] Release prep v8.0.0 --- CHANGELOG.md | 17 +++++++++++++++++ metadata.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 47c927e0..3defc5f7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,23 @@ 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). +## [v8.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.0.0) (2022-04-05) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.3.0...v8.0.0) + +### Changed + +- \(GH-C&T-7\) Remove code specific to unsupported OSs [\#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) + +### Added + +- \(MODULES-11234\) Support Adoptium Temurin [\#502](https://github.com/puppetlabs/puppetlabs-java/pull/502) ([dploeger](https://github.com/dploeger)) + +### Fixed + +- pdksync - \(IAC-1787\) Remove Support for CentOS 6 [\#503](https://github.com/puppetlabs/puppetlabs-java/pull/503) ([david22swan](https://github.com/david22swan)) +- pdksync - \(GH-iac-334\) Remove Support for Ubuntu 14.04/16.04 [\#505](https://github.com/puppetlabs/puppetlabs-java/pull/505) ([david22swan](https://github.com/david22swan)) + ## [v7.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.3.0) (2021-10-11) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.2.0...v7.3.0) diff --git a/metadata.json b/metadata.json index 91753165..11274042 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "7.3.0", + "version": "8.0.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 3be820445786f7ff096f62363a0428e03a2f9aea Mon Sep 17 00:00:00 2001 From: Rick Rongen Date: Fri, 8 Apr 2022 15:42:26 +0200 Subject: [PATCH 144/259] feat: added support for aarch64 architecture download --- manifests/download.pp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/manifests/download.pp b/manifests/download.pp index 9e8f7a8f..291ffc7e 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -191,6 +191,8 @@ 'i386' : { $arch = 'i586' } 'x86_64' : { $arch = 'x64' } 'amd64' : { $arch = 'x64' } + 'aarch64' : { $arch = 'aarch64' } + 'amd64' : { $arch = 'aarch64' } default : { fail ("unsupported platform ${$os_architecture}") } From 05ee0c53047aaea81e1799e1bef6dab6e236ab64 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 20 Apr 2022 11:07:42 +0100 Subject: [PATCH 145/259] (maint) PDK Update --- .github/workflows/nightly.yml | 2 +- .github/workflows/spec.yml | 8 ++++---- metadata.json | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index c8fe88a5..42816e7d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -200,5 +200,5 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} # Optional Input - channel: '#team-ia-bots' + channel: '#team-cat-bots' name: 'GABot' diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml index f51476d7..6c1ae10d 100644 --- a/.github/workflows/spec.yml +++ b/.github/workflows/spec.yml @@ -54,10 +54,10 @@ jobs: buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV echo STEP_START=$(date +%s) >> $GITHUB_ENV - # - name: Run Static & Syntax Tests - # if: ${{ github.repository_owner == 'puppetlabs' }} - # run: | - # buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop + - name: Run Static & Syntax Tests + if: ${{ github.repository_owner == 'puppetlabs' }} + run: | + buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop - name: Setup Spec Test Matrix id: get-matrix diff --git a/metadata.json b/metadata.json index 11274042..fc5ac57d 100644 --- a/metadata.json +++ b/metadata.json @@ -88,6 +88,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-gf3911d3", + "template-ref": "heads/main-0-g806810b", "pdk-version": "2.3.0" } From 1bdad470d48f43fef252683d2f6dd879d15001f9 Mon Sep 17 00:00:00 2001 From: david22swan Date: Thu, 21 Apr 2022 14:29:00 +0100 Subject: [PATCH 146/259] (GH-cat-9) syntax:hiera:yaml fixes --- manifests/adopt.pp | 18 ++++++++---------- manifests/adoptium.pp | 16 ++++++++-------- manifests/download.pp | 17 +++++++++-------- manifests/init.pp | 10 ++++------ manifests/params.pp | 5 ++--- manifests/sap.pp | 15 +++++---------- 6 files changed, 36 insertions(+), 45 deletions(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index e01a85ef..4f0b4a01 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -61,7 +61,6 @@ $manage_symlink = false, $symlink_name = undef, ) { - # archive module is used to download the java package include ::archive @@ -72,7 +71,6 @@ # determine AdoptOpenJDK Java major and minor version, and installation path if $version_major and $version_minor { - $release_major = $version_major $release_minor = $version_minor @@ -106,7 +104,6 @@ } else { fail ("unsupported version ${_version}") } - } else { $_version = $version $_version_int = Numeric($_version) @@ -176,7 +173,8 @@ } } default : { - fail ("unsupported platform ${$facts['os']['name']}") } + fail ("unsupported platform ${$facts['os']['name']}") + } } $creates_path = "${_basedir}/${install_path}" @@ -184,7 +182,8 @@ $destination_dir = '/tmp/' } default : { - fail ( "unsupported platform ${$facts['kernel']}" ) } + fail ( "unsupported platform ${$facts['kernel']}" ) + } } # set java architecture nomenclature @@ -277,8 +276,9 @@ case $facts['os']['family'] { 'Debian' : { ensure_resource('file', $_basedir, { - ensure => directory, - }) + ensure => directory, + } + ) $install_requires = [Archive[$destination], File[$_basedir]] } default : { @@ -299,7 +299,7 @@ path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', command => $install_command, creates => $creates_path, - require => $install_requires + require => $install_requires, } if ($manage_symlink and $symlink_name) { @@ -309,7 +309,6 @@ require => Exec["Install AdoptOpenJDK java ${java} ${_version} ${release_major} ${release_minor}"], } } - } default : { fail ("unsupported platform ${$facts['kernel']}") @@ -320,5 +319,4 @@ notice ("Action ${ensure} not supported.") } } - } diff --git a/manifests/adoptium.pp b/manifests/adoptium.pp index c17ceab7..a302d1d0 100644 --- a/manifests/adoptium.pp +++ b/manifests/adoptium.pp @@ -55,7 +55,6 @@ $manage_symlink = false, $symlink_name = undef, ) { - # archive module is used to download the java package include ::archive @@ -80,14 +79,16 @@ } } default : { - fail ("unsupported platform ${$facts['os']['name']}") } + fail ("unsupported platform ${$facts['os']['name']}") + } } $creates_path = "${_basedir}/${install_path}" $os = 'linux_hotspot' } default : { - fail ( "unsupported platform ${$facts['kernel']}" ) } + fail ( "unsupported platform ${$facts['kernel']}" ) + } } # set java architecture nomenclature @@ -143,8 +144,9 @@ case $facts['os']['family'] { 'Debian' : { ensure_resource('file', $_basedir, { - ensure => directory, - }) + ensure => directory, + } + ) $install_requires = [Archive[$destination], File[$_basedir]] } default : { @@ -165,7 +167,7 @@ path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', command => "tar -zxf ${destination} -C ${_basedir}", creates => $creates_path, - require => $install_requires + require => $install_requires, } if ($manage_symlink and $symlink_name) { @@ -175,7 +177,6 @@ require => Exec["Install Adoptium Temurin java ${version_major} ${version_minor} ${version_patch} ${version_build}"], } } - } default : { fail ("unsupported platform ${$facts['kernel']}") @@ -186,5 +187,4 @@ notice ("Action ${ensure} not supported.") } } - } diff --git a/manifests/download.pp b/manifests/download.pp index 9e8f7a8f..72e63e67 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -53,7 +53,7 @@ # @param symlink_name # The name for the optional symlink in the installation directory. # -define java::download( +define java::download ( $ensure = 'present', $version = '8', $version_major = undef, @@ -70,7 +70,6 @@ $manage_symlink = false, $symlink_name = undef, ) { - # archive module is used to download the java package include archive @@ -89,7 +88,6 @@ # determine Java major and minor version, and installation path if $version_major and $version_minor { - $label = $version_major $release_major = $version_major $release_minor = $version_minor @@ -165,7 +163,8 @@ } } default : { - fail ("unsupported platform ${$facts['os']['name']}") } + fail ("unsupported platform ${$facts['os']['name']}") + } } $creates_path = "${_basedir}/${install_path}" @@ -173,7 +172,8 @@ $destination_dir = '/tmp/' } default : { - fail ( "unsupported platform ${$facts['kernel']}" ) } + fail ( "unsupported platform ${$facts['kernel']}" ) + } } # Install required unzip packages for jce @@ -267,8 +267,9 @@ case $facts['os']['family'] { 'Debian' : { ensure_resource('file', $_basedir, { - ensure => directory, - }) + ensure => directory, + } + ) $install_requires = [Archive[$destination], File[$_basedir]] } default : { @@ -277,7 +278,7 @@ } if $manage_basedir { - ensure_resource('file', $_basedir, {'ensure' => 'directory', 'before' => Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"]}) + ensure_resource('file', $_basedir, { 'ensure' => 'directory', 'before' => Exec["Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}"] }) } exec { "Install Oracle java_se ${java_se} ${version} ${release_major} ${release_minor}" : diff --git a/manifests/init.pp b/manifests/init.pp index e17bc004..43811e7c 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -35,7 +35,7 @@ # The path to where the JRE is installed. This will be set as an # environment variable. # -class java( +class java ( String $distribution = 'jdk', Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/] $version = 'present', Optional[String] $package = undef, @@ -56,7 +56,6 @@ default => $package, } - ## Weird logic........ ## If $java_alternative is set, use that. ## Elsif the DEFAULT package is being used, then use $default_alternative. @@ -76,8 +75,8 @@ $use_java_alternative_path = $java_alternative_path ? { undef => $use_java_package_name ? { $default_package_name => has_key($java::params::java, $distribution) ? { - default => $java::params::java[$distribution]['alternative_path'], - false => undef, + default => $java::params::java[$distribution]['alternative_path'], + false => undef, }, default => undef, }, @@ -102,7 +101,7 @@ $use_java_alternative_path == undef or $use_java_home == undef ) and ( ! has_key($java::params::java, $distribution) - )) { + )) { fail("Java distribution ${distribution} is not supported. Missing default values.") } @@ -127,5 +126,4 @@ } -> class { 'java::config': } -> anchor { 'java::end': } - } diff --git a/manifests/params.pp b/manifests/params.pp index c2d506e6..9009849e 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -5,7 +5,6 @@ # # @api private class java::params { - case $facts['os']['family'] { 'RedHat': { case $facts['os']['name'] { @@ -75,7 +74,7 @@ } case $facts['os']['release']['major'] { '9': { - $java = { + $java = { 'jdk' => { 'package' => 'openjdk-8-jdk', 'alternative' => "java-1.8.0-openjdk-${openjdk_architecture}", @@ -91,7 +90,7 @@ } } '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04': { - $java = { + $java = { 'jdk' => { 'package' => 'openjdk-11-jdk', 'alternative' => "java-1.11.0-openjdk-${openjdk_architecture}", diff --git a/manifests/sap.pp b/manifests/sap.pp index 9cb39eec..e8e893d2 100644 --- a/manifests/sap.pp +++ b/manifests/sap.pp @@ -47,7 +47,6 @@ $manage_symlink = false, $symlink_name = undef, ) { - # archive module is used to download the java package include ::archive @@ -58,12 +57,9 @@ # 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) @@ -121,13 +117,14 @@ } } default : { - fail ("unsupported os family ${$facts['os']['name']}") } + fail ("unsupported os family ${$facts['os']['name']}") + } } - $creates_path = "${_basedir}/${_creates_folder}" } default : { - fail ( "unsupported platform ${$facts['kernel']}" ) } + fail ( "unsupported platform ${$facts['kernel']}" ) + } } $_os_architecture = $facts['os']['architecture'] ? { @@ -184,7 +181,7 @@ 'present' : { case $facts['kernel'] { 'Linux' : { - if ($manage_basedir or $facts['os']['family'] == 'Debian'){ + if ($manage_basedir or $facts['os']['family'] == 'Debian') { if (!defined(File[$_basedir])) { file { $_basedir: ensure => 'directory', @@ -212,7 +209,6 @@ require => Archive["/tmp/${archive_filename}"], } } - } default : { fail ("unsupported platform ${$facts['kernel']}") @@ -223,5 +219,4 @@ notice ("Action ${ensure} not supported.") } } - } From 5ced09f2ecf310bb1dc66dde18e20b49850c2731 Mon Sep 17 00:00:00 2001 From: david22swan Date: Thu, 21 Apr 2022 14:29:10 +0100 Subject: [PATCH 147/259] (GH-cat-9) syntax:hiera:yaml exclusions added --- .puppet-lint.rc | 4 ++++ .sync.yml | 6 ++++++ Rakefile | 4 ++++ metadata.json | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.puppet-lint.rc b/.puppet-lint.rc index cc96ece0..c5be7aab 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1 +1,5 @@ --relative +--no-parameter_types-check +--no-relative_classname_inclusion-check +--no-legacy_facts-check +--no-anchor_resource-check diff --git a/.sync.yml b/.sync.yml index d03bffc6..3b69f7ad 100644 --- a/.sync.yml +++ b/.sync.yml @@ -28,3 +28,9 @@ spec/spec_helper.rb: unmanaged: false .travis.yml: delete: true +Rakefile: + extra_disabled_lint_checks: + - parameter_types + - relative_classname_inclusion + - legacy_facts + - anchor_resource diff --git a/Rakefile b/Rakefile index 0f8754eb..21c1ccca 100644 --- a/Rakefile +++ b/Rakefile @@ -42,6 +42,10 @@ def changelog_future_release end PuppetLint.configuration.send('disable_relative') +PuppetLint.configuration.send('disable_parameter_types') +PuppetLint.configuration.send('disable_relative_classname_inclusion') +PuppetLint.configuration.send('disable_legacy_facts') +PuppetLint.configuration.send('disable_anchor_resource') if Bundler.rubygems.find_name('github_changelog_generator').any? diff --git a/metadata.json b/metadata.json index fc5ac57d..7c7377cf 100644 --- a/metadata.json +++ b/metadata.json @@ -89,5 +89,5 @@ ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", "template-ref": "heads/main-0-g806810b", - "pdk-version": "2.3.0" + "pdk-version": "2.4.0" } From 9a287f3eb6cdf3a6d19a6febb629d8a3e9a131c8 Mon Sep 17 00:00:00 2001 From: Rick <0Rick0@users.noreply.github.com> Date: Mon, 16 May 2022 18:23:49 +0200 Subject: [PATCH 148/259] aarch64 and arm64 should map to the aarch64 binary --- manifests/download.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/download.pp b/manifests/download.pp index 291ffc7e..8c31d118 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -192,7 +192,7 @@ 'x86_64' : { $arch = 'x64' } 'amd64' : { $arch = 'x64' } 'aarch64' : { $arch = 'aarch64' } - 'amd64' : { $arch = 'aarch64' } + 'arm64' : { $arch = 'aarch64' } default : { fail ("unsupported platform ${$os_architecture}") } From 6ebd7ea38bf94b89766fcfb8243d6d1e2f51e5ea Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 30 May 2022 12:27:39 +0000 Subject: [PATCH 149/259] Release prep v8.1.0 --- CHANGELOG.md | 10 ++++- REFERENCE.md | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++ metadata.json | 2 +- 3 files changed, 130 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3defc5f7..7ef9044d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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). +## [v8.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.1.0) (2022-05-30) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.0.0...v8.1.0) + +### Added + +- feat: added support for aarch64 architecture download [\#516](https://github.com/puppetlabs/puppetlabs-java/pull/516) ([0Rick0](https://github.com/0Rick0)) + ## [v8.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.0.0) (2022-04-05) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.3.0...v8.0.0) @@ -16,8 +24,8 @@ All notable changes to this project will be documented in this file. The format ### Fixed -- pdksync - \(IAC-1787\) Remove Support for CentOS 6 [\#503](https://github.com/puppetlabs/puppetlabs-java/pull/503) ([david22swan](https://github.com/david22swan)) - pdksync - \(GH-iac-334\) Remove Support for Ubuntu 14.04/16.04 [\#505](https://github.com/puppetlabs/puppetlabs-java/pull/505) ([david22swan](https://github.com/david22swan)) +- pdksync - \(IAC-1787\) Remove Support for CentOS 6 [\#503](https://github.com/puppetlabs/puppetlabs-java/pull/503) ([david22swan](https://github.com/david22swan)) ## [v7.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.3.0) (2021-10-11) diff --git a/REFERENCE.md b/REFERENCE.md index ea7300f8..aab0cf6b 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -20,6 +20,7 @@ options, even though those are not in the package repositories. ### Defined types * [`java::adopt`](#javaadopt): Install one or more versions of AdoptOpenJDK Java. +* [`java::adoptium`](#javaadoptium): Install one or more versions of Adoptium Temurin OpenJDK (former AdoptOpenJDK). * [`java::download`](#javadownload): Installs Java from a url location. * [`java::sap`](#javasap): Install one or more versions of SAPJVM or Sapmachine @@ -242,6 +243,125 @@ The name for the optional symlink in the installation directory. Default value: ``undef`` +### `java::adoptium` + +Defined Type java::adoptium + +#### Parameters + +The following parameters are available in the `java::adoptium` defined type: + +* [`ensure`](#ensure) +* [`version_major`](#version_major) +* [`version_minor`](#version_minor) +* [`version_patch`](#version_patch) +* [`version_build`](#version_build) +* [`proxy_server`](#proxy_server) +* [`proxy_type`](#proxy_type) +* [`url`](#url) +* [`basedir`](#basedir) +* [`manage_basedir`](#manage_basedir) +* [`manage_symlink`](#manage_symlink) +* [`symlink_name`](#symlink_name) + +##### `ensure` + +Data type: `Any` + +Install or remove the package. + +Default value: `'present'` + +##### `version_major` + +Data type: `Any` + +Major version which should be installed, e.g. '16' or '17' + +Default value: ``undef`` + +##### `version_minor` + +Data type: `Any` + +Minor version which should be installed, e.g. '0' + +Default value: ``undef`` + +##### `version_patch` + +Data type: `Any` + +Minor version which should be installed, e.g. '2' + +Default value: ``undef`` + +##### `version_build` + +Data type: `Any` + +Build version which should be installed, e.g. '07' + +Default value: ``undef`` + +##### `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`` + +##### `url` + +Data type: `Any` + +Full URL + +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`` + ### `java::download` Defined Type java::download diff --git a/metadata.json b/metadata.json index 7c7377cf..369f4e71 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "8.0.0", + "version": "8.1.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From adc7542629fc80e6e2a833ea50c6b459e1df9c17 Mon Sep 17 00:00:00 2001 From: david22swan Date: Tue, 31 May 2022 16:25:30 +0100 Subject: [PATCH 150/259] (GH-cat-12) Add Support for Redhat 9 --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 369f4e71..cd1ebb38 100644 --- a/metadata.json +++ b/metadata.json @@ -23,7 +23,8 @@ "operatingsystemrelease": [ "6", "7", - "8" + "8", + "9" ] }, { From e404edd6c747449b806bcd5e8d90eb7dd4b0a7db Mon Sep 17 00:00:00 2001 From: Rutger Swarts Date: Wed, 15 Jun 2022 17:56:05 +0200 Subject: [PATCH 151/259] Make ubuntu 22.04 also default to openjdk-11 --- manifests/params.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 9009849e..d60bb5ca 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -89,7 +89,7 @@ }, } } - '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04': { + '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04', '22.04': { $java = { 'jdk' => { 'package' => 'openjdk-11-jdk', From bc132250faf55b540e5350aefa7c83bcc6bd3dc8 Mon Sep 17 00:00:00 2001 From: Paula Muir Date: Wed, 13 Jul 2022 16:19:50 +0100 Subject: [PATCH 152/259] (maint) - Update stale PR communications --- .github/workflows/stale.yml | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index c6edd6de..26d7e5b1 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -1,19 +1,36 @@ -name: Mark stale issues and pull requests +name: Audit aging issues/PRs on: schedule: - cron: "30 1 * * *" jobs: - stale: + audit: runs-on: ubuntu-latest steps: - uses: actions/stale@v3 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-stale: 60 - days-before-close: 7 - stale-issue-message: 'This issue has been marked as stale because it has been open for a while and has had no recent activity. If this issue is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.' - stale-issue-label: 'stale' - stale-pr-message: 'This PR has been marked as stale because it has been open for a while and has had no recent activity. If this PR is still important to you please drop a comment below and we will add this to our backlog to complete. Otherwise, it will be closed in 7 days.' - stale-pr-label: 'stale' + days-before-issue-stale: 90 + days-before-pr-stale: 60 + days-before-pr-close: 7 + stale-issue-message: | + Hello! 👋 + + This issue has been open for a while and has had no recent activity. We've labelled it with `attention-needed` so that we can get a clear view of which issues need our attention. + + If you are waiting on a response from us we will try and address your comments on a future Community Day. + + Alternatively, if it is no longer relevant to you please close the issue with a comment. + stale-issue-label: 'attention-needed' + stale-pr-message: | + Hello! 👋 + + This pull request has been open for a while and has had no recent activity. We've labelled it with `attention-needed` so that we can get a clear view of which PRs need our attention. + + If you are waiting on a response from us we will try and address your comments on a future Community Day. + + Alternatively, if it is no longer relevant to you please close the PR with a comment. + + Please note that if a pull request receives no update for 7 after it has been labelled, it will be closed. We are always happy to re-open pull request if they have been closed in error. + stale-pr-label: 'attention-needed' From 023f8b672d33881a86357f6b67cb28b124ec4fe2 Mon Sep 17 00:00:00 2001 From: david22swan Date: Thu, 4 Aug 2022 11:28:42 +0100 Subject: [PATCH 153/259] (GH-cat-11) Certify Support for Ubuntu 22.04 --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index cd1ebb38..e5ea0ae6 100644 --- a/metadata.json +++ b/metadata.json @@ -59,7 +59,8 @@ "operatingsystem": "Ubuntu", "operatingsystemrelease": [ "18.04", - "20.04" + "20.04", + "22.04" ] }, { From 712a2cfc131f132883544b076e631f189fd27bc7 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 9 Aug 2022 13:45:27 +0000 Subject: [PATCH 154/259] Release prep v8.2.0 --- CHANGELOG.md | 10 ++++++++++ metadata.json | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7ef9044d..16463811 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ 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). +## [v8.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.2.0) (2022-08-09) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.1.0...v8.2.0) + +### Added + +- pdksync - \(GH-cat-11\) Certify Support for Ubuntu 22.04 [\#522](https://github.com/puppetlabs/puppetlabs-java/pull/522) ([david22swan](https://github.com/david22swan)) +- Make ubuntu 22.04 also default to openjdk-11 [\#519](https://github.com/puppetlabs/puppetlabs-java/pull/519) ([rswarts](https://github.com/rswarts)) +- pdksync - \(GH-cat-12\) Add Support for Redhat 9 [\#518](https://github.com/puppetlabs/puppetlabs-java/pull/518) ([david22swan](https://github.com/david22swan)) + ## [v8.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.1.0) (2022-05-30) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.0.0...v8.1.0) diff --git a/metadata.json b/metadata.json index e5ea0ae6..b2bcf7d0 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "8.1.0", + "version": "8.2.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From ca2e537b3bc24697b65206c63c6b66c71fe88151 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 15 Sep 2022 11:12:26 +0100 Subject: [PATCH 155/259] Hardening manifests Prior to this commit some commands in our manifest classes would not be up to our code standards. This commit aims to sanitise our code according to our teams best practices. --- manifests/adopt.pp | 4 ++-- manifests/adoptium.pp | 4 +++- manifests/config.pp | 20 ++++++++++++++------ manifests/download.pp | 10 +++++----- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 4f0b4a01..b5e5c8b5 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -253,10 +253,10 @@ case $_package_type { 'tar.gz' : { - $install_command = "tar -zxf ${destination} -C ${_basedir}" + $install_command = ['tar', '-zxf', $destination, '-C', $_basedir] } default : { - $install_command = "tar -zxf ${destination} -C ${_basedir}" + $install_command = ['tar', '-zxf', $destination, '-C', $_basedir] } } diff --git a/manifests/adoptium.pp b/manifests/adoptium.pp index a302d1d0..6f87e602 100644 --- a/manifests/adoptium.pp +++ b/manifests/adoptium.pp @@ -163,9 +163,11 @@ } } + $install_adoptium = ['tar', '-zxf', $destination, '-C', $_basedir] + exec { "Install Adoptium Temurin java ${version_major} ${version_minor} ${version_patch} ${version_build}" : path => '/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin', - command => "tar -zxf ${destination} -C ${_basedir}", + command => $install_adoptium, creates => $creates_path, require => $install_requires, } diff --git a/manifests/config.pp b/manifests/config.pp index fd67fea3..5d3c9f6b 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -3,10 +3,13 @@ case $facts['os']['family'] { 'Debian': { if $java::use_java_alternative != undef and $java::use_java_alternative_path != undef { + $command_debian = ['update-java-alternatives', '--set', $java::use_java_alternative, $java::jre_flag] + $unless_debian = ["test /etc/alternatives/java -ef '${java::use_java_alternative_path}'"] + exec { 'update-java-alternatives': path => '/usr/bin:/usr/sbin:/bin:/sbin', - command => "update-java-alternatives --set ${java::use_java_alternative} ${java::jre_flag}", - unless => "test /etc/alternatives/java -ef '${java::use_java_alternative_path}'", + command => $command_debian, + unless => $unless_debian, } } if $java::use_java_home != undef { @@ -22,18 +25,23 @@ # The standard packages install alternatives, custom packages do not # For the stanard packages java::params needs these added. if $java::use_java_package_name != $java::default_package_name { + $command_redhat = ['alternatives', '--install', '/usr/bin/java', 'java', $java::use_java_alternative_path, '20000'] + $unless_redhat = ["alternatives --display java | grep -q ${java::use_java_alternative_path}"] + exec { 'create-java-alternatives': path => '/usr/bin:/usr/sbin:/bin:/sbin', - command => "alternatives --install /usr/bin/java java ${$java::use_java_alternative_path} 20000" , - unless => "alternatives --display java | grep -q ${$java::use_java_alternative_path}", + command => $command_redhat, + unless => $unless_redhat, before => Exec['update-java-alternatives'], } } + $command_default = ['alternatives', '--set', 'java', $java::use_java_alternative_path] + $unless_default = ["test /etc/alternatives/java -ef '${java::use_java_alternative_path}'"] exec { 'update-java-alternatives': path => '/usr/bin:/usr/sbin', - command => "alternatives --set java ${$java::use_java_alternative_path}" , - unless => "test /etc/alternatives/java -ef '${java::use_java_alternative_path}'", + command => $command_default, + unless => $unless_default, } } if $java::use_java_home != undef { diff --git a/manifests/download.pp b/manifests/download.pp index 56324950..63636c64 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -237,19 +237,19 @@ case $_package_type { 'bin' : { - $install_command = "sh ${destination}" + $install_command = ['sh', $destination] } 'rpmbin' : { - $install_command = "sh ${destination} -x; rpm --force -iv sun*.rpm; rpm --force -iv ${java_se}*.rpm" + $install_command = ['sh', $destination, '-x;', 'rpm', '--force', '-iv', 'sun*.rpm;', 'rpm', '--force', '-iv', "${java_se}*.rpm"] } 'rpm' : { - $install_command = "rpm --force -iv ${destination}" + $install_command = ['rpm', '--force', '-iv', $destination] } 'tar.gz' : { - $install_command = "tar -zxf ${destination} -C ${_basedir}" + $install_command = ['tar', '-zxf', $destination, '-C', $_basedir] } default : { - $install_command = "rpm -iv ${destination}" + $install_command = ['rpm', '-iv', $destination] } } From b87962447791e62ba28a1bec477c81e5ac178687 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 20 Sep 2022 11:01:28 +0100 Subject: [PATCH 156/259] Fix unit test cases Prior to this commit, multiple unit test cases would fail due to them expecting commands to be run as a single String instead of arrays of commands. This commit aims to fix those test cases by ensuring they mimic the structure of the commands being run on the test cases themselves. --- spec/classes/java_spec.rb | 6 ++--- spec/defines/adopt_spec.rb | 42 +++++++++++++++++------------------ spec/defines/adoptium_spec.rb | 12 +++++----- 3 files changed, 30 insertions(+), 30 deletions(-) diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index d0019a43..eb49f88c 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -36,8 +36,8 @@ let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java/jre1.7.0_67/bin/java' } } it { is_expected.to contain_package('java').with_name('jre') } - it { is_expected.to contain_exec('create-java-alternatives').with_command('alternatives --install /usr/bin/java java /usr/java/jre1.7.0_67/bin/java 20000') } - it { is_expected.to contain_exec('update-java-alternatives').with_command('alternatives --set java /usr/java/jre1.7.0_67/bin/java') } + it { is_expected.to contain_exec('create-java-alternatives').with_command(['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000']) } + it { is_expected.to contain_exec('update-java-alternatives').with_command(['alternatives', '--set', 'java', '/usr/java/jre1.7.0_67/bin/java']) } end context 'when select passed value for CentOS 5.3' do @@ -173,7 +173,7 @@ it { is_expected.to contain_package('java').with_name('custom_jdk') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/opt/custom_jdk') } - it { is_expected.to contain_exec('update-java-alternatives').with_command('update-java-alternatives --set java-custom_jdk --jre') } + it { is_expected.to contain_exec('update-java-alternatives').with_command(['update-java-alternatives', '--set', 'java-custom_jdk', '--jre']) } end context 'with missing parameters' do let(:params) do diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index 03fe3238..6cc959da 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -34,7 +34,7 @@ let(:title) { 'jdk8' } it { is_expected.to contain_archive('/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command(['tar', '-zxf', '/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz]') } end @@ -43,7 +43,7 @@ let(:title) { 'jdk9' } it { is_expected.to contain_archive('/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').with_command('tar -zxf /tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').with_command(['tar', '-zxf', '/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').that_requires('Archive[/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz]') } end @@ -52,7 +52,7 @@ let(:title) { 'jdk10' } it { is_expected.to contain_archive('/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').with_command('tar -zxf /tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').with_command(['tar', '-zxf', '/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').that_requires('Archive[/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz]') } end @@ -61,7 +61,7 @@ let(:title) { 'jdk11' } it { is_expected.to contain_archive('/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').with_command('tar -zxf /tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').with_command(['tar', '-zxf', '/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').that_requires('Archive[/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz]') } end @@ -70,7 +70,7 @@ let(:title) { 'jdk12' } it { is_expected.to contain_archive('/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').with_command('tar -zxf /tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').with_command(['tar', '-zxf', '/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz]') } end @@ -79,7 +79,7 @@ let(:title) { 'jre8' } it { is_expected.to contain_archive('/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').with_command(['tar', '-zxf', '/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz]') } end @@ -88,7 +88,7 @@ let(:title) { 'jre9' } it { is_expected.to contain_archive('/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').with_command('tar -zxf /tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').with_command(['tar', '-zxf', '/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').that_requires('Archive[/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz]') } end @@ -97,7 +97,7 @@ let(:title) { 'jre11' } it { is_expected.to contain_archive('/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').with_command('tar -zxf /tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').with_command(['tar', '-zxf', '/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').that_requires('Archive[/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz]') } end @@ -106,7 +106,7 @@ let(:title) { 'jre11' } it { is_expected.to contain_archive('/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').with_command('tar -zxf /tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').with_command(['tar', '-zxf', '/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').that_requires('Archive[/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz]') } end @@ -115,7 +115,7 @@ let(:title) { 'jre12' } it { is_expected.to contain_archive('/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').with_command('tar -zxf /tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').with_command(['tar', '-zxf', '/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz]') } end @@ -158,7 +158,7 @@ let(:title) { 'jdk8' } it { is_expected.to contain_archive('/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command(['tar', '-zxf', '/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz]') } end context 'when manage_basedir is set to true' do @@ -185,7 +185,7 @@ let(:title) { 'jdk8' } it { is_expected.to contain_archive('/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command(['tar', '-zxf', '/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz]') } end @@ -194,7 +194,7 @@ let(:title) { 'jdk9' } it { is_expected.to contain_archive('/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').with_command('tar -zxf /tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').with_command(['tar', '-zxf', '/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 9 9.0.4 11').that_requires('Archive[/tmp/OpenJDK9U-jdk_x64_linux_hotspot_9.0.4_11.tar.gz]') } end @@ -203,7 +203,7 @@ let(:title) { 'jdk10' } it { is_expected.to contain_archive('/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').with_command('tar -zxf /tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').with_command(['tar', '-zxf', '/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 10 10.0.2 13').that_requires('Archive[/tmp/OpenJDK10U-jdk_x64_linux_hotspot_10.0.2_13.tar.gz]') } end @@ -212,7 +212,7 @@ let(:title) { 'jdk11' } it { is_expected.to contain_archive('/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').with_command('tar -zxf /tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').with_command(['tar', '-zxf', '/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 11 11.0.2 9').that_requires('Archive[/tmp/OpenJDK11U-jdk_x64_linux_hotspot_11.0.2_9.tar.gz]') } end @@ -221,7 +221,7 @@ let(:title) { 'jdk12' } it { is_expected.to contain_archive('/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').with_command('tar -zxf /tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').with_command(['tar', '-zxf', '/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jdk_x64_linux_hotspot_12.0.1_12.tar.gz]') } end @@ -230,7 +230,7 @@ let(:title) { 'jre8' } it { is_expected.to contain_archive('/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').with_command('tar -zxf /tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').with_command(['tar', '-zxf', '/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jre_x64_linux_hotspot_8u202b08.tar.gz]') } end @@ -239,7 +239,7 @@ let(:title) { 'jre9' } it { is_expected.to contain_archive('/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').with_command('tar -zxf /tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').with_command(['tar', '-zxf', '/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 9 9.0.4 11').that_requires('Archive[/tmp/OpenJDK9U-jre_x64_linux_hotspot_9.0.4_11.tar.gz]') } end @@ -248,7 +248,7 @@ let(:title) { 'jre11' } it { is_expected.to contain_archive('/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').with_command('tar -zxf /tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').with_command(['tar', '-zxf', '/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 10 10.0.2 13').that_requires('Archive[/tmp/OpenJDK10U-jre_x64_linux_hotspot_10.0.2_13.tar.gz]') } end @@ -257,7 +257,7 @@ let(:title) { 'jre11' } it { is_expected.to contain_archive('/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').with_command('tar -zxf /tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').with_command(['tar', '-zxf', '/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 11 11.0.2 9').that_requires('Archive[/tmp/OpenJDK11U-jre_x64_linux_hotspot_11.0.2_9.tar.gz]') } end @@ -266,7 +266,7 @@ let(:title) { 'jre12' } it { is_expected.to contain_archive('/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz') } - it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').with_command('tar -zxf /tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').with_command(['tar', '-zxf', '/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jre 12 12.0.1 12').that_requires('Archive[/tmp/OpenJDK12U-jre_x64_linux_hotspot_12.0.1_12.tar.gz]') } end diff --git a/spec/defines/adoptium_spec.rb b/spec/defines/adoptium_spec.rb index 1c4cbe07..f9f82a1e 100644 --- a/spec/defines/adoptium_spec.rb +++ b/spec/defines/adoptium_spec.rb @@ -56,7 +56,7 @@ let(:title) { 'jdk16' } it { is_expected.to contain_archive('/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz') } - it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command('tar -zxf /tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command(['tar', '-zxf', '/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } end @@ -75,7 +75,7 @@ let(:title) { 'jdk17' } it { is_expected.to contain_archive('/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz') } - it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').with_command('tar -zxf /tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').with_command(['tar', '-zxf', '/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').that_requires('Archive[/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz]') } end @@ -121,7 +121,7 @@ let(:title) { 'jdk16' } it { is_expected.to contain_archive('/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz') } - it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command('tar -zxf /tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz -C /usr/java') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command(['tar', '-zxf', '/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } end context 'when manage_basedir is set to true' do @@ -159,7 +159,7 @@ let(:title) { 'jdk16' } it { is_expected.to contain_archive('/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz') } - it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command('tar -zxf /tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command(['tar', '-zxf', '/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } end @@ -177,7 +177,7 @@ let(:title) { 'jdk17' } it { is_expected.to contain_archive('/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz') } - it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').with_command('tar -zxf /tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').with_command(['tar', '-zxf', '/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install Adoptium Temurin java 17 0 1 12').that_requires('Archive[/tmp/OpenJDK17U-jdk_x64_linux_hotspot_17.0.1_12.tar.gz]') } end @@ -223,7 +223,7 @@ let(:title) { 'jdk16' } it { is_expected.to contain_archive('/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz') } - it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command('tar -zxf /tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz -C /usr/lib/jvm') } + it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command(['tar', '-zxf', '/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } end context 'when manage_basedir is set to true' do From 8f5a99858fc4159b6df70179b5f60c3bbb88ec5c Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Wed, 5 Oct 2022 11:28:14 +0100 Subject: [PATCH 157/259] (CONT-130) Dropping Debian 9 Support --- metadata.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata.json b/metadata.json index b2bcf7d0..6eac01fb 100644 --- a/metadata.json +++ b/metadata.json @@ -50,7 +50,6 @@ { "operatingsystem": "Debian", "operatingsystemrelease": [ - "9", "10", "11" ] From 74ea1de22955349598ab01bc530e87d7c754506f Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 4 Oct 2022 11:32:45 +0100 Subject: [PATCH 158/259] Community suggestions applied Prior to this commit, a community member had some suggestions to further improve the code This commit aims to implement those suggestions after careful evaluation and testing. --- manifests/adopt.pp | 9 +-------- manifests/config.pp | 8 ++++---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index b5e5c8b5..fde321b8 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -251,14 +251,7 @@ $destination = "${destination_dir}${package_name}" notice ("Destination is ${destination}") - case $_package_type { - 'tar.gz' : { - $install_command = ['tar', '-zxf', $destination, '-C', $_basedir] - } - default : { - $install_command = ['tar', '-zxf', $destination, '-C', $_basedir] - } - } + $install_command = ['tar', '-zxf', $destination, '-C', $_basedir] case $ensure { 'present' : { diff --git a/manifests/config.pp b/manifests/config.pp index 5d3c9f6b..c94aa6ef 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -4,7 +4,7 @@ 'Debian': { if $java::use_java_alternative != undef and $java::use_java_alternative_path != undef { $command_debian = ['update-java-alternatives', '--set', $java::use_java_alternative, $java::jre_flag] - $unless_debian = ["test /etc/alternatives/java -ef '${java::use_java_alternative_path}'"] + $unless_debian = [['test', '/etc/alternatives/java', '-ef', $java::use_java_alternative_path]] exec { 'update-java-alternatives': path => '/usr/bin:/usr/sbin:/bin:/sbin', @@ -26,17 +26,17 @@ # For the stanard packages java::params needs these added. if $java::use_java_package_name != $java::default_package_name { $command_redhat = ['alternatives', '--install', '/usr/bin/java', 'java', $java::use_java_alternative_path, '20000'] - $unless_redhat = ["alternatives --display java | grep -q ${java::use_java_alternative_path}"] + $unless_redhat = "alternatives --display java | grep -q ${java::use_java_alternative_path}" exec { 'create-java-alternatives': path => '/usr/bin:/usr/sbin:/bin:/sbin', command => $command_redhat, - unless => $unless_redhat, + unless => shell_escape($unless_redhat), before => Exec['update-java-alternatives'], } } $command_default = ['alternatives', '--set', 'java', $java::use_java_alternative_path] - $unless_default = ["test /etc/alternatives/java -ef '${java::use_java_alternative_path}'"] + $unless_default = [['test', '/etc/alternatives/java', '-ef', $java::use_java_alternative_path]] exec { 'update-java-alternatives': path => '/usr/bin:/usr/sbin', From 0b81c433f7de56275fa1b0af15ec9671205904a0 Mon Sep 17 00:00:00 2001 From: david22swan Date: Thu, 6 Oct 2022 09:52:42 +0100 Subject: [PATCH 159/259] (PDKSync) Removal of puppet_module_gems --- .devcontainer/README.md | 8 ++++++-- Gemfile | 33 +++++++++++++++++++-------------- metadata.json | 4 ++-- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/.devcontainer/README.md b/.devcontainer/README.md index cc4675e5..a7193616 100644 --- a/.devcontainer/README.md +++ b/.devcontainer/README.md @@ -13,14 +13,18 @@ https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/pupp // Set *default* container specific settings.json values on container create. "settings": { - "terminal.integrated.shell.linux": "/bin/bash" + "terminal.integrated.profiles.linux": { + "bash": { + "path": "bash", + } + } }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ "puppet.puppet-vscode", "rebornix.Ruby" - ] + ], // Use 'forwardPorts' to make a list of ports inside the container available locally. "forwardPorts": [], diff --git a/Gemfile b/Gemfile index a14223db..26dd2db9 100644 --- a/Gemfile +++ b/Gemfile @@ -13,23 +13,28 @@ def location_for(place_or_version, fake_version = nil) end end -ruby_version_segments = Gem::Version.new(RUBY_VERSION.dup).segments -minor_version = ruby_version_segments[0..1].join('.') - group :development do - 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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 2.8.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "puppet-module-posix-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] - gem "puppet-module-posix-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] - gem "puppet-module-win-default-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "puppet-module-win-dev-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "voxpupuli-puppet-lint-plugins", '>= 3.0', require: false, platforms: [:ruby] - gem "github_changelog_generator", require: false + gem "json", '~> 2.0', require: false + gem "voxpupuli-puppet-lint-plugins", '~> 3.0', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false + gem "puppetlabs_spec_helper", '>= 3.0.0', '< 5.0.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', require: false + gem "dependency_checker", '~> 0.2', require: false + gem "parallel_tests", '~> 3.4', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.5', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '= 1.6.1', require: false + gem "rubocop-performance", '= 1.9.1', require: false + gem "rubocop-rspec", '= 2.0.1', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "github_changelog_generator", require: false end group :system_tests do - gem "puppet-module-posix-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:ruby] - gem "puppet-module-win-system-r#{minor_version}", '~> 1.0', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby] + gem "serverspec", '~> 2.41', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/metadata.json b/metadata.json index b2bcf7d0..19905ebe 100644 --- a/metadata.json +++ b/metadata.json @@ -90,6 +90,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g806810b", - "pdk-version": "2.4.0" + "template-ref": "tags/2.6.0-0-gd0490b9", + "pdk-version": "2.5.0" } From ad44f04add47293425ef25a9ff4cd8c1b2d8a541 Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 7 Oct 2022 10:00:50 +0100 Subject: [PATCH 160/259] (CONT-189) Remove support for RedHat6 --- metadata.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata.json b/metadata.json index 87691346..2407ff81 100644 --- a/metadata.json +++ b/metadata.json @@ -21,7 +21,6 @@ { "operatingsystem": "RedHat", "operatingsystemrelease": [ - "6", "7", "8", "9" From 59119e44a44dded3b663d86780247a0c030112f2 Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 7 Oct 2022 10:01:57 +0100 Subject: [PATCH 161/259] (CONT-189) Remove support for OracleLinux6 --- metadata.json | 1 - 1 file changed, 1 deletion(-) diff --git a/metadata.json b/metadata.json index 2407ff81..9d866ab2 100644 --- a/metadata.json +++ b/metadata.json @@ -36,7 +36,6 @@ { "operatingsystem": "OracleLinux", "operatingsystemrelease": [ - "6", "7" ] }, From 312b0339cea9a9617dca8ffe08cec572c440890d Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 7 Oct 2022 10:02:39 +0100 Subject: [PATCH 162/259] (CONT-189) Remove support for Scientific6 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 9d866ab2..b0dfe581 100644 --- a/metadata.json +++ b/metadata.json @@ -42,7 +42,7 @@ { "operatingsystem": "Scientific", "operatingsystemrelease": [ - "6" + ] }, { From 5b48588f4c165990ac20fe7bf9d9b8b9da64dfb4 Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 7 Oct 2022 11:48:34 +0100 Subject: [PATCH 163/259] (maint) Removal of Scientific metadata block Removal of the block as no version is currently supported --- metadata.json | 6 ------ 1 file changed, 6 deletions(-) diff --git a/metadata.json b/metadata.json index b0dfe581..9ab07559 100644 --- a/metadata.json +++ b/metadata.json @@ -39,12 +39,6 @@ "7" ] }, - { - "operatingsystem": "Scientific", - "operatingsystemrelease": [ - - ] - }, { "operatingsystem": "Debian", "operatingsystemrelease": [ From 19afda2939a5fc5a8cef761f63a25ef33b5203bc Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Thu, 13 Oct 2022 16:32:11 +0100 Subject: [PATCH 164/259] (CONT-173) - Updating deprecated facter instances Prior to this PR, this module contained instances of Facter::Util::Resolution.exec and Facter::Util::Resolution.which, which are deprecated. This PR aims to replace these exec helpers with their supported Facter::Core::Execution counterparts. This PR: - Replaces all Facter::Util::Resolution instances with corresponding Facter::Core::Execution exec helpers Fixed Spec Test Failures --- lib/facter/java_default_home.rb | 2 +- lib/facter/java_version.rb | 32 ++++------------------ spec/unit/facter/java_default_home_spec.rb | 6 ++-- spec/unit/facter/java_version_spec.rb | 26 ++++++++++-------- 4 files changed, 25 insertions(+), 41 deletions(-) diff --git a/lib/facter/java_default_home.rb b/lib/facter/java_default_home.rb index dccbaf2a..a818ad68 100644 --- a/lib/facter/java_default_home.rb +++ b/lib/facter/java_default_home.rb @@ -16,7 +16,7 @@ confine kernel: ['Linux', 'OpenBSD'] java_default_home = nil setcode do - java_bin = Facter::Util::Resolution.which('java').to_s.strip + java_bin = Facter::Core::Execution.which('java').to_s.strip if java_bin.empty? nil else diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index a9d9c184..b1b5e0ae 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -14,33 +14,13 @@ # Notes: # None Facter.add(:java_version) do - # the OS-specific overrides need to be able to return nil, - # to indicate "no java available". Usually returning nil - # would mean that facter falls back to a lower priority - # resolution, which would then trigger MODULES-2637. To - # avoid that, we confine the "default" here to not run - # on those OS. - # Additionally, facter versions prior to 2.0.1 only support - # positive matches, so this needs to be done manually in setcode. setcode do - unless ['darwin'].include? Facter.value(:kernel).downcase - version = nil - if Facter::Util::Resolution.which('java') - Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = Regexp.last_match(1) if %r{^.+ version \"(.+)\"} =~ line } - end - version - end - end -end - -Facter.add(:java_version) do - confine kernel: 'Darwin' - has_weight 100 - setcode do - unless Facter::Util::Resolution.exec('/usr/libexec/java_home --failfast 2>&1').include?('Unable to find any JVMs matching version') - version = nil - Facter::Util::Resolution.exec('java -Xmx12m -version 2>&1').lines.each { |line| version = Regexp.last_match(1) if %r{^.+ version \"(.+)\"} =~ line } - version + if ['darwin'].include? Facter.value(:kernel).downcase + return unless Facter::Core::Execution.execute('/usr/libexec/java_home --failfast', { on_fail: false }) + else + return unless Facter::Core::Execution.which('java') end + version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } + version[%r{\"(.*?)\"}, 1] if version end end diff --git a/spec/unit/facter/java_default_home_spec.rb b/spec/unit/facter/java_default_home_spec.rb index 11fb2060..af0841f6 100644 --- a/spec/unit/facter/java_default_home_spec.rb +++ b/spec/unit/facter/java_default_home_spec.rb @@ -17,7 +17,7 @@ def unlink_and_delete(filename) def symlink_and_test(symlink_path, java_home) File.symlink(symlink_path, './java_test') - expect(Facter::Util::Resolution).to receive(:which).with('java').and_return('./java_test') + expect(Facter::Core::Execution).to receive(:which).with('java').and_return('./java_test') expect(File).to receive(:realpath).with('./java_test').and_return(symlink_path) expect(Facter.value(:java_default_home)).to eql java_home end @@ -48,8 +48,8 @@ def symlink_and_test(symlink_path, java_home) context 'when java not present, return nil' do it do - allow(Facter::Util::Resolution).to receive(:exec) # Catch all other calls - expect(Facter::Util::Resolution).to receive(:which).with('java').at_least(1).and_return(nil) + allow(Facter::Core::Execution).to receive(:execute) # Catch all other calls + expect(Facter::Core::Execution).to receive(:which).with('java').at_least(1).and_return(nil) expect(Facter.value(:java_default_home)).to be_nil end end diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index 2f31f6b0..d65097c0 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -21,12 +21,13 @@ context 'on OpenBSD', with_env: true do before(:each) do allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('OpenBSD') + allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') end let(:facts) { { operatingsystem: 'OpenBSD' } } it do - expect(Facter::Util::Resolution).to receive(:which).with('java').and_return('/usr/local/jdk-1.7.0/jre/bin/java') - expect(Facter::Util::Resolution).to receive(:exec).with('java -Xmx12m -version 2>&1').and_return(openjdk_7_output) + expect(Facter::Core::Execution).to receive(:which).with('java').and_return('/usr/local/jdk-1.7.0/jre/bin/java') + expect(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(openjdk_7_output) expect(Facter.value(:java_version)).to eq('1.7.0_71') end end @@ -37,20 +38,21 @@ let(:facts) { { kernel: 'Darwin' } } it do - expect(Facter::Util::Resolution).to receive(:exec).with('/usr/libexec/java_home --failfast 2>&1').and_return('/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home') - expect(Facter::Util::Resolution).to receive(:exec).with('java -Xmx12m -version 2>&1').and_return(jdk_7_hotspot_output) - expect(Facter.value(:java_version)).to eql '1.7.0_71' + expect(Facter::Core::Execution).to receive(:execute).with('/usr/libexec/java_home --failfast', { on_fail: false }).and_return('/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home') + expect(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(jdk_7_hotspot_output) + expect(Facter.value(:java_version)).to eq('1.7.0_71') end end context 'when on other systems' do before(:each) do allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('MyOS') + allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') end let(:facts) { { operatingsystem: 'MyOS' } } it do - expect(Facter::Util::Resolution).to receive(:which).with('java').and_return('/path/to/java') - expect(Facter::Util::Resolution).to receive(:exec).with('java -Xmx12m -version 2>&1').and_return(jdk_7_hotspot_output) + expect(Facter::Core::Execution).to receive(:which).with('java').and_return('/path/to/java') + expect(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(jdk_7_hotspot_output) expect(Facter.value(:java_version)).to eq('1.7.0_71') end end @@ -60,12 +62,13 @@ context 'on OpenBSD', with_env: true do before(:each) do allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('OpenBSD') + allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') end let(:facts) { { operatingsystem: 'OpenBSD' } } it do - allow(Facter::Util::Resolution).to receive(:exec) # Catch all other calls - allow(Facter::Util::Resolution).to receive(:which).and_return(nil) + allow(Facter::Core::Execution).to receive(:execute) # Catch all other calls + allow(Facter::Core::Execution).to receive(:which).and_return(nil) expect(Facter.value(:java_version)).to be_nil end end @@ -76,18 +79,19 @@ let(:facts) { { kernel: 'Darwin' } } it do - expect(Facter::Util::Resolution).to receive(:exec).with('/usr/libexec/java_home --failfast 2>&1').at_least(1).and_return('Unable to find any JVMs matching version "(null)".') + expect(Facter::Core::Execution).to receive(:execute).with('/usr/libexec/java_home --failfast', { on_fail: false }).at_least(1).and_return(false) expect(Facter.value(:java_version)).to be_nil end end context 'when on other systems' do before(:each) do allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('MyOS') + allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') end let(:facts) { { operatingsystem: 'MyOS' } } it do - expect(Facter::Util::Resolution).to receive(:which).at_least(1).with('java').and_return(false) + expect(Facter::Core::Execution).to receive(:which).at_least(1).with('java').and_return(false) expect(Facter.value(:java_version)).to be_nil end end From 1496d2fe1ce073aeb8dbd475c24832b88b889be2 Mon Sep 17 00:00:00 2001 From: shedz Date: Mon, 7 Nov 2022 11:33:24 +0100 Subject: [PATCH 165/259] Update package naming to differentiate between minor versions (#534) * Update package naming to differentiate between minor versions * adjust tests to new archive names * adjust tests to new archive names --- manifests/download.pp | 10 +++++----- spec/defines/download_spec.rb | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/manifests/download.pp b/manifests/download.pp index 63636c64..8c31fbef 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -207,19 +207,19 @@ # package name to use in destination directory for the installer case $_package_type { 'bin' : { - $package_name = "${java_se}-${release_major}-${os}-${arch}.bin" + $package_name = "${java_se}-${version}-${release_major}-${release_minor}-${os}-${arch}.bin" } 'rpmbin' : { - $package_name = "${java_se}-${release_major}-${os}-${arch}-rpm.bin" + $package_name = "${java_se}-${version}-${release_major}-${release_minor}-${os}-${arch}-rpm.bin" } 'rpm' : { - $package_name = "${java_se}-${release_major}-${os}-${arch}.rpm" + $package_name = "${java_se}-${version}-${release_major}-${release_minor}-${os}-${arch}.rpm" } 'tar.gz' : { - $package_name = "${java_se}-${release_major}-${os}-${arch}.tar.gz" + $package_name = "${java_se}-${version}-${release_major}-${release_minor}-${os}-${arch}.tar.gz" } default : { - $package_name = "${java_se}-${release_major}-${os}-${arch}.rpm" + $package_name = "${java_se}-${version}-${release_major}-${release_minor}-${os}-${arch}.rpm" } } diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index 100cc86e..f2b0c286 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -21,7 +21,7 @@ let(:title) { 'jdk8' } it { - is_expected.to contain_archive('/tmp/jdk-8u201-linux-x64.rpm') + is_expected.to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.rpm') } end @@ -81,7 +81,7 @@ 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') } + it { is_expected.to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.tar.gz') } end end @@ -92,7 +92,7 @@ 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') } + it { is_expected.to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.tar.gz') } end end From 517969cabcb305475b7097e1d1d8b90a4b6045fe Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 22 Nov 2022 17:13:42 +0000 Subject: [PATCH 166/259] (CONT-263) Update minimum required puppet version Prior to this commit, and after the work performed in [Hardening manifests](https://github.com/puppetlabs/puppetlabs-java/pull/525), the minimum puppet version requirement was expected to be raised up to 6.24.0 to meet logic requirements. This commits aims to fix the missing bump. --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 9ab07559..100f3f4e 100644 --- a/metadata.json +++ b/metadata.json @@ -77,7 +77,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.0.0 < 8.0.0" + "version_requirement": ">= 6.24.0 < 8.0.0" } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", From 1d274be18cf634ed7ef82f74304a15051d2c0460 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Wed, 23 Nov 2022 13:24:04 +0000 Subject: [PATCH 167/259] Release prep v9.0.0 --- CHANGELOG.md | 16 +++ REFERENCE.md | 334 +++++++++++++++++++++++++------------------------- metadata.json | 2 +- 3 files changed, 184 insertions(+), 168 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 16463811..792536fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +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). +## [v9.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.0) (2022-11-23) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.2.0...v9.0.0) + +### Changed + +- \(CONT-263\) Update minimum required puppet version [\#535](https://github.com/puppetlabs/puppetlabs-java/pull/535) ([LukasAud](https://github.com/LukasAud)) + +### Fixed + +- Update package naming to differentiate between minor versions [\#534](https://github.com/puppetlabs/puppetlabs-java/pull/534) ([sd-z](https://github.com/sd-z)) +- \(CONT-173\) - Updating deprecated facter instances [\#531](https://github.com/puppetlabs/puppetlabs-java/pull/531) ([jordanbreen28](https://github.com/jordanbreen28)) +- pdksync - \(CONT-189\) Remove support for RedHat6 / OracleLinux6 / Scientific6 [\#530](https://github.com/puppetlabs/puppetlabs-java/pull/530) ([david22swan](https://github.com/david22swan)) +- pdksync - \(CONT-130\) - Dropping Support for Debian 9 [\#527](https://github.com/puppetlabs/puppetlabs-java/pull/527) ([jordanbreen28](https://github.com/jordanbreen28)) +- Hardening manifests [\#525](https://github.com/puppetlabs/puppetlabs-java/pull/525) ([LukasAud](https://github.com/LukasAud)) + ## [v8.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.2.0) (2022-08-09) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.1.0...v8.2.0) diff --git a/REFERENCE.md b/REFERENCE.md index aab0cf6b..9ed34192 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -19,10 +19,10 @@ options, even though those are not in the package repositories. ### Defined types -* [`java::adopt`](#javaadopt): Install one or more versions of AdoptOpenJDK Java. -* [`java::adoptium`](#javaadoptium): Install one or more versions of Adoptium Temurin OpenJDK (former AdoptOpenJDK). -* [`java::download`](#javadownload): Installs Java from a url location. -* [`java::sap`](#javasap): Install one or more versions of SAPJVM or Sapmachine +* [`java::adopt`](#java--adopt): Install one or more versions of AdoptOpenJDK Java. +* [`java::adoptium`](#java--adoptium): Install one or more versions of Adoptium Temurin OpenJDK (former AdoptOpenJDK). +* [`java::download`](#java--download): Installs Java from a url location. +* [`java::sap`](#java--sap): Install one or more versions of SAPJVM or Sapmachine ## Classes @@ -34,15 +34,15 @@ This module manages the Java runtime package The following parameters are available in the `java` class: -* [`distribution`](#distribution) -* [`version`](#version) -* [`package`](#package) -* [`package_options`](#package_options) -* [`java_alternative`](#java_alternative) -* [`java_alternative_path`](#java_alternative_path) -* [`java_home`](#java_home) +* [`distribution`](#-java--distribution) +* [`version`](#-java--version) +* [`package`](#-java--package) +* [`package_options`](#-java--package_options) +* [`java_alternative`](#-java--java_alternative) +* [`java_alternative_path`](#-java--java_alternative_path) +* [`java_home`](#-java--java_home) -##### `distribution` +##### `distribution` Data type: `String` @@ -52,7 +52,7 @@ implementations available (eg: OpenJDK vs Oracle JDK). Default value: `'jdk'` -##### `version` +##### `version` Data type: `Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/]` @@ -61,25 +61,25 @@ that java is present, and does not require a specific version. Default value: `'present'` -##### `package` +##### `package` Data type: `Optional[String]` The name of the java package. This is configurable in case a non-standard java package is desired. -Default value: ``undef`` +Default value: `undef` -##### `package_options` +##### `package_options` Data type: `Optional[Array]` Array of strings to pass installation options to the 'package' Puppet resource. Options available depend on the 'package' provider for the target OS. -Default value: ``undef`` +Default value: `undef` -##### `java_alternative` +##### `java_alternative` Data type: `Optional[String]` @@ -89,9 +89,9 @@ If you specify a particular package, you will almost always also want to specify which java_alternative to choose. If you set this, you also need to set the path below. -Default value: ``undef`` +Default value: `undef` -##### `java_alternative_path` +##### `java_alternative_path` Data type: `Optional[String]` @@ -100,20 +100,20 @@ alternatives system makes it difficult to verify which alternative is actually enabled, this is required to ensure the correct JVM is enabled. -Default value: ``undef`` +Default value: `undef` -##### `java_home` +##### `java_home` Data type: `Optional[String]` The path to where the JRE is installed. This will be set as an environment variable. -Default value: ``undef`` +Default value: `undef` ## Defined types -### `java::adopt` +### `java::adopt` Defined Type java::adopt @@ -121,21 +121,21 @@ Defined Type java::adopt The following parameters are available in the `java::adopt` defined type: -* [`ensure`](#ensure) -* [`version`](#version) -* [`version_major`](#version_major) -* [`version_minor`](#version_minor) -* [`java`](#java) -* [`proxy_server`](#proxy_server) -* [`proxy_type`](#proxy_type) -* [`url`](#url) -* [`basedir`](#basedir) -* [`manage_basedir`](#manage_basedir) -* [`package_type`](#package_type) -* [`manage_symlink`](#manage_symlink) -* [`symlink_name`](#symlink_name) +* [`ensure`](#-java--adopt--ensure) +* [`version`](#-java--adopt--version) +* [`version_major`](#-java--adopt--version_major) +* [`version_minor`](#-java--adopt--version_minor) +* [`java`](#-java--adopt--java) +* [`proxy_server`](#-java--adopt--proxy_server) +* [`proxy_type`](#-java--adopt--proxy_type) +* [`url`](#-java--adopt--url) +* [`basedir`](#-java--adopt--basedir) +* [`manage_basedir`](#-java--adopt--manage_basedir) +* [`package_type`](#-java--adopt--package_type) +* [`manage_symlink`](#-java--adopt--manage_symlink) +* [`symlink_name`](#-java--adopt--symlink_name) -##### `ensure` +##### `ensure` Data type: `Any` @@ -143,7 +143,7 @@ Install or remove the package. Default value: `'present'` -##### `version` +##### `version` Data type: `Any` @@ -151,23 +151,23 @@ Version of Java to install, e.g. '8' or '9'. Default values for major and minor Default value: `'8'` -##### `version_major` +##### `version_major` Data type: `Any` Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor. -Default value: ``undef`` +Default value: `undef` -##### `version_minor` +##### `version_minor` Data type: `Any` Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major. -Default value: ``undef`` +Default value: `undef` -##### `java` +##### `java` Data type: `Any` @@ -175,49 +175,49 @@ Type of Java Standard Edition to install, jdk or jre. Default value: `'jdk'` -##### `proxy_server` +##### `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`` +Default value: `undef` -##### `proxy_type` +##### `proxy_type` Data type: `Any` Proxy server type (none|http|https|ftp). (passed to archive) -Default value: ``undef`` +Default value: `undef` -##### `url` +##### `url` Data type: `Any` Full URL -Default value: ``undef`` +Default value: `undef` -##### `basedir` +##### `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`` +Default value: `undef` -##### `manage_basedir` +##### `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`` +Default value: `true` -##### `package_type` +##### `package_type` Data type: `Any` @@ -225,25 +225,25 @@ Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. Optional forced package types: rpm, rpmbin, tar.gz -Default value: ``undef`` +Default value: `undef` -##### `manage_symlink` +##### `manage_symlink` Data type: `Any` Whether to manage a symlink that points to the installation directory. Defaults to false. -Default value: ``false`` +Default value: `false` -##### `symlink_name` +##### `symlink_name` Data type: `Any` The name for the optional symlink in the installation directory. -Default value: ``undef`` +Default value: `undef` -### `java::adoptium` +### `java::adoptium` Defined Type java::adoptium @@ -251,20 +251,20 @@ Defined Type java::adoptium The following parameters are available in the `java::adoptium` defined type: -* [`ensure`](#ensure) -* [`version_major`](#version_major) -* [`version_minor`](#version_minor) -* [`version_patch`](#version_patch) -* [`version_build`](#version_build) -* [`proxy_server`](#proxy_server) -* [`proxy_type`](#proxy_type) -* [`url`](#url) -* [`basedir`](#basedir) -* [`manage_basedir`](#manage_basedir) -* [`manage_symlink`](#manage_symlink) -* [`symlink_name`](#symlink_name) +* [`ensure`](#-java--adoptium--ensure) +* [`version_major`](#-java--adoptium--version_major) +* [`version_minor`](#-java--adoptium--version_minor) +* [`version_patch`](#-java--adoptium--version_patch) +* [`version_build`](#-java--adoptium--version_build) +* [`proxy_server`](#-java--adoptium--proxy_server) +* [`proxy_type`](#-java--adoptium--proxy_type) +* [`url`](#-java--adoptium--url) +* [`basedir`](#-java--adoptium--basedir) +* [`manage_basedir`](#-java--adoptium--manage_basedir) +* [`manage_symlink`](#-java--adoptium--manage_symlink) +* [`symlink_name`](#-java--adoptium--symlink_name) -##### `ensure` +##### `ensure` Data type: `Any` @@ -272,97 +272,97 @@ Install or remove the package. Default value: `'present'` -##### `version_major` +##### `version_major` Data type: `Any` Major version which should be installed, e.g. '16' or '17' -Default value: ``undef`` +Default value: `undef` -##### `version_minor` +##### `version_minor` Data type: `Any` Minor version which should be installed, e.g. '0' -Default value: ``undef`` +Default value: `undef` -##### `version_patch` +##### `version_patch` Data type: `Any` Minor version which should be installed, e.g. '2' -Default value: ``undef`` +Default value: `undef` -##### `version_build` +##### `version_build` Data type: `Any` Build version which should be installed, e.g. '07' -Default value: ``undef`` +Default value: `undef` -##### `proxy_server` +##### `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`` +Default value: `undef` -##### `proxy_type` +##### `proxy_type` Data type: `Any` Proxy server type (none|http|https|ftp). (passed to archive) -Default value: ``undef`` +Default value: `undef` -##### `url` +##### `url` Data type: `Any` Full URL -Default value: ``undef`` +Default value: `undef` -##### `basedir` +##### `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`` +Default value: `undef` -##### `manage_basedir` +##### `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`` +Default value: `true` -##### `manage_symlink` +##### `manage_symlink` Data type: `Any` Whether to manage a symlink that points to the installation directory. Defaults to false. -Default value: ``false`` +Default value: `false` -##### `symlink_name` +##### `symlink_name` Data type: `Any` The name for the optional symlink in the installation directory. -Default value: ``undef`` +Default value: `undef` -### `java::download` +### `java::download` Defined Type java::download @@ -370,23 +370,23 @@ Defined Type java::download The following parameters are available in the `java::download` defined type: -* [`ensure`](#ensure) -* [`version`](#version) -* [`version_major`](#version_major) -* [`version_minor`](#version_minor) -* [`java_se`](#java_se) -* [`proxy_server`](#proxy_server) -* [`proxy_type`](#proxy_type) -* [`url`](#url) -* [`jce`](#jce) -* [`jce_url`](#jce_url) -* [`basedir`](#basedir) -* [`manage_basedir`](#manage_basedir) -* [`package_type`](#package_type) -* [`manage_symlink`](#manage_symlink) -* [`symlink_name`](#symlink_name) +* [`ensure`](#-java--download--ensure) +* [`version`](#-java--download--version) +* [`version_major`](#-java--download--version_major) +* [`version_minor`](#-java--download--version_minor) +* [`java_se`](#-java--download--java_se) +* [`proxy_server`](#-java--download--proxy_server) +* [`proxy_type`](#-java--download--proxy_type) +* [`url`](#-java--download--url) +* [`jce`](#-java--download--jce) +* [`jce_url`](#-java--download--jce_url) +* [`basedir`](#-java--download--basedir) +* [`manage_basedir`](#-java--download--manage_basedir) +* [`package_type`](#-java--download--package_type) +* [`manage_symlink`](#-java--download--manage_symlink) +* [`symlink_name`](#-java--download--symlink_name) -##### `ensure` +##### `ensure` Data type: `Any` @@ -394,7 +394,7 @@ Install or remove the package. Default value: `'present'` -##### `version` +##### `version` Data type: `Any` @@ -402,23 +402,23 @@ Version of Java to install, e.g. '7' or '8'. Default values for major and minor Default value: `'8'` -##### `version_major` +##### `version_major` Data type: `Any` Major version which should be installed, e.g. '8u101'. Must be used together with version_minor. -Default value: ``undef`` +Default value: `undef` -##### `version_minor` +##### `version_minor` Data type: `Any` Minor version which should be installed, e.g. 'b12'. Must be used together with version_major. -Default value: ``undef`` +Default value: `undef` -##### `java_se` +##### `java_se` Data type: `Any` @@ -426,65 +426,65 @@ Type of Java Standard Edition to install, jdk or jre. Default value: `'jdk'` -##### `proxy_server` +##### `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`` +Default value: `undef` -##### `proxy_type` +##### `proxy_type` Data type: `Any` Proxy server type (none|http|https|ftp). (passed to archive) -Default value: ``undef`` +Default value: `undef` -##### `url` +##### `url` Data type: `Any` Full URL -Default value: ``undef`` +Default value: `undef` -##### `jce` +##### `jce` Data type: `Any` Install Oracles Java Cryptographic Extensions into the JRE or JDK -Default value: ``false`` +Default value: `false` -##### `jce_url` +##### `jce_url` Data type: `Any` Full URL to the jce zip file -Default value: ``undef`` +Default value: `undef` -##### `basedir` +##### `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`` +Default value: `undef` -##### `manage_basedir` +##### `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: ``false`` +Default value: `false` -##### `package_type` +##### `package_type` Data type: `Any` @@ -492,25 +492,25 @@ Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. Optional forced package types: rpm, rpmbin, tar.gz -Default value: ``undef`` +Default value: `undef` -##### `manage_symlink` +##### `manage_symlink` Data type: `Any` Whether to manage a symlink that points to the installation directory. Defaults to false. -Default value: ``false`` +Default value: `false` -##### `symlink_name` +##### `symlink_name` Data type: `Any` The name for the optional symlink in the installation directory. -Default value: ``undef`` +Default value: `undef` -### `java::sap` +### `java::sap` Defined Type java::sap @@ -518,18 +518,18 @@ Defined Type java::sap The following parameters are available in the `java::sap` defined type: -* [`ensure`](#ensure) -* [`version`](#version) -* [`version_full`](#version_full) -* [`java`](#java) -* [`proxy_server`](#proxy_server) -* [`proxy_type`](#proxy_type) -* [`basedir`](#basedir) -* [`manage_basedir`](#manage_basedir) -* [`manage_symlink`](#manage_symlink) -* [`symlink_name`](#symlink_name) +* [`ensure`](#-java--sap--ensure) +* [`version`](#-java--sap--version) +* [`version_full`](#-java--sap--version_full) +* [`java`](#-java--sap--java) +* [`proxy_server`](#-java--sap--proxy_server) +* [`proxy_type`](#-java--sap--proxy_type) +* [`basedir`](#-java--sap--basedir) +* [`manage_basedir`](#-java--sap--manage_basedir) +* [`manage_symlink`](#-java--sap--manage_symlink) +* [`symlink_name`](#-java--sap--symlink_name) -##### `ensure` +##### `ensure` Data type: `Any` @@ -537,7 +537,7 @@ Install or remove the package. Default value: `'present'` -##### `version` +##### `version` Data type: `Any` @@ -545,15 +545,15 @@ Version of Java to install, e.g. '8' or '9'. Default values for full versions wi Default value: `'8'` -##### `version_full` +##### `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`` +Default value: `undef` -##### `java` +##### `java` Data type: `Any` @@ -561,53 +561,53 @@ Type of Java Edition to install, jdk or jre. Default value: `'jdk'` -##### `proxy_server` +##### `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`` +Default value: `undef` -##### `proxy_type` +##### `proxy_type` Data type: `Any` Proxy server type (none|http|https|ftp). (passed to archive) -Default value: ``undef`` +Default value: `undef` -##### `basedir` +##### `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`` +Default value: `undef` -##### `manage_basedir` +##### `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`` +Default value: `true` -##### `manage_symlink` +##### `manage_symlink` Data type: `Any` Whether to manage a symlink that points to the installation directory. Defaults to false. -Default value: ``false`` +Default value: `false` -##### `symlink_name` +##### `symlink_name` Data type: `Any` The name for the optional symlink in the installation directory. -Default value: ``undef`` +Default value: `undef` diff --git a/metadata.json b/metadata.json index 100f3f4e..d60ff4c3 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "8.2.0", + "version": "9.0.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From d5bbc7f91932c6e17b8887b4fa9f76438575eaf3 Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Fri, 25 Nov 2022 13:44:25 +0000 Subject: [PATCH 168/259] (538) - Unresolved fact fix Prior to this commit, when run on non-darwin systems with no java installed, the custom fact java_version was unresolved. This was due to an incorrect return type set in lib/facter/java_version.rb (returned a boolean). This commit hopes to rectify this issue, by ensuring that the returned value for java_version is in the correct format. --- lib/facter/java_version.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index b1b5e0ae..0029cb54 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -16,9 +16,9 @@ Facter.add(:java_version) do setcode do if ['darwin'].include? Facter.value(:kernel).downcase - return unless Facter::Core::Execution.execute('/usr/libexec/java_home --failfast', { on_fail: false }) + return nil unless Facter::Core::Execution.execute('/usr/libexec/java_home --failfast', { on_fail: false }) else - return unless Facter::Core::Execution.which('java') + return nil unless Facter::Core::Execution.which('java') end version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } version[%r{\"(.*?)\"}, 1] if version From d4d43c16ba8844fa66d474709a9a99b63db243b6 Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Mon, 28 Nov 2022 12:09:23 +0000 Subject: [PATCH 169/259] (538)-unresolved-fact-fix Fix for issue #538 --- lib/facter/java_version.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index 0029cb54..adf96997 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -16,11 +16,14 @@ Facter.add(:java_version) do setcode do if ['darwin'].include? Facter.value(:kernel).downcase - return nil unless Facter::Core::Execution.execute('/usr/libexec/java_home --failfast', { on_fail: false }) + if Facter::Core::Execution.execute('/usr/libexec/java_home --failfast', { on_fail: false }) + version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } + end else - return nil unless Facter::Core::Execution.which('java') + unless Facter::Core::Execution.which('java').nil? + version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } + end end - version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } version[%r{\"(.*?)\"}, 1] if version end end From aba7337363850c3795e8f048a683a214401f5ea9 Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Mon, 28 Nov 2022 13:29:50 +0000 Subject: [PATCH 170/259] fix Spec test failures --- lib/facter/java_version.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index adf96997..8c0c02c5 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -19,10 +19,8 @@ if Facter::Core::Execution.execute('/usr/libexec/java_home --failfast', { on_fail: false }) version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } end - else - unless Facter::Core::Execution.which('java').nil? - version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } - end + elsif Facter::Core::Execution.which('java') + version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } end version[%r{\"(.*?)\"}, 1] if version end From 8d0d603c16eb28564eb6217fb8783196a7134660 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Tue, 29 Nov 2022 10:12:05 +0000 Subject: [PATCH 171/259] Release prep v9.0.1 --- CHANGELOG.md | 8 ++++++++ metadata.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 792536fe..0b7651ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,14 @@ 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). +## [v9.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.1) (2022-11-29) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.0...v9.0.1) + +### Fixed + +- 538-unresolved-fact-fix [\#540](https://github.com/puppetlabs/puppetlabs-java/pull/540) ([jordanbreen28](https://github.com/jordanbreen28)) + ## [v9.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.0) (2022-11-23) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.2.0...v9.0.0) diff --git a/metadata.json b/metadata.json index d60ff4c3..43eb8d70 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "9.0.0", + "version": "9.0.1", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From a0fa20e31713fbc76aeed196fe1440f6031fbf88 Mon Sep 17 00:00:00 2001 From: Craig Gumbley Date: Tue, 13 Dec 2022 10:00:16 +0000 Subject: [PATCH 172/259] (MAINT) Remove stalebot workflow --- .github/workflows/stale.yml | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 .github/workflows/stale.yml diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml deleted file mode 100644 index 26d7e5b1..00000000 --- a/.github/workflows/stale.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: Audit aging issues/PRs - -on: - schedule: - - cron: "30 1 * * *" - -jobs: - audit: - runs-on: ubuntu-latest - steps: - - uses: actions/stale@v3 - with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - days-before-issue-stale: 90 - days-before-pr-stale: 60 - days-before-pr-close: 7 - stale-issue-message: | - Hello! 👋 - - This issue has been open for a while and has had no recent activity. We've labelled it with `attention-needed` so that we can get a clear view of which issues need our attention. - - If you are waiting on a response from us we will try and address your comments on a future Community Day. - - Alternatively, if it is no longer relevant to you please close the issue with a comment. - stale-issue-label: 'attention-needed' - stale-pr-message: | - Hello! 👋 - - This pull request has been open for a while and has had no recent activity. We've labelled it with `attention-needed` so that we can get a clear view of which PRs need our attention. - - If you are waiting on a response from us we will try and address your comments on a future Community Day. - - Alternatively, if it is no longer relevant to you please close the PR with a comment. - - Please note that if a pull request receives no update for 7 after it has been labelled, it will be closed. We are always happy to re-open pull request if they have been closed in error. - stale-pr-label: 'attention-needed' From 0dcd91b6e8d2b2519228c534fe4976e9d2a3a1d6 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Wed, 11 Jan 2023 17:20:51 +0000 Subject: [PATCH 173/259] (CONT-356) Syntax update Code now compliant with the following rules: relative_classname_inclusion relative_classname_reference parameter_documentation parameter_types top scope facts legacy facts anchor resource --- .puppet-lint.rc | 4 ---- .sync.yml | 6 ------ Rakefile | 5 ----- manifests/adopt.pp | 34 +++++++++++++++++----------------- manifests/adoptium.pp | 27 +++++++++++++-------------- manifests/download.pp | 30 +++++++++++++++--------------- manifests/init.pp | 20 +++++++++----------- manifests/sap.pp | 25 ++++++++++++------------- 8 files changed, 66 insertions(+), 85 deletions(-) diff --git a/.puppet-lint.rc b/.puppet-lint.rc index c5be7aab..cc96ece0 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1,5 +1 @@ --relative ---no-parameter_types-check ---no-relative_classname_inclusion-check ---no-legacy_facts-check ---no-anchor_resource-check diff --git a/.sync.yml b/.sync.yml index 3b69f7ad..d03bffc6 100644 --- a/.sync.yml +++ b/.sync.yml @@ -28,9 +28,3 @@ spec/spec_helper.rb: unmanaged: false .travis.yml: delete: true -Rakefile: - extra_disabled_lint_checks: - - parameter_types - - relative_classname_inclusion - - legacy_facts - - anchor_resource diff --git a/Rakefile b/Rakefile index 21c1ccca..2906c15b 100644 --- a/Rakefile +++ b/Rakefile @@ -42,11 +42,6 @@ def changelog_future_release end PuppetLint.configuration.send('disable_relative') -PuppetLint.configuration.send('disable_parameter_types') -PuppetLint.configuration.send('disable_relative_classname_inclusion') -PuppetLint.configuration.send('disable_legacy_facts') -PuppetLint.configuration.send('disable_anchor_resource') - if Bundler.rubygems.find_name('github_changelog_generator').any? GitHubChangelogGenerator::RakeTask.new :changelog do |config| diff --git a/manifests/adopt.pp b/manifests/adopt.pp index fde321b8..5b6ccc16 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -13,7 +13,8 @@ # Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor. # # @param version_minor -# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major. +# Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). +# Must be used together with version_major. # # @param java # Type of Java Standard Edition to install, jdk or jre. @@ -32,7 +33,7 @@ # /usr/lib/jvm for Debian and /usr/java for RedHat. # # @param manage_basedir -# Whether to manage the basedir directory. Defaults to false. +# Whether to manage the basedir directory. # Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. # # @param package_type @@ -47,22 +48,22 @@ # The name for the optional symlink in the installation directory. # define java::adopt ( - $ensure = 'present', - $version = '8', - $version_major = undef, - $version_minor = undef, - $java = 'jdk', - $proxy_server = undef, - $proxy_type = undef, - $url = undef, - $basedir = undef, - $manage_basedir = true, - $package_type = undef, - $manage_symlink = false, - $symlink_name = undef, + String[1] $ensure = 'present', + String[1] $version = '8', + Optional[String] $version_major = undef, + Optional[String] $version_minor = undef, + String $java = 'jdk', + Optional[String] $proxy_server = undef, + Optional[String] $proxy_type = undef, + Optional[String] $url = undef, + Optional[String] $basedir = undef, + Boolean $manage_basedir = true, + Optional[String] $package_type = undef, + Boolean $manage_symlink = false, + Optional[String] $symlink_name = undef, ) { # archive module is used to download the java package - include ::archive + include archive # validate java Standard Edition to download if $java !~ /(jre|jdk)/ { @@ -188,7 +189,6 @@ # set java architecture nomenclature $os_architecture = $facts['os']['architecture'] ? { - undef => $facts['architecture'], default => $facts['os']['architecture'] } diff --git a/manifests/adoptium.pp b/manifests/adoptium.pp index 6f87e602..e1cf2ce6 100644 --- a/manifests/adoptium.pp +++ b/manifests/adoptium.pp @@ -42,21 +42,21 @@ # The name for the optional symlink in the installation directory. # define java::adoptium ( - $ensure = 'present', - $version_major = undef, - $version_minor = undef, - $version_patch = undef, - $version_build = undef, - $proxy_server = undef, - $proxy_type = undef, - $url = undef, - $basedir = undef, - $manage_basedir = true, - $manage_symlink = false, - $symlink_name = undef, + String[1] $ensure = 'present', + Optional[String] $version_major = undef, + Optional[String] $version_minor = undef, + Optional[String] $version_patch = undef, + Optional[String] $version_build = undef, + Optional[String] $proxy_server = undef, + Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, + Optional[String] $url = undef, + Optional[String] $basedir = undef, + Boolean $manage_basedir = true, + Boolean $manage_symlink = false, + Optional[String] $symlink_name = undef, ) { # archive module is used to download the java package - include ::archive + include archive $install_path = "jdk-${version_major}.${version_minor}.${version_patch}+${version_build}" @@ -93,7 +93,6 @@ # set java architecture nomenclature $os_architecture = $facts['os']['architecture'] ? { - undef => $facts['architecture'], default => $facts['os']['architecture'] } diff --git a/manifests/download.pp b/manifests/download.pp index 8c31fbef..85e24384 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -54,21 +54,21 @@ # The name for the optional symlink in the installation directory. # define java::download ( - $ensure = 'present', - $version = '8', - $version_major = undef, - $version_minor = undef, - $java_se = 'jdk', - $proxy_server = undef, - $proxy_type = undef, - $url = undef, - $jce = false, - $jce_url = undef, - $basedir = undef, - $manage_basedir = false, - $package_type = undef, - $manage_symlink = false, - $symlink_name = undef, + String[1] $ensure = 'present', + String[1] $version = '8', + Optional[String] $version_major = undef, + Optional[String] $version_minor = undef, + String[1] $java_se = 'jdk', + Optional[String] $proxy_server = undef, + Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, + Optional[String] $url = undef, + Boolean $jce = false, + Optional[String] $jce_url = undef, + Optional[String] $basedir = undef, + Boolean $manage_basedir = false, + Optional[String] $package_type = undef, + Boolean $manage_symlink = false, + Optional[String] $symlink_name = undef, ) { # archive module is used to download the java package include archive diff --git a/manifests/init.pp b/manifests/init.pp index 43811e7c..c70ee162 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -36,15 +36,15 @@ # environment variable. # class java ( - String $distribution = 'jdk', - Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/] $version = 'present', - Optional[String] $package = undef, - Optional[Array] $package_options = undef, - Optional[String] $java_alternative = undef, - Optional[String] $java_alternative_path = undef, - Optional[String] $java_home = undef + String $distribution = 'jdk', + Pattern[/present|installed|latest|^[.+_0-9a-zA-Z:~-]+$/] $version = 'present', + Optional[String] $package = undef, + Optional[Array] $package_options = undef, + Optional[String] $java_alternative = undef, + Optional[String] $java_alternative_path = undef, + Optional[String] $java_home = undef ) { - include ::java::params + contain java::params $default_package_name = has_key($java::params::java, $distribution) ? { false => undef, @@ -118,12 +118,10 @@ } } - anchor { 'java::begin:': } - -> package { 'java': + package { 'java': ensure => $version, install_options => $package_options, name => $use_java_package_name, } -> class { 'java::config': } - -> anchor { 'java::end': } } diff --git a/manifests/sap.pp b/manifests/sap.pp index e8e893d2..1eb75990 100644 --- a/manifests/sap.pp +++ b/manifests/sap.pp @@ -26,7 +26,7 @@ # /usr/lib/jvm for Debian and /usr/java for RedHat. # # @param manage_basedir -# Whether to manage the basedir directory. Defaults to false. +# Whether to manage the basedir directory. # Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. # # @param manage_symlink @@ -36,19 +36,19 @@ # 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, + String[1] $ensure = 'present', + String[1] $version = '8', + Optional[String] $version_full = undef, + String[1] $java = 'jdk', + Optional[String] $proxy_server = undef, + Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, + Optional[String] $basedir = undef, + Boolean $manage_basedir = true, + Boolean $manage_symlink = false, + Optional[String] $symlink_name = undef, ) { # archive module is used to download the java package - include ::archive + include archive # validate java edition to download if $java !~ /(jre|jdk)/ { @@ -128,7 +128,6 @@ } $_os_architecture = $facts['os']['architecture'] ? { - undef => $facts['architecture'], default => $facts['os']['architecture'] } From cf18185a9195014253df260a1a714122bff9eca4 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius <97180854+LukasAud@users.noreply.github.com> Date: Wed, 11 Jan 2023 17:38:34 +0000 Subject: [PATCH 174/259] Fix non-empty string missing Co-authored-by: Tim Meusel --- manifests/adopt.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index 5b6ccc16..baa4fa66 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -52,7 +52,7 @@ String[1] $version = '8', Optional[String] $version_major = undef, Optional[String] $version_minor = undef, - String $java = 'jdk', + String[1] $java = 'jdk', Optional[String] $proxy_server = undef, Optional[String] $proxy_type = undef, Optional[String] $url = undef, From 6ff04d5b165498d11c146950fdc0c3313f367302 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 12 Jan 2023 15:31:17 +0000 Subject: [PATCH 175/259] Addressing $ensure datatype --- manifests/adopt.pp | 2 +- manifests/adoptium.pp | 2 +- manifests/download.pp | 2 +- manifests/sap.pp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/manifests/adopt.pp b/manifests/adopt.pp index baa4fa66..957a7f03 100644 --- a/manifests/adopt.pp +++ b/manifests/adopt.pp @@ -48,7 +48,7 @@ # The name for the optional symlink in the installation directory. # define java::adopt ( - String[1] $ensure = 'present', + Enum['present'] $ensure = 'present', String[1] $version = '8', Optional[String] $version_major = undef, Optional[String] $version_minor = undef, diff --git a/manifests/adoptium.pp b/manifests/adoptium.pp index e1cf2ce6..c39d36b5 100644 --- a/manifests/adoptium.pp +++ b/manifests/adoptium.pp @@ -42,7 +42,7 @@ # The name for the optional symlink in the installation directory. # define java::adoptium ( - String[1] $ensure = 'present', + Enum['present'] $ensure = 'present', Optional[String] $version_major = undef, Optional[String] $version_minor = undef, Optional[String] $version_patch = undef, diff --git a/manifests/download.pp b/manifests/download.pp index 85e24384..e8593820 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -54,7 +54,7 @@ # The name for the optional symlink in the installation directory. # define java::download ( - String[1] $ensure = 'present', + Enum['present'] $ensure = 'present', String[1] $version = '8', Optional[String] $version_major = undef, Optional[String] $version_minor = undef, diff --git a/manifests/sap.pp b/manifests/sap.pp index 1eb75990..05618be4 100644 --- a/manifests/sap.pp +++ b/manifests/sap.pp @@ -36,7 +36,7 @@ # The name for the optional symlink in the installation directory. # define java::sap ( - String[1] $ensure = 'present', + Enum['present'] $ensure = 'present', String[1] $version = '8', Optional[String] $version_full = undef, String[1] $java = 'jdk', From 93bf1e586f94e6b67018c625a23b1064f460dd30 Mon Sep 17 00:00:00 2001 From: david22swan Date: Tue, 17 Jan 2023 18:12:34 +0000 Subject: [PATCH 176/259] (CONT-494) PDK Update --- Gemfile | 8 ++++++-- metadata.json | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 26dd2db9..1b760360 100644 --- a/Gemfile +++ b/Gemfile @@ -14,8 +14,12 @@ def location_for(place_or_version, fake_version = nil) end group :development do - gem "json", '~> 2.0', require: false - gem "voxpupuli-puppet-lint-plugins", '~> 3.0', require: false + 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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "voxpupuli-puppet-lint-plugins", '~> 3.1', require: false gem "facterdb", '~> 1.18', require: false gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false gem "puppetlabs_spec_helper", '>= 3.0.0', '< 5.0.0', require: false diff --git a/metadata.json b/metadata.json index 43eb8d70..7745f41f 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "tags/2.6.0-0-gd0490b9", + "template-ref": "2.7.1-0-g9a16c87", "pdk-version": "2.5.0" } From 5e4a6043852b95a9afa09c880da942561c47b5a6 Mon Sep 17 00:00:00 2001 From: david22swan Date: Wed, 18 Jan 2023 15:07:26 +0000 Subject: [PATCH 177/259] (CONT-494) Fix for .sync.yml --- .sync.yml | 1 + Gemfile | 2 +- metadata.json | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.sync.yml b/.sync.yml index 3b69f7ad..1f4eb9b4 100644 --- a/.sync.yml +++ b/.sync.yml @@ -8,6 +8,7 @@ Gemfile: optional: ":development": - gem: github_changelog_generator + version: '= 1.15.2' spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true diff --git a/Gemfile b/Gemfile index 1b760360..a84b5ee8 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ group :development do gem "rubocop-performance", '= 1.9.1', require: false gem "rubocop-rspec", '= 2.0.1', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", require: false + gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby] diff --git a/metadata.json b/metadata.json index 7745f41f..578a1e85 100644 --- a/metadata.json +++ b/metadata.json @@ -82,5 +82,5 @@ ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", "template-ref": "2.7.1-0-g9a16c87", - "pdk-version": "2.5.0" + "pdk-version": "2.6.0" } From 16b6ead92eed1eb6e85846642e682c2aba4ead0f Mon Sep 17 00:00:00 2001 From: Paula Muir Date: Wed, 1 Feb 2023 12:04:54 +0000 Subject: [PATCH 178/259] Adding mend file --- .github/workflows/mend.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/mend.yml diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml new file mode 100644 index 00000000..b4100a5a --- /dev/null +++ b/.github/workflows/mend.yml @@ -0,0 +1,15 @@ +name: "mend" + +on: + pull_request: + branches: + - "main" + schedule: + - cron: "0 0 * * *" + workflow_dispatch: + +jobs: + + mend: + uses: "puppetlabs/cat-github-actions/.github/workflows/mend_ruby.yml@main" + secrets: "inherit" From c8cca3da2942e4ef4f06094d903dbc5b533a43f2 Mon Sep 17 00:00:00 2001 From: Gavin Patton Date: Wed, 22 Mar 2023 06:22:31 +0000 Subject: [PATCH 179/259] "This change pins the puppetlabs-puppet_agent module to v4.12.1. Previosuly the fixutre was configured to pull from main. Given the recent changes when moving towards puppet8 main is unsafe." --- .fixtures.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.fixtures.yml b/.fixtures.yml index c675307e..fc5c840f 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,7 +3,9 @@ fixtures: 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' + puppet_agent: + repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' + ref: v4.12.1 provision: 'https://github.com/puppetlabs/provision.git' symlinks: java: "#{source_dir}" From 78952c1b0bee15480813c3ff4a522ec558224e9a Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Fri, 24 Mar 2023 16:54:54 +0000 Subject: [PATCH 180/259] (CONT-229) - Implement reusable workflows --- .github/workflows/auto_release.yml | 87 +----------- .github/workflows/ci.yml | 17 +++ .github/workflows/nightly.yml | 204 ++--------------------------- .github/workflows/pr_test.yml | 185 -------------------------- .github/workflows/release.yml | 44 +------ .github/workflows/spec.yml | 126 ------------------ 6 files changed, 31 insertions(+), 632 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/pr_test.yml delete mode 100644 .github/workflows/spec.yml diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml index f4aed440..d6270c56 100644 --- a/.github/workflows/auto_release.yml +++ b/.github/workflows/auto_release.yml @@ -3,88 +3,7 @@ name: "Auto release" on: workflow_dispatch: -env: - HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 - HONEYCOMB_DATASET: litmus tests - CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - jobs: - auto_release: - name: "Automatic release prep" - runs-on: ubuntu-20.04 - - steps: - - - name: "Honeycomb: Start recording" - uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 - with: - apikey: ${{ env.HONEYCOMB_WRITEKEY }} - dataset: ${{ env.HONEYCOMB_DATASET }} - job-status: ${{ job.status }} - - - name: "Honeycomb: start first step" - run: | - echo STEP_ID="auto-release" >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: "Checkout Source" - if: ${{ github.repository_owner == 'puppetlabs' }} - uses: actions/checkout@v2 - with: - fetch-depth: 0 - persist-credentials: false - - - name: "PDK Release prep" - uses: docker://puppet/iac_release:ci - with: - args: 'release prep --force' - env: - CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: "Get Version" - if: ${{ github.repository_owner == 'puppetlabs' }} - id: gv - run: | - echo "::set-output name=ver::$(jq --raw-output .version metadata.json)" - - - name: "Check if a release is necessary" - if: ${{ github.repository_owner == 'puppetlabs' }} - id: check - run: | - git diff --quiet CHANGELOG.md && echo "::set-output name=release::false" || echo "::set-output name=release::true" - - - name: "Commit changes" - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - run: | - git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com" - git config --local user.name "GitHub Action" - git add . - git commit -m "Release prep v${{ steps.gv.outputs.ver }}" - - - name: Create Pull Request - id: cpr - uses: puppetlabs/peter-evans-create-pull-request@v3 - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - with: - token: ${{ secrets.GITHUB_TOKEN }} - commit-message: "Release prep v${{ steps.gv.outputs.ver }}" - branch: "release-prep" - delete-branch: true - title: "Release prep v${{ steps.gv.outputs.ver }}" - body: | - Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}. - Please verify before merging: - - [ ] last [nightly](https://github.com/${{ github.repository }}/actions/workflows/nightly.yml) run is green - - [ ] [Changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) is readable and has no unlabeled pull requests - - [ ] Ensure the [changelog](https://github.com/${{ github.repository }}/blob/release-prep/CHANGELOG.md) version and [metadata](https://github.com/${{ github.repository }}/blob/release-prep/metadata.json) version match - labels: "maintenance" - - - name: PR outputs - if: ${{ github.repository_owner == 'puppetlabs' && steps.check.outputs.release == 'true' }} - run: | - echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" - echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" - - - name: "Honeycomb: Record finish step" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow' + release_prep: + uses: "puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main" + secrets: "inherit" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..a5738adb --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,17 @@ +name: "ci" + +on: + pull_request: + branches: + - "main" + workflow_dispatch: + +jobs: + Spec: + uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" + secrets: "inherit" + + Acceptance: + needs: Spec + uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" + secrets: "inherit" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 42816e7d..1b06c471 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -2,203 +2,15 @@ name: "nightly" on: schedule: - - cron: '0 0 * * *' - - -env: - HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 - HONEYCOMB_DATASET: litmus tests + - cron: "0 0 * * *" + workflow_dispatch: jobs: - setup_matrix: - if: ${{ github.repository_owner == 'puppetlabs' }} - name: "Setup Test Matrix" - runs-on: ubuntu-20.04 - outputs: - matrix: ${{ steps.get-matrix.outputs.matrix }} - - steps: - - - name: "Honeycomb: Start recording" - uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 - with: - apikey: ${{ env.HONEYCOMB_WRITEKEY }} - dataset: ${{ env.HONEYCOMB_DATASET }} - job-status: ${{ job.status }} + Spec: + uses: "puppetlabs/cat-github-actions/.github/workflows/module_ci.yml@main" + secrets: "inherit" - - name: "Honeycomb: Start first step" - run: | - echo STEP_ID=setup-environment >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Checkout Source - uses: actions/checkout@v2 - if: ${{ github.repository_owner == 'puppetlabs' }} - - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - if: ${{ github.repository_owner == 'puppetlabs' }} - with: - ruby-version: "2.7" - bundler-cache: true - - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::bundler environment - buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env - echo ::endgroup:: - - - name: "Honeycomb: Record Setup Environment time" - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' - echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Setup Acceptance Test Matrix - id: get-matrix - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 - else - echo "::set-output name=matrix::{}" - fi - - - name: "Honeycomb: Record Setup Test Matrix time" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' Acceptance: - name: "${{matrix.platforms.label}}, ${{matrix.collection}}" - needs: - - setup_matrix - - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} - - env: - BUILDEVENT_FILE: '../buildevents.txt' - - steps: - - run: | - echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE - echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE - echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE - - - - name: "Honeycomb: Start recording" - uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 - with: - apikey: ${{ env.HONEYCOMB_WRITEKEY }} - dataset: ${{ env.HONEYCOMB_DATASET }} - job-status: ${{ job.status }} - matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }} - - - name: "Honeycomb: start first step" - run: | - echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - - name: Checkout Source - uses: actions/checkout@v2 - - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: "2.7" - bundler-cache: true - - - name: Print bundle environment - run: | - echo ::group::bundler environment - buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env - echo ::endgroup:: - - - name: "Honeycomb: Record Setup Environment time" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' - echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - - name: Provision test environment - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]' - echo ::group::=== REQUEST === - cat request.json || true - echo - echo ::endgroup:: - echo ::group::=== INVENTORY === - if [ -f 'spec/fixtures/litmus_inventory.yaml' ]; - then - FILE='spec/fixtures/litmus_inventory.yaml' - elif [ -f 'inventory.yaml' ]; - then - FILE='inventory.yaml' - fi - sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true - echo ::endgroup:: - - - name: Install agent - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' - - - name: Install module - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' - - - name: "Honeycomb: Record deployment times" - if: ${{ always() }} - run: | - echo ::group::honeycomb step - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system' - echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - echo ::endgroup:: - - - name: Run acceptance tests - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel' - - - name: "Honeycomb: Record acceptance testing times" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' - echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - - name: Remove test environment - if: ${{ always() }} - continue-on-error: true - run: | - if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' - echo ::group::=== REQUEST === - cat request.json || true - echo - echo ::endgroup:: - fi - - - name: "Honeycomb: Record removal times" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment' - - slack-workflow-status: - if: ${{ github.repository_owner == 'puppetlabs' }} - name: Post Workflow Status To Slack - needs: - - Acceptance - runs-on: ubuntu-20.04 - steps: - - name: Slack Workflow Notification - uses: puppetlabs/Gamesight-slack-workflow-status@pdk-templates-v1 - with: - # Required Input - repo_token: ${{ secrets.GITHUB_TOKEN }} - slack_webhook_url: ${{ secrets.SLACK_WEBHOOK }} - # Optional Input - channel: '#team-cat-bots' - name: 'GABot' + needs: Spec + uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" + secrets: "inherit" diff --git a/.github/workflows/pr_test.yml b/.github/workflows/pr_test.yml deleted file mode 100644 index fd310e65..00000000 --- a/.github/workflows/pr_test.yml +++ /dev/null @@ -1,185 +0,0 @@ -name: "PR Testing" - -on: [pull_request] - - -env: - - HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 - HONEYCOMB_DATASET: litmus tests - -jobs: - setup_matrix: - name: "Setup Test Matrix" - runs-on: ubuntu-20.04 - outputs: - matrix: ${{ steps.get-matrix.outputs.matrix }} - - steps: - - - name: "Honeycomb: Start recording" - uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 - with: - apikey: ${{ env.HONEYCOMB_WRITEKEY }} - dataset: ${{ env.HONEYCOMB_DATASET }} - job-status: ${{ job.status }} - - - name: "Honeycomb: Start first step" - run: | - echo STEP_ID=setup-environment >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Checkout Source - uses: actions/checkout@v2 - if: ${{ github.repository_owner == 'puppetlabs' }} - - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - if: ${{ github.repository_owner == 'puppetlabs' }} - with: - ruby-version: "2.7" - bundler-cache: true - - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::bundler environment - buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env - echo ::endgroup:: - - - name: "Honeycomb: Record Setup Environment time" - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' - echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Run validation steps - run: | - bundle exec rake validate - if: ${{ github.repository_owner == 'puppetlabs' }} - - - name: Setup Acceptance Test Matrix - id: get-matrix - run: | - if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 - else - echo "::set-output name=matrix::{}" - fi - - - name: "Honeycomb: Record Setup Test Matrix time" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' - Acceptance: - name: "${{matrix.platforms.label}}, ${{matrix.collection}}" - needs: - - setup_matrix - if: ${{ needs.setup_matrix.outputs.matrix != '{}' }} - - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: ${{fromJson(needs.setup_matrix.outputs.matrix)}} - - env: - BUILDEVENT_FILE: '../buildevents.txt' - - steps: - - run: | - echo 'platform=${{ matrix.platforms.image }}' >> $BUILDEVENT_FILE - echo 'collection=${{ matrix.collection }}' >> $BUILDEVENT_FILE - echo 'label=${{ matrix.platforms.label }}' >> $BUILDEVENT_FILE - - - name: "Honeycomb: Start recording" - uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 - with: - apikey: ${{ env.HONEYCOMB_WRITEKEY }} - dataset: ${{ env.HONEYCOMB_DATASET }} - job-status: ${{ job.status }} - matrix-key: ${{ matrix.platforms.label }}-${{ matrix.collection }} - - - name: "Honeycomb: start first step" - run: | - echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-1 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Checkout Source - uses: actions/checkout@v2 - - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - with: - ruby-version: "2.7" - bundler-cache: true - - - name: Print bundle environment - run: | - echo ::group::bundler environment - buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env - echo ::endgroup:: - - - name: "Honeycomb: Record Setup Environment time" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' - echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-2 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Provision test environment - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:provision ${{ matrix.platforms.image }}' -- bundle exec rake 'litmus:provision[${{matrix.platforms.provider}},${{ matrix.platforms.image }}]' - echo ::group::=== REQUEST === - cat request.json || true - echo - echo ::endgroup:: - echo ::group::=== INVENTORY === - if [ -f 'spec/fixtures/litmus_inventory.yaml' ]; - then - FILE='spec/fixtures/litmus_inventory.yaml' - elif [ -f 'inventory.yaml' ]; - then - FILE='inventory.yaml' - fi - sed -e 's/password: .*/password: "[redacted]"/' < $FILE || true - echo ::endgroup:: - - - name: Install agent - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_agent ${{ matrix.collection }}' -- bundle exec rake 'litmus:install_agent[${{ matrix.collection }}]' - - - name: Install module - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:install_module' -- bundle exec rake 'litmus:install_module' - - - name: "Honeycomb: Record deployment times" - if: ${{ always() }} - run: | - echo ::group::honeycomb step - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Deploy test system' - echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-3 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - echo ::endgroup:: - - name: Run acceptance tests - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:acceptance:parallel' -- bundle exec rake 'litmus:acceptance:parallel' - - - name: "Honeycomb: Record acceptance testing times" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Run acceptance tests' - echo STEP_ID=${{ matrix.platforms.image }}-${{ matrix.collection }}-4 >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Remove test environment - if: ${{ always() }} - continue-on-error: true - run: | - if [[ -f inventory.yaml || -f spec/fixtures/litmus_inventory.yaml ]]; then - buildevents cmd $TRACE_ID $STEP_ID 'rake litmus:tear_down' -- bundle exec rake 'litmus:tear_down' - echo ::group::=== REQUEST === - cat request.json || true - echo - echo ::endgroup:: - fi - - - name: "Honeycomb: Record removal times" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Remove test environment' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1509f6e9..0b7b8a05 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,44 +4,6 @@ on: workflow_dispatch: jobs: - create-github-release: - name: Deploy GitHub Release - runs-on: ubuntu-20.04 - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - clean: true - fetch-depth: 0 - - name: Get Version - id: gv - run: | - echo "::set-output name=ver::$(jq --raw-output .version metadata.json)" - - name: Create Release - uses: actions/create-release@v1 - id: create_release - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: "v${{ steps.gv.outputs.ver }}" - draft: false - prerelease: false - - deploy-forge: - name: Deploy to Forge - runs-on: ubuntu-20.04 - steps: - - name: Checkout code - uses: actions/checkout@v2 - with: - ref: ${{ github.ref }} - clean: true - - name: "PDK Build" - uses: docker://puppet/pdk:nightly - with: - args: 'build' - - name: "Push to Forge" - uses: docker://puppet/pdk:nightly - with: - args: 'release publish --forge-token ${{ secrets.FORGE_API_KEY }} --force' + release: + uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main" + secrets: "inherit" diff --git a/.github/workflows/spec.yml b/.github/workflows/spec.yml deleted file mode 100644 index 6c1ae10d..00000000 --- a/.github/workflows/spec.yml +++ /dev/null @@ -1,126 +0,0 @@ -name: "Spec Tests" - -on: - schedule: - - cron: '0 0 * * *' - workflow_dispatch: - pull_request: - - -env: - HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6 - HONEYCOMB_DATASET: litmus tests - -jobs: - setup_matrix: - name: "Setup Test Matrix" - runs-on: ubuntu-20.04 - outputs: - spec_matrix: ${{ steps.get-matrix.outputs.spec_matrix }} - - steps: - - - name: "Honeycomb: Start recording" - uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 - with: - apikey: ${{ env.HONEYCOMB_WRITEKEY }} - dataset: ${{ env.HONEYCOMB_DATASET }} - job-status: ${{ job.status }} - - - name: "Honeycomb: Start first step" - run: | - echo STEP_ID=setup-environment >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Checkout Source - uses: actions/checkout@v2 - if: ${{ github.repository_owner == 'puppetlabs' }} - - - name: Activate Ruby 2.7 - uses: ruby/setup-ruby@v1 - if: ${{ github.repository_owner == 'puppetlabs' }} - with: - ruby-version: "2.7" - bundler-cache: true - - - name: Print bundle environment - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - echo ::group::bundler environment - buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env - echo ::endgroup:: - - name: "Honeycomb: Record Setup Environment time" - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Environment' - echo STEP_ID=Setup-Acceptance-Test-Matrix >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - name: Run Static & Syntax Tests - if: ${{ github.repository_owner == 'puppetlabs' }} - run: | - buildevents cmd $TRACE_ID $STEP_ID 'static_syntax_checks' -- bundle exec rake syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop - - - name: Setup Spec Test Matrix - id: get-matrix - run: | - if [ '${{ github.repository_owner }}' == 'puppetlabs' ]; then - buildevents cmd $TRACE_ID $STEP_ID matrix_from_metadata -- bundle exec matrix_from_metadata_v2 - else - echo "::set-output name=spec_matrix::{}" - fi - - name: "Honeycomb: Record Setup Test Matrix time" - if: ${{ always() }} - run: | - buildevents step $TRACE_ID $STEP_ID $STEP_START 'Setup Test Matrix' - Spec: - name: "Spec Tests (Puppet: ${{matrix.puppet_version}}, Ruby Ver: ${{matrix.ruby_version}})" - needs: - - setup_matrix - if: ${{ needs.setup_matrix.outputs.spec_matrix != '{}' }} - - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: ${{fromJson(needs.setup_matrix.outputs.spec_matrix)}} - - env: - BUILDEVENT_FILE: '../buildevents.txt' - PUPPET_GEM_VERSION: ${{ matrix.puppet_version }} - FACTER_GEM_VERSION: 'https://github.com/puppetlabs/facter#main' - - steps: - - run: | - echo "SANITIZED_PUPPET_VERSION=$(echo '${{ matrix.puppet_version }}' | sed 's/~> //g')" >> $GITHUB_ENV - - - run: | - echo 'puppet_version=${{ env.SANITIZED_PUPPET_VERSION }}' >> $BUILDEVENT_FILE - - name: "Honeycomb: Start first step" - run: | - echo "STEP_ID=${{ env.SANITIZED_PUPPET_VERSION }}-spec" >> $GITHUB_ENV - echo STEP_START=$(date +%s) >> $GITHUB_ENV - - - name: "Honeycomb: Start recording" - uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1 - with: - apikey: ${{ env.HONEYCOMB_WRITEKEY }} - dataset: ${{ env.HONEYCOMB_DATASET }} - job-status: ${{ job.status }} - matrix-key: ${{ env.SANITIZED_PUPPET_VERSION }} - - name: Checkout Source - uses: actions/checkout@v2 - - - name: "Activate Ruby ${{ matrix.ruby_version }}" - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{matrix.ruby_version}} - bundler-cache: true - - - name: Print bundle environment - run: | - echo ::group::bundler environment - buildevents cmd $TRACE_ID $STEP_ID 'bundle env' -- bundle env - echo ::endgroup:: - - - - name: Run parallel_spec tests - run: | - buildevents cmd $TRACE_ID $STEP_ID 'rake parallel_spec Puppet ${{ matrix.puppet_version }}, Ruby ${{ matrix.ruby_version }}' -- bundle exec rake parallel_spec From 6ff4ffefc4b38fa273e230d02d422f65cd8f9275 Mon Sep 17 00:00:00 2001 From: david22swan Date: Tue, 28 Mar 2023 11:17:35 +0100 Subject: [PATCH 181/259] (CONT-826) Temporarily pin puppet_litmus to 0.34.6 or less --- Gemfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile b/Gemfile index a84b5ee8..1881afe1 100644 --- a/Gemfile +++ b/Gemfile @@ -37,8 +37,8 @@ group :development do gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do - gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby] - gem "serverspec", '~> 2.41', require: false + gem "puppet_litmus", '<= 0.34.6', require: false, platforms: [:ruby] + gem "serverspec", '~> 2.41', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] From df3cfda9495a5cc73a07832345370788d2c2aec8 Mon Sep 17 00:00:00 2001 From: Steve Traylen Date: Thu, 30 Mar 2023 16:11:03 +0200 Subject: [PATCH 182/259] Fix shell_escape of unless command A bug was introduced in 74ea1de22955349598ab01bc530e87d7c754506f . It resulted in an error: ``` Error: /Stage[main]/Java::Config/Exec[create-java-alternatives]: Could not evaluate: Could not find command 'alternatives\' ``` The effective exec was: ```puppet exec{'create-java-alternatives': path => '/usr/bin:/usr/sbin:/bin:/sbi command => ['alternatives', '--install', '/usr/bin/java', 'java', $java::use_java_alternative_path, '20000'], unless => shell_escape("alternatives --display java | grep -q $java::use_java_alternative_path}"), } ``` This errors since the spaces inside the `shell_escape` are also escaped to `\ `. This patch only shell_escapes the external supplied string `java::java_alternative_path` which was I expect the object the exercise. Configuration to trigger the bug, but it should not be hard. ``` class{'java': distribution => 'jdk', java_alternative => '/usr/lib/jvm/java-11-openjdk/bin/java', java_alternative_path => '/usr/lib/jvm/java-11-openjdk/bin/java', java_home => '/usr/lib/jvm/java-11-openjdk/', package => 'java-11-openjdk-devel', version => 'present', } ``` --- manifests/config.pp | 4 ++-- spec/classes/java_spec.rb | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index c94aa6ef..b096b6a3 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -26,12 +26,12 @@ # For the stanard packages java::params needs these added. if $java::use_java_package_name != $java::default_package_name { $command_redhat = ['alternatives', '--install', '/usr/bin/java', 'java', $java::use_java_alternative_path, '20000'] - $unless_redhat = "alternatives --display java | grep -q ${java::use_java_alternative_path}" + $unless_redhat = "alternatives --display java | grep -q ${shell_escape($java::use_java_alternative_path)}" exec { 'create-java-alternatives': path => '/usr/bin:/usr/sbin:/bin:/sbin', command => $command_redhat, - unless => shell_escape($unless_redhat), + unless => $unless_redhat, before => Exec['update-java-alternatives'], } } diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index eb49f88c..35d477aa 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -36,10 +36,24 @@ let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java/jre1.7.0_67/bin/java' } } it { is_expected.to contain_package('java').with_name('jre') } - it { is_expected.to contain_exec('create-java-alternatives').with_command(['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000']) } + it { + is_expected.to contain_exec('create-java-alternatives').with( + { + command: ['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000'], + unless: 'alternatives --display java | grep -q /usr/java/jre1.7.0_67/bin/java', + }, + ) + } it { is_expected.to contain_exec('update-java-alternatives').with_command(['alternatives', '--set', 'java', '/usr/java/jre1.7.0_67/bin/java']) } end + context 'when select Malicious JRE with alternatives for CentOS 6.3' do + let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } + let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java ; rm -rf /etc' } } + + it { is_expected.to contain_exec('create-java-alternatives').with_unless('alternatives --display java | grep -q /usr/java\\ \\;\\ rm\\ -rf\\ /etc') } + end + context 'when select passed value for CentOS 5.3' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.3' }, architecture: 'x86_64' } } } let(:params) { { 'package' => 'jdk', 'java_home' => '/usr/local/lib/jre' } } From a351a26faf056a395ff86b3959e175315e4aafaf Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Wed, 5 Apr 2023 10:49:00 +0100 Subject: [PATCH 183/259] (CONT-844) - Update .sync.yml --- .sync.yml | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/.sync.yml b/.sync.yml index 45e07d0d..28f0f9b0 100644 --- a/.sync.yml +++ b/.sync.yml @@ -16,14 +16,11 @@ spec/spec_helper.rb: unmanaged: false .gitpod.yml: unmanaged: false -.github/workflows/nightly.yml: - unmanaged: false -.github/workflows/pr_test.yml: - unmanaged: false .github/workflows/auto_release.yml: unmanaged: false -.github/workflows/spec.yml: - checks: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop' +.github/workflows/ci.yml: + unmanaged: false +.github/workflows/nightly.yml: unmanaged: false .github/workflows/release.yml: unmanaged: false From fae3edbd7164a53a77a8095b6967e77ebf9b1ea0 Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 31 Mar 2023 17:43:16 +0100 Subject: [PATCH 184/259] (MAINT) PDK Update --- .devcontainer/devcontainer.json | 2 +- Gemfile | 38 ++++++++++++++++----------------- Rakefile | 1 + metadata.json | 4 ++-- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index fe7a8b12..cdd65d22 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -5,7 +5,7 @@ "settings": { "terminal.integrated.profiles.linux": { "bash": { - "path": "bash", + "path": "bash" } } }, diff --git a/Gemfile b/Gemfile index 1881afe1..6886de2a 100644 --- a/Gemfile +++ b/Gemfile @@ -14,31 +14,31 @@ def location_for(place_or_version, fake_version = nil) end group :development do - 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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "voxpupuli-puppet-lint-plugins", '~> 3.1', require: false - gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false - gem "puppetlabs_spec_helper", '>= 3.0.0', '< 5.0.0', require: false - gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false - gem "dependency_checker", '~> 0.2', require: false - gem "parallel_tests", '~> 3.4', require: false - gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false - gem "puppet-debugger", '~> 1.0', require: false + 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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false + gem "puppetlabs_spec_helper", '~> 5.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', require: false + gem "dependency_checker", '~> 0.2', require: false + gem "parallel_tests", '= 3.12.1', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.5', require: false + gem "puppet-debugger", '~> 1.0', require: false gem "rubocop", '= 1.6.1', require: false gem "rubocop-performance", '= 1.9.1', require: false gem "rubocop-rspec", '= 2.0.1', require: false - gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '= 1.15.2', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do gem "puppet_litmus", '<= 0.34.6', require: false, platforms: [:ruby] - gem "serverspec", '~> 2.41', require: false + gem "serverspec", '~> 2.41', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index 2906c15b..0f8754eb 100644 --- a/Rakefile +++ b/Rakefile @@ -43,6 +43,7 @@ end PuppetLint.configuration.send('disable_relative') + if Bundler.rubygems.find_name('github_changelog_generator').any? GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? diff --git a/metadata.json b/metadata.json index 578a1e85..586ceac7 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "2.7.1-0-g9a16c87", - "pdk-version": "2.6.0" + "template-ref": "heads/main-0-gc6d4446", + "pdk-version": "2.7.1" } From 776bbd99265d35389211e9de50c28779c11343b7 Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 31 Mar 2023 17:43:35 +0100 Subject: [PATCH 185/259] (CONT-784) Add Support for Puppet 8 / Drop Support for Puppet 6 --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 586ceac7..ad69c15d 100644 --- a/metadata.json +++ b/metadata.json @@ -77,7 +77,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 6.24.0 < 8.0.0" + "version_requirement": ">= 7.0.0 < 9.0.0" } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", From 680d7a201f278329f63d08d8db4b5c32d835b383 Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 31 Mar 2023 17:44:01 +0100 Subject: [PATCH 186/259] (CONT-784) Unpin puppet_agent --- .fixtures.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index fc5c840f..c675307e 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,9 +3,7 @@ fixtures: 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: - repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' - ref: v4.12.1 + puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' provision: 'https://github.com/puppetlabs/provision.git' symlinks: java: "#{source_dir}" From c3255393c5fbc92390205b11de488916a9944d06 Mon Sep 17 00:00:00 2001 From: david22swan Date: Fri, 31 Mar 2023 17:44:17 +0100 Subject: [PATCH 187/259] (CONT-784) Unpin puppet_litmus --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6886de2a..f1907698 100644 --- a/Gemfile +++ b/Gemfile @@ -37,7 +37,7 @@ group :development do gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do - gem "puppet_litmus", '<= 0.34.6', require: false, platforms: [:ruby] + gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby, :x64_mingw] gem "serverspec", '~> 2.41', require: false end From 8de236e0c55be73cb8a52636b8215ff01116a324 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 12:16:38 +0100 Subject: [PATCH 188/259] (CONT-784) Update Rubocop Versions New Versions: rubocop = 1.48.1 rubocop-performance = 1.16.0 rubocop-rspec = 2.19.0 --- .rubocop.yml | 444 +--------------------------------------------- .rubocop_todo.yml | 201 +++++++++++++++++++++ Gemfile | 6 +- 3 files changed, 210 insertions(+), 441 deletions(-) create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml index 31e8248f..2367276d 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -3,8 +3,11 @@ require: - rubocop-performance - rubocop-rspec AllCops: + NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.5' + ExtraDetails: true + DisplayStyleGuide: true + TargetRubyVersion: '2.7' Include: - "**/*.rb" Exclude: @@ -71,6 +74,7 @@ Style/TrailingCommaInArrayLiteral: Style/SymbolArray: Description: Using percent style obscures symbolic intent of array's contents. EnforcedStyle: brackets +inherit_from: ".rubocop_todo.yml" RSpec/MessageSpies: EnforcedStyle: receive Style/Documentation: @@ -79,441 +83,5 @@ Style/Documentation: - spec/**/* Style/WordArray: EnforcedStyle: brackets -Performance/AncestorsInclude: - Enabled: true -Performance/BigDecimalWithNumericArgument: - Enabled: true -Performance/BlockGivenWithExplicitBlock: - Enabled: true -Performance/CaseWhenSplat: - Enabled: true -Performance/ConstantRegexp: - Enabled: true -Performance/MethodObjectAsBlock: - Enabled: true -Performance/RedundantSortBlock: - Enabled: true -Performance/RedundantStringChars: - Enabled: true -Performance/ReverseFirst: - Enabled: true -Performance/SortReverse: - Enabled: true -Performance/Squeeze: - Enabled: true -Performance/StringInclude: - Enabled: true -Performance/Sum: - Enabled: true -Style/CollectionMethods: - Enabled: true -Style/MethodCalledOnDoEndBlock: - Enabled: true -Style/StringMethods: - Enabled: true -Bundler/InsecureProtocolSource: - Enabled: false -Gemspec/DuplicatedAssignment: - Enabled: false -Gemspec/OrderedDependencies: - Enabled: false -Gemspec/RequiredRubyVersion: - Enabled: false -Gemspec/RubyVersionGlobalsUsage: - Enabled: false -Layout/ArgumentAlignment: - Enabled: false -Layout/BeginEndAlignment: - Enabled: false -Layout/ClosingHeredocIndentation: - Enabled: false -Layout/EmptyComment: - Enabled: false -Layout/EmptyLineAfterGuardClause: - Enabled: false -Layout/EmptyLinesAroundArguments: - Enabled: false -Layout/EmptyLinesAroundAttributeAccessor: - Enabled: false -Layout/EndOfLine: - Enabled: false -Layout/FirstArgumentIndentation: - Enabled: false -Layout/HashAlignment: - Enabled: false -Layout/HeredocIndentation: - Enabled: false -Layout/LeadingEmptyLines: - Enabled: false -Layout/SpaceAroundMethodCallOperator: - Enabled: false -Layout/SpaceInsideArrayLiteralBrackets: - Enabled: false -Layout/SpaceInsideReferenceBrackets: - Enabled: false -Lint/BigDecimalNew: - Enabled: false -Lint/BooleanSymbol: - Enabled: false -Lint/ConstantDefinitionInBlock: - Enabled: false -Lint/DeprecatedOpenSSLConstant: - Enabled: false -Lint/DisjunctiveAssignmentInConstructor: - Enabled: false -Lint/DuplicateElsifCondition: - Enabled: false -Lint/DuplicateRequire: - Enabled: false -Lint/DuplicateRescueException: - Enabled: false -Lint/EmptyConditionalBody: - Enabled: false -Lint/EmptyFile: - Enabled: false -Lint/ErbNewArguments: - Enabled: false -Lint/FloatComparison: - Enabled: false -Lint/HashCompareByIdentity: - Enabled: false -Lint/IdentityComparison: - Enabled: false -Lint/InterpolationCheck: - Enabled: false -Lint/MissingCopEnableDirective: - Enabled: false -Lint/MixedRegexpCaptureTypes: - Enabled: false -Lint/NestedPercentLiteral: - Enabled: false -Lint/NonDeterministicRequireOrder: - Enabled: false -Lint/OrderedMagicComments: - Enabled: false -Lint/OutOfRangeRegexpRef: - Enabled: false -Lint/RaiseException: - Enabled: false -Lint/RedundantCopEnableDirective: - Enabled: false -Lint/RedundantRequireStatement: - Enabled: false -Lint/RedundantSafeNavigation: - Enabled: false -Lint/RedundantWithIndex: - Enabled: false -Lint/RedundantWithObject: - Enabled: false -Lint/RegexpAsCondition: - Enabled: false -Lint/ReturnInVoidContext: - Enabled: false -Lint/SafeNavigationConsistency: - Enabled: false -Lint/SafeNavigationWithEmpty: - Enabled: false -Lint/SelfAssignment: - Enabled: false -Lint/SendWithMixinArgument: - Enabled: false -Lint/ShadowedArgument: - Enabled: false -Lint/StructNewOverride: - Enabled: false -Lint/ToJSON: - Enabled: false -Lint/TopLevelReturnWithArgument: - Enabled: false -Lint/TrailingCommaInAttributeDeclaration: - Enabled: false -Lint/UnreachableLoop: - Enabled: false -Lint/UriEscapeUnescape: - Enabled: false -Lint/UriRegexp: - Enabled: false -Lint/UselessMethodDefinition: - Enabled: false -Lint/UselessTimes: - Enabled: false -Metrics/AbcSize: - Enabled: false -Metrics/BlockLength: - Enabled: false -Metrics/BlockNesting: - Enabled: false -Metrics/ClassLength: - Enabled: false -Metrics/CyclomaticComplexity: - Enabled: false -Metrics/MethodLength: - Enabled: false -Metrics/ModuleLength: - Enabled: false -Metrics/ParameterLists: - Enabled: false -Metrics/PerceivedComplexity: - Enabled: false -Migration/DepartmentName: - Enabled: false -Naming/AccessorMethodName: - Enabled: false -Naming/BlockParameterName: - Enabled: false -Naming/HeredocDelimiterCase: - Enabled: false -Naming/HeredocDelimiterNaming: - Enabled: false -Naming/MemoizedInstanceVariableName: - Enabled: false -Naming/MethodParameterName: - Enabled: false -Naming/RescuedExceptionsVariableName: - Enabled: false -Naming/VariableNumber: - Enabled: false -Performance/BindCall: - Enabled: false -Performance/DeletePrefix: - Enabled: false -Performance/DeleteSuffix: - Enabled: false -Performance/InefficientHashSearch: - Enabled: false -Performance/UnfreezeString: - Enabled: false -Performance/UriDefaultParser: - Enabled: false -RSpec/Be: - Enabled: false -RSpec/Capybara/CurrentPathExpectation: - Enabled: false -RSpec/Capybara/FeatureMethods: - Enabled: false -RSpec/Capybara/VisibilityMatcher: - Enabled: false -RSpec/ContextMethod: - Enabled: false -RSpec/ContextWording: - Enabled: false -RSpec/DescribeClass: - Enabled: false -RSpec/EmptyHook: - Enabled: false -RSpec/EmptyLineAfterExample: - Enabled: false -RSpec/EmptyLineAfterExampleGroup: - Enabled: false -RSpec/EmptyLineAfterHook: - Enabled: false -RSpec/ExampleLength: - Enabled: false -RSpec/ExampleWithoutDescription: - Enabled: false -RSpec/ExpectChange: - Enabled: false -RSpec/ExpectInHook: - Enabled: false -RSpec/FactoryBot/AttributeDefinedStatically: - Enabled: false -RSpec/FactoryBot/CreateList: - Enabled: false -RSpec/FactoryBot/FactoryClassName: - Enabled: false -RSpec/HooksBeforeExamples: - Enabled: false -RSpec/ImplicitBlockExpectation: - Enabled: false -RSpec/ImplicitSubject: - Enabled: false -RSpec/LeakyConstantDeclaration: - Enabled: false -RSpec/LetBeforeExamples: - Enabled: false -RSpec/MissingExampleGroupArgument: - Enabled: false RSpec/MultipleExpectations: - Enabled: false -RSpec/MultipleMemoizedHelpers: - Enabled: false -RSpec/MultipleSubjects: - Enabled: false -RSpec/NestedGroups: - Enabled: false -RSpec/PredicateMatcher: - Enabled: false -RSpec/ReceiveCounts: - Enabled: false -RSpec/ReceiveNever: - Enabled: false -RSpec/RepeatedExampleGroupBody: - Enabled: false -RSpec/RepeatedExampleGroupDescription: - Enabled: false -RSpec/RepeatedIncludeExample: - Enabled: false -RSpec/ReturnFromStub: - Enabled: false -RSpec/SharedExamples: - Enabled: false -RSpec/StubbedMock: - Enabled: false -RSpec/UnspecifiedException: - Enabled: false -RSpec/VariableDefinition: - Enabled: false -RSpec/VoidExpect: - Enabled: false -RSpec/Yield: - Enabled: false -Security/Open: - Enabled: false -Style/AccessModifierDeclarations: - Enabled: false -Style/AccessorGrouping: - Enabled: false -Style/AsciiComments: - Enabled: false -Style/BisectedAttrAccessor: - Enabled: false -Style/CaseLikeIf: - Enabled: false -Style/ClassEqualityComparison: - Enabled: false -Style/ColonMethodDefinition: - Enabled: false -Style/CombinableLoops: - Enabled: false -Style/CommentedKeyword: - Enabled: false -Style/Dir: - Enabled: false -Style/DoubleCopDisableDirective: - Enabled: false -Style/EmptyBlockParameter: - Enabled: false -Style/EmptyLambdaParameter: - Enabled: false -Style/Encoding: - Enabled: false -Style/EvalWithLocation: - Enabled: false -Style/ExpandPathArguments: - Enabled: false -Style/ExplicitBlockArgument: - Enabled: false -Style/ExponentialNotation: - Enabled: false -Style/FloatDivision: - Enabled: false -Style/FrozenStringLiteralComment: - Enabled: false -Style/GlobalStdStream: - Enabled: false -Style/HashAsLastArrayItem: - Enabled: false -Style/HashLikeCase: - Enabled: false -Style/HashTransformKeys: - Enabled: false -Style/HashTransformValues: - Enabled: false -Style/IfUnlessModifier: - Enabled: false -Style/KeywordParametersOrder: - Enabled: false -Style/MinMax: - Enabled: false -Style/MixinUsage: - Enabled: false -Style/MultilineWhenThen: - Enabled: false -Style/NegatedUnless: - Enabled: false -Style/NumericPredicate: - Enabled: false -Style/OptionalBooleanParameter: - Enabled: false -Style/OrAssignment: - Enabled: false -Style/RandomWithOffset: - Enabled: false -Style/RedundantAssignment: - Enabled: false -Style/RedundantCondition: - Enabled: false -Style/RedundantConditional: - Enabled: false -Style/RedundantFetchBlock: - Enabled: false -Style/RedundantFileExtensionInRequire: - Enabled: false -Style/RedundantRegexpCharacterClass: - Enabled: false -Style/RedundantRegexpEscape: - Enabled: false -Style/RedundantSelfAssignment: - Enabled: false -Style/RedundantSort: - Enabled: false -Style/RescueStandardError: - Enabled: false -Style/SingleArgumentDig: - Enabled: false -Style/SlicingWithRange: - Enabled: false -Style/SoleNestedConditional: - Enabled: false -Style/StderrPuts: - Enabled: false -Style/StringConcatenation: - Enabled: false -Style/Strip: - Enabled: false -Style/SymbolProc: - Enabled: false -Style/TrailingBodyOnClass: - Enabled: false -Style/TrailingBodyOnMethodDefinition: - Enabled: false -Style/TrailingBodyOnModule: - Enabled: false -Style/TrailingCommaInHashLiteral: - Enabled: false -Style/TrailingMethodEndStatement: - Enabled: false -Style/UnpackFirst: - Enabled: false -Lint/DuplicateBranch: - Enabled: false -Lint/DuplicateRegexpCharacterClassElement: - Enabled: false -Lint/EmptyBlock: - Enabled: false -Lint/EmptyClass: - Enabled: false -Lint/NoReturnInBeginEndBlocks: - Enabled: false -Lint/ToEnumArguments: - Enabled: false -Lint/UnexpectedBlockArity: - Enabled: false -Lint/UnmodifiedReduceAccumulator: - Enabled: false -Performance/CollectionLiteralInLoop: - Enabled: false -Style/ArgumentsForwarding: - Enabled: false -Style/CollectionCompact: - Enabled: false -Style/DocumentDynamicEvalDefinition: - Enabled: false -Style/NegatedIfElseCondition: - Enabled: false -Style/NilLambda: - Enabled: false -Style/RedundantArgument: - Enabled: false -Style/SwapValues: - Enabled: false + Max: 3 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 00000000..129b1735 --- /dev/null +++ b/.rubocop_todo.yml @@ -0,0 +1,201 @@ +# This configuration was generated by +# `rubocop --auto-gen-config` +# on 2023-04-17 11:16:28 UTC using RuboCop version 1.48.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Layout/EmptyLineAfterGuardClause: + Exclude: + - 'spec/unit/facter/java_default_home_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses +Layout/FirstArgumentIndentation: + Exclude: + - 'spec/classes/java_spec.rb' + +# Offense count: 4 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. +# SupportedHashRocketStyles: key, separator, table +# SupportedColonStyles: key, separator, table +# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit +Layout/HashAlignment: + Exclude: + - 'spec/classes/java_spec.rb' + +# Offense count: 12 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: leading, trailing +Layout/LineContinuationLeadingSpace: + Exclude: + - 'spec/acceptance/install_spec.rb' + +# Offense count: 27 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AutoCorrect, EnforcedStyle. +# SupportedStyles: space, no_space +Layout/LineContinuationSpacing: + Exclude: + - 'spec/acceptance/install_spec.rb' + - 'spec/unit/facter/java_version_spec.rb' + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle, IndentationWidth. +# SupportedStyles: aligned, indented +Layout/LineEndStringConcatenationIndentation: + Exclude: + - 'spec/acceptance/install_spec.rb' + +# Offense count: 12 +# Configuration parameters: ForbiddenDelimiters. +# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) +Naming/HeredocDelimiterNaming: + Exclude: + - 'spec/acceptance/install_spec.rb' + - 'spec/defines/adopt_spec.rb' + - 'spec/defines/adoptium_spec.rb' + - 'spec/defines/sap_spec.rb' + +# Offense count: 1 +# This cop supports unsafe autocorrection (--autocorrect-all). +Performance/StringInclude: + Exclude: + - 'lib/facter/java_default_home.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: be, be_nil +RSpec/BeNil: + Exclude: + - 'spec/unit/facter/java_libjvm_path_spec.rb' + +# Offense count: 8 +# Configuration parameters: Prefixes, AllowedPatterns. +# Prefixes: when, with, without +RSpec/ContextWording: + Exclude: + - 'spec/acceptance/install_spec.rb' + - 'spec/unit/facter/java_version_spec.rb' + +# Offense count: 11 +# Configuration parameters: IgnoredMetadata. +RSpec/DescribeClass: + Exclude: + - '**/spec/features/**/*' + - '**/spec/requests/**/*' + - '**/spec/routing/**/*' + - '**/spec/system/**/*' + - '**/spec/views/**/*' + - 'spec/acceptance/install_spec.rb' + - 'spec/classes/java_spec.rb' + - 'spec/defines/adopt_spec.rb' + - 'spec/defines/adoptium_spec.rb' + - 'spec/defines/download_spec.rb' + - 'spec/defines/sap_spec.rb' + - 'spec/unit/facter/java_default_home_spec.rb' + - 'spec/unit/facter/java_libjvm_path_spec.rb' + - 'spec/unit/facter/java_major_version_spec.rb' + - 'spec/unit/facter/java_patch_level_spec.rb' + - 'spec/unit/facter/java_version_spec.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterExample: + Exclude: + - 'spec/classes/java_spec.rb' + +# Offense count: 11 +# This cop supports safe autocorrection (--autocorrect). +RSpec/EmptyLineAfterExampleGroup: + Exclude: + - 'spec/classes/java_spec.rb' + - 'spec/defines/adopt_spec.rb' + - 'spec/defines/adoptium_spec.rb' + - 'spec/defines/sap_spec.rb' + - 'spec/unit/facter/java_version_spec.rb' + +# Offense count: 10 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: AllowConsecutiveOneLiners. +RSpec/EmptyLineAfterHook: + Exclude: + - 'spec/unit/facter/java_major_version_spec.rb' + - 'spec/unit/facter/java_patch_level_spec.rb' + - 'spec/unit/facter/java_version_spec.rb' + +# Offense count: 1 +# Configuration parameters: CountAsOne. +RSpec/ExampleLength: + Max: 6 + +# Offense count: 3 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: single_line_only, single_statement_only, disallow, require_implicit +RSpec/ImplicitSubject: + Exclude: + - 'spec/classes/java_spec.rb' + - 'spec/defines/download_spec.rb' + +# Offense count: 12 +# Configuration parameters: AllowedPatterns. +# AllowedPatterns: ^expect_, ^assert_ +RSpec/NoExpectationExample: + Exclude: + - 'spec/acceptance/install_spec.rb' + - 'spec/unit/facter/java_default_home_spec.rb' + +# Offense count: 8 +RSpec/StubbedMock: + Exclude: + - 'spec/unit/facter/java_default_home_spec.rb' + - 'spec/unit/facter/java_version_spec.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +Style/IfUnlessModifier: + Exclude: + - 'spec/unit/facter/java_default_home_spec.rb' + +# Offense count: 1 +Style/MixinUsage: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 2 +# This cop supports safe autocorrection (--autocorrect). +Style/RedundantRegexpEscape: + Exclude: + - 'lib/facter/java_version.rb' + +# Offense count: 1 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: implicit, explicit +Style/RescueStandardError: + Exclude: + - 'spec/spec_helper.rb' + +# Offense count: 100 +# This cop supports safe autocorrection (--autocorrect). +# Configuration parameters: EnforcedStyleForMultiline. +# SupportedStylesForMultiline: comma, consistent_comma, no_comma +Style/TrailingCommaInHashLiteral: + Exclude: + - 'spec/classes/java_spec.rb' + - 'spec/defines/adopt_spec.rb' + - 'spec/defines/adoptium_spec.rb' + - 'spec/defines/download_spec.rb' + - 'spec/defines/sap_spec.rb' + - 'spec/spec_helper.rb' diff --git a/Gemfile b/Gemfile index f1907698..3f6f5c7d 100644 --- a/Gemfile +++ b/Gemfile @@ -30,9 +30,9 @@ group :development do gem "pry", '~> 0.10', require: false gem "simplecov-console", '~> 0.5', require: false gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.6.1', require: false - gem "rubocop-performance", '= 1.9.1', require: false - gem "rubocop-rspec", '= 2.0.1', require: false + gem "rubocop", '= 1.48.1', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "github_changelog_generator", '= 1.15.2', require: false end From 6f30dbedbfb357d21927b755e7af3eace6911424 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 12:30:30 +0100 Subject: [PATCH 189/259] (CONT-784) Rubocop Auto Fixes 1-5 - Layout/EmptyLineAfterGuardClause - Layout/FirstArgumentIndentation - Layout/HashAlignment - Layout/LineContinuationLeadingSpace - Layout/LineContinuationSpacing --- .rubocop_todo.yml | 41 --------------------- spec/acceptance/install_spec.rb | 42 +++++++++++----------- spec/classes/java_spec.rb | 18 +++++----- spec/unit/facter/java_default_home_spec.rb | 1 + spec/unit/facter/java_version_spec.rb | 12 +++---- 5 files changed, 37 insertions(+), 77 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 129b1735..16508ce5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,47 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Layout/EmptyLineAfterGuardClause: - Exclude: - - 'spec/unit/facter/java_default_home_spec.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses -Layout/FirstArgumentIndentation: - Exclude: - - 'spec/classes/java_spec.rb' - -# Offense count: 4 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle. -# SupportedHashRocketStyles: key, separator, table -# SupportedColonStyles: key, separator, table -# SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit -Layout/HashAlignment: - Exclude: - - 'spec/classes/java_spec.rb' - -# Offense count: 12 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: leading, trailing -Layout/LineContinuationLeadingSpace: - Exclude: - - 'spec/acceptance/install_spec.rb' - -# Offense count: 27 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AutoCorrect, EnforcedStyle. -# SupportedStyles: space, no_space -Layout/LineContinuationSpacing: - Exclude: - - 'spec/acceptance/install_spec.rb' - - 'spec/unit/facter/java_version_spec.rb' - # Offense count: 3 # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: EnforcedStyle, IndentationWidth. diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 3dd4cb91..0c03ea58 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -3,45 +3,45 @@ require 'spec_helper_acceptance' require 'pry' -java_class_jre = "class { 'java':\n"\ - " distribution => 'jre',\n"\ +java_class_jre = "class { 'java':\n " \ + "distribution => 'jre',\n" \ '}' java_class = "class { 'java': }" -_sources = "file_line { 'non-free source':\n"\ - " path => '/etc/apt/sources.list',\n"\ - " match => \"deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main\",\n"\ - " line => \"deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main non-free\",\n"\ +_sources = "file_line { 'non-free source':\n " \ + "path => '/etc/apt/sources.list',\n " \ + "match => \"deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main\",\n " \ + "line => \"deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main non-free\",\n" \ '}' -_sun_jre = "class { 'java':\n"\ - " distribution => 'sun-jre',\n"\ +_sun_jre = "class { 'java':\n " \ + "distribution => 'sun-jre',\n" \ '}' -_sun_jdk = "class { 'java':\n"\ - " distribution => 'sun-jdk',\n"\ +_sun_jdk = "class { 'java':\n " \ + "distribution => 'sun-jdk',\n" \ '}' -blank_version = "class { 'java':\n"\ - " version => '',\n"\ +blank_version = "class { 'java':\n " \ + "version => '',\n" \ '}' -incorrect_distro = "class { 'java':\n"\ - " distribution => 'xyz',\n"\ +incorrect_distro = "class { 'java':\n " \ + "distribution => 'xyz',\n" \ '}' -blank_distro = "class { 'java':\n"\ - " distribution => '',\n"\ +blank_distro = "class { 'java':\n " \ + "distribution => '',\n" \ '}' -incorrect_package = "class { 'java':\n"\ - " package => 'xyz',\n"\ +incorrect_package = "class { 'java':\n " \ + "package => 'xyz',\n" \ '}' -bogus_alternative = "class { 'java':\n"\ - " java_alternative => 'whatever',\n"\ - " java_alternative_path => '/whatever',\n"\ +bogus_alternative = "class { 'java':\n " \ + "java_alternative => 'whatever',\n " \ + "java_alternative_path => '/whatever',\n" \ '}' # Oracle installs are disabled by default, because the links to valid oracle installations diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 35d477aa..b7834cb0 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -38,11 +38,11 @@ it { is_expected.to contain_package('java').with_name('jre') } it { is_expected.to contain_exec('create-java-alternatives').with( - { - command: ['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000'], - unless: 'alternatives --display java | grep -q /usr/java/jre1.7.0_67/bin/java', - }, - ) + { + command: ['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000'], + unless: 'alternatives --display java | grep -q /usr/java/jre1.7.0_67/bin/java', + }, + ) } it { is_expected.to contain_exec('update-java-alternatives').with_command(['alternatives', '--set', 'java', '/usr/java/jre1.7.0_67/bin/java']) } end @@ -177,11 +177,11 @@ context 'when all params provided' do let(:params) do { - 'distribution' => 'custom', - 'package' => 'custom_jdk', - 'java_alternative' => 'java-custom_jdk', + 'distribution' => 'custom', + 'package' => 'custom_jdk', + 'java_alternative' => 'java-custom_jdk', 'java_alternative_path' => '/opt/custom_jdk/bin/java', - 'java_home' => '/opt/custom_jdk', + 'java_home' => '/opt/custom_jdk', } end diff --git a/spec/unit/facter/java_default_home_spec.rb b/spec/unit/facter/java_default_home_spec.rb index af0841f6..f6032ef7 100644 --- a/spec/unit/facter/java_default_home_spec.rb +++ b/spec/unit/facter/java_default_home_spec.rb @@ -12,6 +12,7 @@ def unlink_and_delete(filename) File.unlink(filename) end return unless File.exist?(filename) + File.delete(filename) end diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index d65097c0..f0375ff7 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -2,14 +2,14 @@ require 'spec_helper' -openjdk_7_output = "Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true\n"\ - "openjdk version \"1.7.0_71\"\n"\ - "OpenJDK Runtime Environment (build 1.7.0_71-b14)\n"\ +openjdk_7_output = "Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true\n" \ + "openjdk version \"1.7.0_71\"\n" \ + "OpenJDK Runtime Environment (build 1.7.0_71-b14)\n" \ "OpenJDK 64-Bit Server VM (build 24.71-b01, mixed mode)\n" -jdk_7_hotspot_output = "Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true\n"\ - "java version \"1.7.0_71\"\n"\ - "Java(TM) SE Runtime Environment (build 1.7.0_71-b14)\n"\ +jdk_7_hotspot_output = "Picked up JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true\n" \ + "java version \"1.7.0_71\"\n" \ + "Java(TM) SE Runtime Environment (build 1.7.0_71-b14)\n" \ "Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)\n" describe 'java_version' do From 9484496f6e18fca37fe2a554dc3c083ec0ec64b4 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 12:34:24 +0100 Subject: [PATCH 190/259] (CONT-784) Rubocop Auto Fixes 6-10 - Layout/LineEndStringConcatenationIndentation - RSpec/BeNil - RSpec/EmptyLineAfterExample - RSpec/EmptyLineAfterExampleGroup - RSpec/EmptyLineAfterHook --- .rubocop_todo.yml | 42 --------------------- spec/acceptance/install_spec.rb | 16 ++++---- spec/classes/java_spec.rb | 3 ++ spec/defines/adopt_spec.rb | 2 + spec/defines/adoptium_spec.rb | 2 + spec/defines/sap_spec.rb | 2 + spec/unit/facter/java_libjvm_path_spec.rb | 2 +- spec/unit/facter/java_major_version_spec.rb | 2 + spec/unit/facter/java_patch_level_spec.rb | 2 + spec/unit/facter/java_version_spec.rb | 10 +++++ 10 files changed, 32 insertions(+), 51 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 16508ce5..90456554 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,14 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle, IndentationWidth. -# SupportedStyles: aligned, indented -Layout/LineEndStringConcatenationIndentation: - Exclude: - - 'spec/acceptance/install_spec.rb' - # Offense count: 12 # Configuration parameters: ForbiddenDelimiters. # ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) @@ -30,14 +22,6 @@ Performance/StringInclude: Exclude: - 'lib/facter/java_default_home.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: be, be_nil -RSpec/BeNil: - Exclude: - - 'spec/unit/facter/java_libjvm_path_spec.rb' - # Offense count: 8 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without @@ -67,32 +51,6 @@ RSpec/DescribeClass: - 'spec/unit/facter/java_patch_level_spec.rb' - 'spec/unit/facter/java_version_spec.rb' -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowConsecutiveOneLiners. -RSpec/EmptyLineAfterExample: - Exclude: - - 'spec/classes/java_spec.rb' - -# Offense count: 11 -# This cop supports safe autocorrection (--autocorrect). -RSpec/EmptyLineAfterExampleGroup: - Exclude: - - 'spec/classes/java_spec.rb' - - 'spec/defines/adopt_spec.rb' - - 'spec/defines/adoptium_spec.rb' - - 'spec/defines/sap_spec.rb' - - 'spec/unit/facter/java_version_spec.rb' - -# Offense count: 10 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: AllowConsecutiveOneLiners. -RSpec/EmptyLineAfterHook: - Exclude: - - 'spec/unit/facter/java_major_version_spec.rb' - - 'spec/unit/facter/java_patch_level_spec.rb' - - 'spec/unit/facter/java_version_spec.rb' - # Offense count: 1 # Configuration parameters: CountAsOne. RSpec/ExampleLength: diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 0c03ea58..863738c2 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -10,18 +10,18 @@ java_class = "class { 'java': }" _sources = "file_line { 'non-free source':\n " \ - "path => '/etc/apt/sources.list',\n " \ - "match => \"deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main\",\n " \ - "line => \"deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main non-free\",\n" \ - '}' + "path => '/etc/apt/sources.list',\n " \ + "match => \"deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main\",\n " \ + "line => \"deb http://osmirror.delivery.puppetlabs.net/debian/ ${::lsbdistcodename} main non-free\",\n" \ + '}' _sun_jre = "class { 'java':\n " \ - "distribution => 'sun-jre',\n" \ - '}' + "distribution => 'sun-jre',\n" \ + '}' _sun_jdk = "class { 'java':\n " \ - "distribution => 'sun-jdk',\n" \ - '}' + "distribution => 'sun-jdk',\n" \ + '}' blank_version = "class { 'java':\n " \ "version => '',\n" \ diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index b7834cb0..180d2516 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -36,6 +36,7 @@ let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java/jre1.7.0_67/bin/java' } } it { is_expected.to contain_package('java').with_name('jre') } + it { is_expected.to contain_exec('create-java-alternatives').with( { @@ -44,6 +45,7 @@ }, ) } + it { is_expected.to contain_exec('update-java-alternatives').with_command(['alternatives', '--set', 'java', '/usr/java/jre1.7.0_67/bin/java']) } end @@ -189,6 +191,7 @@ it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/opt/custom_jdk') } it { is_expected.to contain_exec('update-java-alternatives').with_command(['update-java-alternatives', '--set', 'java-custom_jdk', '--jre']) } end + context 'with missing parameters' do let(:params) do { diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index 6cc959da..c6d0035b 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -161,6 +161,7 @@ it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').with_command(['tar', '-zxf', '/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install AdoptOpenJDK java jdk 8 8u202 b08').that_requires('Archive[/tmp/OpenJDK8U-jdk_x64_linux_hotspot_8u202b08.tar.gz]') } end + context 'when manage_basedir is set to true' do let(:params) do { @@ -296,6 +297,7 @@ it { is_expected.to compile } end end + describe 'incompatible OSes' do [ { diff --git a/spec/defines/adoptium_spec.rb b/spec/defines/adoptium_spec.rb index f9f82a1e..968e9627 100644 --- a/spec/defines/adoptium_spec.rb +++ b/spec/defines/adoptium_spec.rb @@ -124,6 +124,7 @@ it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command(['tar', '-zxf', '/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz', '-C', '/usr/java']) } it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } end + context 'when manage_basedir is set to true' do let(:params) do { @@ -226,6 +227,7 @@ it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').with_command(['tar', '-zxf', '/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz', '-C', '/usr/lib/jvm']) } it { is_expected.to contain_exec('Install Adoptium Temurin java 16 0 2 7').that_requires('Archive[/tmp/OpenJDK16U-jdk_x64_linux_hotspot_16.0.2_7.tar.gz]') } end + context 'when manage_basedir is set to true' do let(:params) do { diff --git a/spec/defines/sap_spec.rb b/spec/defines/sap_spec.rb index 97f23076..815c81aa 100644 --- a/spec/defines/sap_spec.rb +++ b/spec/defines/sap_spec.rb @@ -108,6 +108,7 @@ 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 { @@ -193,6 +194,7 @@ it { is_expected.to compile } end end + describe 'incompatible OSes' do [ { diff --git a/spec/unit/facter/java_libjvm_path_spec.rb b/spec/unit/facter/java_libjvm_path_spec.rb index dde5aa51..585dafa4 100644 --- a/spec/unit/facter/java_libjvm_path_spec.rb +++ b/spec/unit/facter/java_libjvm_path_spec.rb @@ -22,7 +22,7 @@ context 'when libjvm does not exist' do it do allow(Dir).to receive(:glob).with("#{java_default_home}/lib/**/libjvm.so").and_return([]) - expect(Facter.value(:java_libjvm_path)).to be nil + expect(Facter.value(:java_libjvm_path)).to be_nil end end end diff --git a/spec/unit/facter/java_major_version_spec.rb b/spec/unit/facter/java_major_version_spec.rb index 62a3df7d..2260f41f 100644 --- a/spec/unit/facter/java_major_version_spec.rb +++ b/spec/unit/facter/java_major_version_spec.rb @@ -11,6 +11,7 @@ before :each do allow(Facter.fact(:java_version)).to receive(:value).and_return('1.7.0_71') end + it do expect(Facter.fact(:java_major_version).value).to eq('7') end @@ -20,6 +21,7 @@ before :each do allow(Facter.fact(:java_version)).to receive(:value).and_return(nil) end + it do expect(Facter.fact(:java_major_version).value).to be_nil end diff --git a/spec/unit/facter/java_patch_level_spec.rb b/spec/unit/facter/java_patch_level_spec.rb index 216fdec2..a8d66ca9 100644 --- a/spec/unit/facter/java_patch_level_spec.rb +++ b/spec/unit/facter/java_patch_level_spec.rb @@ -11,6 +11,7 @@ before :each do allow(Facter.fact(:java_version)).to receive(:value).and_return('1.7.0_71') end + it do expect(Facter.fact(:java_patch_level).value).to eq('71') end @@ -20,6 +21,7 @@ before :each do allow(Facter.fact(:java_version)).to receive(:value).and_return('nil') end + it do expect(Facter.fact(:java_patch_level).value).to be_nil end diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index f0375ff7..9ece9b61 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -23,6 +23,7 @@ allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('OpenBSD') allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') end + let(:facts) { { operatingsystem: 'OpenBSD' } } it do @@ -31,10 +32,12 @@ expect(Facter.value(:java_version)).to eq('1.7.0_71') end end + context 'when on Darwin' do before(:each) do allow(Facter.fact(:kernel)).to receive(:value).and_return('Darwin') end + let(:facts) { { kernel: 'Darwin' } } it do @@ -43,11 +46,13 @@ expect(Facter.value(:java_version)).to eq('1.7.0_71') end end + context 'when on other systems' do before(:each) do allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('MyOS') allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') end + let(:facts) { { operatingsystem: 'MyOS' } } it do @@ -64,6 +69,7 @@ allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('OpenBSD') allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') end + let(:facts) { { operatingsystem: 'OpenBSD' } } it do @@ -72,10 +78,12 @@ expect(Facter.value(:java_version)).to be_nil end end + context 'when on Darwin' do before(:each) do allow(Facter.fact(:kernel)).to receive(:value).and_return('Darwin') end + let(:facts) { { kernel: 'Darwin' } } it do @@ -83,11 +91,13 @@ expect(Facter.value(:java_version)).to be_nil end end + context 'when on other systems' do before(:each) do allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('MyOS') allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') end + let(:facts) { { operatingsystem: 'MyOS' } } it do From eac2c20a3101c5148cf00fc0a6e76a93f8ee0472 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 13:30:23 +0100 Subject: [PATCH 191/259] (CONT-784) Rubocop Auto Fixes 11-15 - RSpec/ImplicitSubject - Style/IfUnlessModifier - Style/RedundantRegexpEscape - Style/RescueStandardError - Style/TrailingCommaInHashLiteral --- .rubocop_todo.yml | 42 ++--------------- lib/facter/java_version.rb | 2 +- spec/classes/java_spec.rb | 28 +++++------ spec/defines/adopt_spec.rb | 40 ++++++++-------- spec/defines/adoptium_spec.rb | 54 +++++++++++----------- spec/defines/download_spec.rb | 42 ++++++++--------- spec/defines/sap_spec.rb | 40 ++++++++-------- spec/spec_helper.rb | 4 +- spec/unit/facter/java_default_home_spec.rb | 4 +- 9 files changed, 110 insertions(+), 146 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 90456554..66066be1 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-04-17 11:16:28 UTC using RuboCop version 1.48.1. +# on 2023-04-17 12:22:29 UTC using RuboCop version 1.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -57,10 +57,9 @@ RSpec/ExampleLength: Max: 6 # Offense count: 3 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: single_line_only, single_statement_only, disallow, require_implicit -RSpec/ImplicitSubject: +# Configuration parameters: EnforcedStyle, IgnoreSharedExamples. +# SupportedStyles: always, named_only +RSpec/NamedSubject: Exclude: - 'spec/classes/java_spec.rb' - 'spec/defines/download_spec.rb' @@ -79,40 +78,7 @@ RSpec/StubbedMock: - 'spec/unit/facter/java_default_home_spec.rb' - 'spec/unit/facter/java_version_spec.rb' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Style/IfUnlessModifier: - Exclude: - - 'spec/unit/facter/java_default_home_spec.rb' - # Offense count: 1 Style/MixinUsage: Exclude: - 'spec/spec_helper.rb' - -# Offense count: 2 -# This cop supports safe autocorrection (--autocorrect). -Style/RedundantRegexpEscape: - Exclude: - - 'lib/facter/java_version.rb' - -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: implicit, explicit -Style/RescueStandardError: - Exclude: - - 'spec/spec_helper.rb' - -# Offense count: 100 -# This cop supports safe autocorrection (--autocorrect). -# Configuration parameters: EnforcedStyleForMultiline. -# SupportedStylesForMultiline: comma, consistent_comma, no_comma -Style/TrailingCommaInHashLiteral: - Exclude: - - 'spec/classes/java_spec.rb' - - 'spec/defines/adopt_spec.rb' - - 'spec/defines/adoptium_spec.rb' - - 'spec/defines/download_spec.rb' - - 'spec/defines/sap_spec.rb' - - 'spec/spec_helper.rb' diff --git a/lib/facter/java_version.rb b/lib/facter/java_version.rb index 8c0c02c5..241d8760 100644 --- a/lib/facter/java_version.rb +++ b/lib/facter/java_version.rb @@ -22,6 +22,6 @@ elsif Facter::Core::Execution.which('java') version = Facter::Core::Execution.execute('java -Xmx12m -version 2>&1').lines.find { |line| line.include?('version') } end - version[%r{\"(.*?)\"}, 1] if version + version[%r{"(.*?)"}, 1] if version end end diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 180d2516..f049a2eb 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -38,10 +38,10 @@ it { is_expected.to contain_package('java').with_name('jre') } it { - is_expected.to contain_exec('create-java-alternatives').with( + expect(subject).to contain_exec('create-java-alternatives').with( { command: ['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000'], - unless: 'alternatives --display java | grep -q /usr/java/jre1.7.0_67/bin/java', + unless: 'alternatives --display java | grep -q /usr/java/jre1.7.0_67/bin/java' }, ) } @@ -183,7 +183,7 @@ 'package' => 'custom_jdk', 'java_alternative' => 'java-custom_jdk', 'java_alternative_path' => '/opt/custom_jdk/bin/java', - 'java_home' => '/opt/custom_jdk', + 'java_home' => '/opt/custom_jdk' } end @@ -196,7 +196,7 @@ let(:params) do { 'distribution' => 'custom', - 'package' => 'custom_jdk', + 'package' => 'custom_jdk' } end @@ -212,36 +212,36 @@ os: { family: 'windows', name: 'windows', - release: { full: '8.1' }, - }, + release: { full: '8.1' } + } }, { os: { family: 'Darwin', name: 'Darwin', - release: { full: '13.3.0' }, - }, + release: { full: '13.3.0' } + } }, { os: { family: 'AIX', name: 'AIX', - release: { full: '7100-02-00-000' }, - }, + release: { full: '7100-02-00-000' } + } }, { os: { family: 'AIX', name: 'AIX', - release: { full: '6100-07-04-1216' }, - }, + release: { full: '6100-07-04-1216' } + } }, { os: { family: 'AIX', name: 'AIX', - release: { full: '5300-12-01-1016' }, - }, + release: { full: '5300-12-01-1016' } + } }, ].each do |facts| let(:facts) { facts } diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index c6d0035b..6d725b54 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -14,7 +14,7 @@ java: 'jdk', basedir: '/usr/java', manage_symlink: true, - symlink_name: 'java_home', + symlink_name: 'java_home' } end let(:title) { 'jdk11_symlink' } @@ -125,7 +125,7 @@ ensure: 'present', version_major: '8u202', version_minor: 'b08', - java: 'jdk', + java: 'jdk' } end let(:title) { 'jdk8' } @@ -152,7 +152,7 @@ version: '8', java: 'jdk', basedir: '/usr/java', - package_type: 'tar.gz', + package_type: 'tar.gz' } end let(:title) { 'jdk8' } @@ -169,7 +169,7 @@ version: '8', java: 'jdk', basedir: '/usr/java', - manage_basedir: true, + manage_basedir: true } end let(:title) { 'jdk8' } @@ -277,7 +277,7 @@ ensure: 'present', version_major: '8u202', version_minor: 'b08', - java: 'jdk', + java: 'jdk' } end let(:title) { 'jdk8' } @@ -306,9 +306,9 @@ family: 'Windows', name: 'Windows', release: { - full: '8.1', - }, - }, + full: '8.1' + } + } }, { kernel: 'Darwin', @@ -316,9 +316,9 @@ family: 'Darwin', name: 'Darwin', release: { - full: '13.3.0', - }, - }, + full: '13.3.0' + } + } }, { kernel: 'AIX', @@ -326,9 +326,9 @@ family: 'AIX', name: 'AIX', release: { - full: '7100-02-00-000', - }, - }, + full: '7100-02-00-000' + } + } }, { kernel: 'AIX', @@ -336,9 +336,9 @@ family: 'AIX', name: 'AIX', release: { - full: '6100-07-04-1216', - }, - }, + full: '6100-07-04-1216' + } + } }, { kernel: 'AIX', @@ -346,9 +346,9 @@ family: 'AIX', name: 'AIX', release: { - full: '5300-12-01-1016', - }, - }, + full: '5300-12-01-1016' + } + } }, ].each do |facts| let(:facts) { facts } diff --git a/spec/defines/adoptium_spec.rb b/spec/defines/adoptium_spec.rb index 968e9627..1ce7a192 100644 --- a/spec/defines/adoptium_spec.rb +++ b/spec/defines/adoptium_spec.rb @@ -16,7 +16,7 @@ version_build: '7', basedir: '/usr/java', manage_symlink: true, - symlink_name: 'java_home', + symlink_name: 'java_home' } end let(:title) { 'jdk16_symlink' } @@ -33,7 +33,7 @@ version_patch: '2', version_build: '7', basedir: '/usr/java', - symlink_name: 'java_home', + symlink_name: 'java_home' } end let(:title) { 'jdk16_nosymlink' } @@ -50,7 +50,7 @@ version_patch: '2', version_build: '7', basedir: '/usr/java', - symlink_name: 'java_home', + symlink_name: 'java_home' } end let(:title) { 'jdk16' } @@ -69,7 +69,7 @@ version_patch: '1', version_build: '12', basedir: '/usr/java', - symlink_name: 'java_home', + symlink_name: 'java_home' } end let(:title) { 'jdk17' } @@ -86,7 +86,7 @@ version_major: '16', version_minor: '0', version_patch: '2', - version_build: '7', + version_build: '7' } end let(:title) { 'jdk16' } @@ -115,7 +115,7 @@ version_minor: '0', version_patch: '2', version_build: '7', - basedir: '/usr/java', + basedir: '/usr/java' } end let(:title) { 'jdk16' } @@ -134,7 +134,7 @@ version_patch: '2', version_build: '7', basedir: '/usr/java', - manage_basedir: true, + manage_basedir: true } end let(:title) { 'jdk16' } @@ -154,7 +154,7 @@ version_minor: '0', version_patch: '2', version_build: '7', - symlink_name: 'java_home', + symlink_name: 'java_home' } end let(:title) { 'jdk16' } @@ -172,7 +172,7 @@ version_minor: '0', version_patch: '1', version_build: '12', - symlink_name: 'java_home', + symlink_name: 'java_home' } end let(:title) { 'jdk17' } @@ -189,7 +189,7 @@ version_major: '16', version_minor: '0', version_patch: '2', - version_build: '7', + version_build: '7' } end let(:title) { 'jdk16' } @@ -218,7 +218,7 @@ version_minor: '0', version_patch: '2', version_build: '7', - basedir: '/usr/lib/jvm', + basedir: '/usr/lib/jvm' } end let(:title) { 'jdk16' } @@ -237,7 +237,7 @@ version_patch: '2', version_build: '7', basedir: '/usr/lib/jvm', - manage_basedir: true, + manage_basedir: true } end let(:title) { 'jdk16' } @@ -254,9 +254,9 @@ family: 'Windows', name: 'Windows', release: { - full: '8.1', - }, - }, + full: '8.1' + } + } }, { kernel: 'Darwin', @@ -264,9 +264,9 @@ family: 'Darwin', name: 'Darwin', release: { - full: '13.3.0', - }, - }, + full: '13.3.0' + } + } }, { kernel: 'AIX', @@ -274,9 +274,9 @@ family: 'AIX', name: 'AIX', release: { - full: '7100-02-00-000', - }, - }, + full: '7100-02-00-000' + } + } }, { kernel: 'AIX', @@ -284,9 +284,9 @@ family: 'AIX', name: 'AIX', release: { - full: '6100-07-04-1216', - }, - }, + full: '6100-07-04-1216' + } + } }, { kernel: 'AIX', @@ -294,9 +294,9 @@ family: 'AIX', name: 'AIX', release: { - full: '5300-12-01-1016', - }, - }, + full: '5300-12-01-1016' + } + } }, ].each do |facts| let(:facts) { facts } diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index f2b0c286..42a4f4d0 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -15,13 +15,13 @@ version_major: '8u201', version_minor: 'b09', java_se: 'jdk', - url: url, + url: url } end let(:title) { 'jdk8' } it { - is_expected.to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.rpm') + expect(subject).to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.rpm') } end @@ -31,13 +31,13 @@ ensure: 'present', version_major: '8u201', version_minor: 'b09', - java_se: 'jdk', + java_se: 'jdk' } end let(:title) { 'jdk8' } it { - is_expected.to raise_error Puppet::Error + expect(subject).to raise_error Puppet::Error } end @@ -50,7 +50,7 @@ basedir: '/usr/java', manage_symlink: true, symlink_name: 'java_home', - url: url, + url: url } end let(:title) { 'jdk6' } @@ -65,7 +65,7 @@ version: '6', java_se: 'jdk', basedir: '/usr/java', - url: url, + url: url } end let(:title) { 'jdk6_nosymlink' } @@ -104,9 +104,9 @@ family: 'Windows', name: 'Windows', release: { - full: '8.1', - }, - }, + full: '8.1' + } + } }, { kernel: 'Darwin', @@ -114,9 +114,9 @@ family: 'Darwin', name: 'Darwin', release: { - full: '13.3.0', - }, - }, + full: '13.3.0' + } + } }, { kernel: 'AIX', @@ -124,9 +124,9 @@ family: 'AIX', name: 'AIX', release: { - full: '7100-02-00-000', - }, - }, + full: '7100-02-00-000' + } + } }, { kernel: 'AIX', @@ -134,9 +134,9 @@ family: 'AIX', name: 'AIX', release: { - full: '6100-07-04-1216', - }, - }, + full: '6100-07-04-1216' + } + } }, { kernel: 'AIX', @@ -144,9 +144,9 @@ family: 'AIX', name: 'AIX', release: { - full: '5300-12-01-1016', - }, - }, + full: '5300-12-01-1016' + } + } }, ].each do |facts| let(:facts) { facts } diff --git a/spec/defines/sap_spec.rb b/spec/defines/sap_spec.rb index 815c81aa..bad2d677 100644 --- a/spec/defines/sap_spec.rb +++ b/spec/defines/sap_spec.rb @@ -14,7 +14,7 @@ java: 'jdk', basedir: '/usr/java', manage_symlink: true, - symlink_name: 'java_home', + symlink_name: 'java_home' } end let(:title) { 'jdk11_symlink' } @@ -76,7 +76,7 @@ { ensure: 'present', version_full: '11.0.7', - java: 'jdk', + java: 'jdk' } end let(:title) { 'jdk1107' } @@ -101,7 +101,7 @@ ensure: 'present', version: '8', java: 'jdk', - basedir: '/usr/java', + basedir: '/usr/java' } end let(:title) { 'jdk8' } @@ -116,7 +116,7 @@ version: '8', java: 'jdk', basedir: '/usr/java', - manage_basedir: true, + manage_basedir: true } end let(:title) { 'jdk8' } @@ -175,7 +175,7 @@ { ensure: 'present', version_full: '11.0.7', - java: 'jdk', + java: 'jdk' } end let(:title) { 'jdk1107' } @@ -203,9 +203,9 @@ family: 'Windows', name: 'Windows', release: { - full: '8.1', - }, - }, + full: '8.1' + } + } }, { kernel: 'Darwin', @@ -213,9 +213,9 @@ family: 'Darwin', name: 'Darwin', release: { - full: '13.3.0', - }, - }, + full: '13.3.0' + } + } }, { kernel: 'AIX', @@ -223,9 +223,9 @@ family: 'AIX', name: 'AIX', release: { - full: '7100-02-00-000', - }, - }, + full: '7100-02-00-000' + } + } }, { kernel: 'AIX', @@ -233,9 +233,9 @@ family: 'AIX', name: 'AIX', release: { - full: '6100-07-04-1216', - }, - }, + full: '6100-07-04-1216' + } + } }, { kernel: 'AIX', @@ -243,9 +243,9 @@ family: 'AIX', name: 'AIX', release: { - full: '5300-12-01-1016', - }, - }, + full: '5300-12-01-1016' + } + } }, ].each do |facts| let(:facts) { facts } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 07db7342..c6e55257 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,7 @@ default_facts = { puppetversion: Puppet.version, - facterversion: Facter.version, + facterversion: Facter.version } default_fact_files = [ @@ -26,7 +26,7 @@ begin default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) - rescue => e + rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end end diff --git a/spec/unit/facter/java_default_home_spec.rb b/spec/unit/facter/java_default_home_spec.rb index f6032ef7..9f105d1d 100644 --- a/spec/unit/facter/java_default_home_spec.rb +++ b/spec/unit/facter/java_default_home_spec.rb @@ -8,9 +8,7 @@ java_8_home = '/usr/lib/jvm/oracle-java8-jre-amd64' def unlink_and_delete(filename) - if File.symlink?(filename) - File.unlink(filename) - end + File.unlink(filename) if File.symlink?(filename) return unless File.exist?(filename) File.delete(filename) From 38098a2b327e48dc5dea90cadb25545258645002 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 13:53:09 +0100 Subject: [PATCH 192/259] (CONT-784) Rubocop Unsafe Auto Fixes 1 - Performance/StringInclude --- .rubocop_todo.yml | 6 ------ lib/facter/java_default_home.rb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 66066be1..b8a320fb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -16,12 +16,6 @@ Naming/HeredocDelimiterNaming: - 'spec/defines/adoptium_spec.rb' - 'spec/defines/sap_spec.rb' -# Offense count: 1 -# This cop supports unsafe autocorrection (--autocorrect-all). -Performance/StringInclude: - Exclude: - - 'lib/facter/java_default_home.rb' - # Offense count: 8 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without diff --git a/lib/facter/java_default_home.rb b/lib/facter/java_default_home.rb index a818ad68..a93a13ae 100644 --- a/lib/facter/java_default_home.rb +++ b/lib/facter/java_default_home.rb @@ -21,7 +21,7 @@ nil else java_path = File.realpath(java_bin) - java_default_home = if %r{/jre/}.match?(java_path) + java_default_home = if java_path.include?('/jre/') File.dirname(File.dirname(File.dirname(java_path))) else File.dirname(File.dirname(java_path)) From 08bab67083e330d596e8f11b7afa9b24bd5135a0 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 14:48:03 +0100 Subject: [PATCH 193/259] (CONT-784) Rubocop Manual Fixes 1 - Naming/HeredocDelimiterNaming --- .rubocop_todo.yml | 10 ---------- spec/acceptance/install_spec.rb | 24 ++++++++++++------------ spec/defines/adopt_spec.rb | 8 ++++---- spec/defines/adoptium_spec.rb | 8 ++++---- spec/defines/sap_spec.rb | 8 ++++---- 5 files changed, 24 insertions(+), 34 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b8a320fb..5f836dbb 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,16 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 12 -# Configuration parameters: ForbiddenDelimiters. -# ForbiddenDelimiters: (?i-mx:(^|\s)(EO[A-Z]{1}|END)(\s|$)) -Naming/HeredocDelimiterNaming: - Exclude: - - 'spec/acceptance/install_spec.rb' - - 'spec/defines/adopt_spec.rb' - - 'spec/defines/adoptium_spec.rb' - - 'spec/defines/sap_spec.rb' - # Offense count: 8 # Configuration parameters: Prefixes, AllowedPatterns. # Prefixes: when, with, without diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 863738c2..0e5c1264 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -54,7 +54,7 @@ oracle_version_build = '09' oracle_hash = '42970487e3af4f5aa5bca3f542482c60' -install_oracle_jdk_jre = < '#{oracle_version_major}', @@ -71,9 +71,9 @@ url_hash => '#{oracle_hash}', java_se => 'jdk', } -EOL +MANIFEST -install_oracle_jre_jce = < '#{oracle_version_major}', @@ -84,9 +84,9 @@ jce => true, } -EOL +MANIFEST -install_oracle_jdk_jce = < '#{oracle_version_major}', @@ -96,7 +96,7 @@ java_se => 'jdk', jce => true, } -EOL +MANIFEST # AdoptOpenJDK URLs are quite generic, so tests are enabled by default # We need to test version 8 and >8 (here we use 9), because namings are different after version 8 @@ -109,7 +109,7 @@ adopt_version9_full = '9.0.4' adopt_version9_build = '11' -install_adopt_jdk_jre = < '#{adopt_version8_major}', @@ -138,13 +138,13 @@ version_minor => '#{adopt_version9_build}', java => 'jdk', } -EOL +MANIFEST # Adoptium adoptium_enabled = true unless os[:family].casecmp('SLES').zero? -install_adoptium_jdk = < '16', @@ -159,7 +159,7 @@ version_patch => '1', version_build => '12', } -EOL +MANIFEST sap_enabled = true sap_version7 = '7' @@ -171,7 +171,7 @@ sap_version14 = '14' sap_version14_full = '14.0.1' -install_sap_jdk_jre = < '#{sap_version7}', @@ -208,7 +208,7 @@ version_full => '#{sap_version14_full}', java => 'jdk', } -EOL +MANIFEST describe 'installing' do context 'installing java jre' do diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index 6d725b54..1d97a0c7 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -131,7 +131,7 @@ let(:title) { 'jdk8' } let(:pre_condition) do - <<-EOL + <<-MANIFEST java::adopt { 'jdk8172': ensure => 'present', @@ -139,7 +139,7 @@ version_minor => 'b11', java => 'jdk', } - EOL + MANIFEST end it { is_expected.to compile } @@ -283,7 +283,7 @@ let(:title) { 'jdk8' } let(:pre_condition) do - <<-EOL + <<-MANIFEST java::adopt { 'jdk8172': ensure => 'present', @@ -291,7 +291,7 @@ version_minor => 'b11', java => 'jdk', } - EOL + MANIFEST end it { is_expected.to compile } diff --git a/spec/defines/adoptium_spec.rb b/spec/defines/adoptium_spec.rb index 1ce7a192..ba268912 100644 --- a/spec/defines/adoptium_spec.rb +++ b/spec/defines/adoptium_spec.rb @@ -92,7 +92,7 @@ let(:title) { 'jdk16' } let(:pre_condition) do - <<-EOL + <<-MANIFEST java::adoptium { 'jdk17': ensure => 'present', @@ -101,7 +101,7 @@ version_patch => '1', version_build => '12', } - EOL + MANIFEST end it { is_expected.to compile } @@ -195,7 +195,7 @@ let(:title) { 'jdk16' } let(:pre_condition) do - <<-EOL + <<-MANIFEST java::adoptium { 'jdk17': ensure => 'present', @@ -204,7 +204,7 @@ version_patch => '1', version_build => '12', } - EOL + MANIFEST end it { is_expected.to compile } diff --git a/spec/defines/sap_spec.rb b/spec/defines/sap_spec.rb index bad2d677..3340f332 100644 --- a/spec/defines/sap_spec.rb +++ b/spec/defines/sap_spec.rb @@ -82,14 +82,14 @@ let(:title) { 'jdk1107' } let(:pre_condition) do - <<-EOL + <<-MANIFEST java::sap { 'jdk1106': ensure => 'present', version_full => '11.0.6', java => 'jdk', } - EOL + MANIFEST end it { is_expected.to compile } @@ -181,14 +181,14 @@ let(:title) { 'jdk1107' } let(:pre_condition) do - <<-EOL + <<-MANIFEST java::sap { 'jdk1106': ensure => 'present', version_full => '11.0.6', java => 'jdk', } - EOL + MANIFEST end it { is_expected.to compile } From 99090961f58482709381c355365f42f74f11cdae Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 14:50:57 +0100 Subject: [PATCH 194/259] (CONT-784) Rubocop Manual Fixes 2 - RSpec/ContextWording --- .rubocop_todo.yml | 8 ----- spec/acceptance/install_spec.rb | 14 ++++----- spec/classes/java_spec.rb | 44 +++++++++++++-------------- spec/unit/facter/java_version_spec.rb | 4 +-- 4 files changed, 31 insertions(+), 39 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 5f836dbb..3fe23e73 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,14 +6,6 @@ # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 8 -# Configuration parameters: Prefixes, AllowedPatterns. -# Prefixes: when, with, without -RSpec/ContextWording: - Exclude: - - 'spec/acceptance/install_spec.rb' - - 'spec/unit/facter/java_version_spec.rb' - # Offense count: 11 # Configuration parameters: IgnoredMetadata. RSpec/DescribeClass: diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 0e5c1264..6e3a1d3f 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -211,19 +211,19 @@ MANIFEST describe 'installing' do - context 'installing java jre' do + context 'when installing java jre' do it 'installs jre' do idempotent_apply(java_class_jre) end end - context 'installing java jdk' do + context 'when installing java jdk' do it 'installs jdk' do idempotent_apply(java_class) end end - context 'with failure cases' do + context 'when with failure cases' do it 'fails to install java with a blank version' do apply_manifest(blank_version, expect_failures: true) end @@ -249,7 +249,7 @@ end end - context 'java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do + context 'when java::oracle', if: oracle_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do let(:install_path) do (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' end @@ -279,7 +279,7 @@ end end - context 'java::adopt', if: adopt_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do + context 'when java::adopt', if: adopt_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do let(:install_path) do (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' end @@ -293,7 +293,7 @@ end end - context 'java::adoptium', if: adoptium_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do + context 'when java::adoptium', if: adoptium_enabled, unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do let(:install_path) do (os[:family] == 'redhat') ? '/usr/java' : '/usr/lib/jvm' end @@ -307,7 +307,7 @@ end end - context 'java::sap', if: sap_enabled && ['Sles'].include?(os[:family]), unless: UNSUPPORTED_PLATFORMS.include?(os[:family]) do + context 'when java::sap', 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 diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index f049a2eb..a3462671 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -3,35 +3,35 @@ require 'spec_helper' describe 'java', type: :class do - context 'when select openjdk for CentOS 5.8' do + context 'when selecting openjdk for CentOS 5.8' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.8' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.6.0/') } end - context 'when select openjdk for CentOS 6.3' do + context 'when selecting openjdk for CentOS 6.3' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.7.0/') } end - context 'when select openjdk for CentOS 7.1.1503' do + context 'when selecting openjdk for CentOS 7.1.1503' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '7.1.1503' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.8.0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0/') } end - context 'when select openjdk for CentOS 6.2' do + context 'when selecting openjdk for CentOS 6.2' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.2' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } it { is_expected.not_to contain_exec('update-java-alternatives') } end - context 'when select Oracle JRE with alternatives for CentOS 6.3' do + context 'when selecting Oracle JRE with alternatives for CentOS 6.3' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java/jre1.7.0_67/bin/java' } } @@ -49,14 +49,14 @@ it { is_expected.to contain_exec('update-java-alternatives').with_command(['alternatives', '--set', 'java', '/usr/java/jre1.7.0_67/bin/java']) } end - context 'when select Malicious JRE with alternatives for CentOS 6.3' do + context 'when selecting Malicious JRE with alternatives for CentOS 6.3' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java ; rm -rf /etc' } } it { is_expected.to contain_exec('create-java-alternatives').with_unless('alternatives --display java | grep -q /usr/java\\ \\;\\ rm\\ -rf\\ /etc') } end - context 'when select passed value for CentOS 5.3' do + context 'when selecting passed value for CentOS 5.3' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.3' }, architecture: 'x86_64' } } } let(:params) { { 'package' => 'jdk', 'java_home' => '/usr/local/lib/jre' } } @@ -64,14 +64,14 @@ it { is_expected.not_to contain_exec('update-java-alternatives') } end - context 'when select default for CentOS 5.3' do + context 'when selecting default for CentOS 5.3' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } it { is_expected.not_to contain_exec('update-java-alternatives') } end - context 'when select jdk for Debian Buster (10.0)' do + context 'when selecting jdk for Debian Buster (10.0)' do let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '10' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jdk' } } @@ -79,7 +79,7 @@ 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 + context 'when selecting jre for Debian Buster (10.0)' do let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '10' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jre' } } @@ -87,7 +87,7 @@ 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 Bionic (18.04)' do + context 'when selecting jdk for Ubuntu Bionic (18.04)' do let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jdk' } } @@ -95,7 +95,7 @@ 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 Ubuntu Bionic (18.04)' do + context 'when selecting jre for Ubuntu Bionic (18.04)' do let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jre' } } @@ -103,26 +103,26 @@ 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 openjdk for Oracle Linux' do + context 'when selecting openjdk for Oracle Linux' do let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.4' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } end - context 'when select openjdk for Oracle Linux 6.2' do + context 'when selecting openjdk for Oracle Linux 6.2' do let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.2' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } end - context 'when select passed value for Oracle Linux' do + context 'when selecting passed value for Oracle Linux' do let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.3' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } end - context 'when select passed value for Scientific Linux' do + context 'when selecting passed value for Scientific Linux' do let(:facts) { { os: { family: 'RedHat', name: 'Scientific', release: { full: '6.4' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } @@ -130,7 +130,7 @@ it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.7.0/') } end - context 'when select passed value for Scientific Linux CERN (SLC)' do + context 'when selecting passed value for Scientific Linux CERN (SLC)' do let(:facts) { { os: { family: 'RedHat', name: 'SLC', release: { full: '6.4' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } @@ -138,35 +138,35 @@ it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.7.0/') } end - context 'when select default for OpenSUSE 12.3' do + context 'when selecting default for OpenSUSE 12.3' do let(:facts) { { os: { family: 'Suse', name: 'OpenSUSE', release: { major: '12.3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/') } end - context 'when select default for SLES 11.3' do + context 'when selecting default for SLES 11.3' do let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_6_0-ibm-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.6.0-ibm-1.6.0/') } end - context 'when select default for SLES 11.4' do + context 'when selecting default for SLES 11.4' do let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.4' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_1-ibm-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.1-ibm-1.7.1/') } end - context 'when select default for SLES 12.0' do + context 'when selecting default for SLES 12.0' do let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '12.0', major: '12' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/') } end - context 'when select default for SLES 12.1' do + context 'when selecting default for SLES 12.1' do let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '12.1', major: '12' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_8_0-openjdk-devel') } diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index 9ece9b61..8b42f87a 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -18,7 +18,7 @@ end context 'when java present, returns java version' do - context 'on OpenBSD', with_env: true do + context 'when on OpenBSD', with_env: true do before(:each) do allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('OpenBSD') allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') @@ -64,7 +64,7 @@ end context 'when java not present, returns nil' do - context 'on OpenBSD', with_env: true do + context 'when on OpenBSD', with_env: true do before(:each) do allow(Facter.fact(:operatingsystem)).to receive(:value).and_return('OpenBSD') allow(Facter.fact(:kernel)).to receive(:value).and_return('Linux') From 0e90b58a8118dd6642eec4545d9dc2236ea50bc9 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 14:53:54 +0100 Subject: [PATCH 195/259] (CONT-784) Rubocop Manual Fixes 3 - RSpec/ExampleLength --- .rubocop_todo.yml | 5 ----- spec/classes/java_spec.rb | 6 ++---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 3fe23e73..6dc83c2f 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -27,11 +27,6 @@ RSpec/DescribeClass: - 'spec/unit/facter/java_patch_level_spec.rb' - 'spec/unit/facter/java_version_spec.rb' -# Offense count: 1 -# Configuration parameters: CountAsOne. -RSpec/ExampleLength: - Max: 6 - # Offense count: 3 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. # SupportedStyles: always, named_only diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index a3462671..de2f3966 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -39,10 +39,8 @@ it { expect(subject).to contain_exec('create-java-alternatives').with( - { - command: ['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000'], - unless: 'alternatives --display java | grep -q /usr/java/jre1.7.0_67/bin/java' - }, + { command: ['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000'], + unless: 'alternatives --display java | grep -q /usr/java/jre1.7.0_67/bin/java' }, ) } From 06fd02bc5140e8d7d00f41bf21bc6390b7e35d83 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 14:58:47 +0100 Subject: [PATCH 196/259] (CONT-784) Rubocop Manual Fixes 4 - RSpec/StubbedMock --- .rubocop_todo.yml | 6 ------ spec/unit/facter/java_default_home_spec.rb | 4 ++-- spec/unit/facter/java_version_spec.rb | 12 ++++++------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 6dc83c2f..0157c284 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -43,12 +43,6 @@ RSpec/NoExpectationExample: - 'spec/acceptance/install_spec.rb' - 'spec/unit/facter/java_default_home_spec.rb' -# Offense count: 8 -RSpec/StubbedMock: - Exclude: - - 'spec/unit/facter/java_default_home_spec.rb' - - 'spec/unit/facter/java_version_spec.rb' - # Offense count: 1 Style/MixinUsage: Exclude: diff --git a/spec/unit/facter/java_default_home_spec.rb b/spec/unit/facter/java_default_home_spec.rb index 9f105d1d..480fec9d 100644 --- a/spec/unit/facter/java_default_home_spec.rb +++ b/spec/unit/facter/java_default_home_spec.rb @@ -16,8 +16,8 @@ def unlink_and_delete(filename) def symlink_and_test(symlink_path, java_home) File.symlink(symlink_path, './java_test') - expect(Facter::Core::Execution).to receive(:which).with('java').and_return('./java_test') - expect(File).to receive(:realpath).with('./java_test').and_return(symlink_path) + allow(Facter::Core::Execution).to receive(:which).with('java').and_return('./java_test') + allow(File).to receive(:realpath).with('./java_test').and_return(symlink_path) expect(Facter.value(:java_default_home)).to eql java_home end diff --git a/spec/unit/facter/java_version_spec.rb b/spec/unit/facter/java_version_spec.rb index 8b42f87a..821f940d 100644 --- a/spec/unit/facter/java_version_spec.rb +++ b/spec/unit/facter/java_version_spec.rb @@ -27,8 +27,8 @@ let(:facts) { { operatingsystem: 'OpenBSD' } } it do - expect(Facter::Core::Execution).to receive(:which).with('java').and_return('/usr/local/jdk-1.7.0/jre/bin/java') - expect(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(openjdk_7_output) + allow(Facter::Core::Execution).to receive(:which).with('java').and_return('/usr/local/jdk-1.7.0/jre/bin/java') + allow(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(openjdk_7_output) expect(Facter.value(:java_version)).to eq('1.7.0_71') end end @@ -41,8 +41,8 @@ let(:facts) { { kernel: 'Darwin' } } it do - expect(Facter::Core::Execution).to receive(:execute).with('/usr/libexec/java_home --failfast', { on_fail: false }).and_return('/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home') - expect(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(jdk_7_hotspot_output) + allow(Facter::Core::Execution).to receive(:execute).with('/usr/libexec/java_home --failfast', { on_fail: false }).and_return('/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home') + allow(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(jdk_7_hotspot_output) expect(Facter.value(:java_version)).to eq('1.7.0_71') end end @@ -56,8 +56,8 @@ let(:facts) { { operatingsystem: 'MyOS' } } it do - expect(Facter::Core::Execution).to receive(:which).with('java').and_return('/path/to/java') - expect(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(jdk_7_hotspot_output) + allow(Facter::Core::Execution).to receive(:which).with('java').and_return('/path/to/java') + allow(Facter::Core::Execution).to receive(:execute).with('java -Xmx12m -version 2>&1').and_return(jdk_7_hotspot_output) expect(Facter.value(:java_version)).to eq('1.7.0_71') end end From 572fd1e1d3f290a54200d46bb1a1be221fb5a6f9 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 15:25:14 +0100 Subject: [PATCH 197/259] (CONT-784) Rubocop Manual Fixes 5 - RSpec/NoExpectationExample --- .rubocop_todo.yml | 8 ------- spec/acceptance/install_spec.rb | 28 +++++++++++----------- spec/unit/facter/java_default_home_spec.rb | 4 ++-- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0157c284..b9ca46bc 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -35,14 +35,6 @@ RSpec/NamedSubject: - 'spec/classes/java_spec.rb' - 'spec/defines/download_spec.rb' -# Offense count: 12 -# Configuration parameters: AllowedPatterns. -# AllowedPatterns: ^expect_, ^assert_ -RSpec/NoExpectationExample: - Exclude: - - 'spec/acceptance/install_spec.rb' - - 'spec/unit/facter/java_default_home_spec.rb' - # Offense count: 1 Style/MixinUsage: Exclude: diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 6e3a1d3f..2dd687f3 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -213,38 +213,38 @@ describe 'installing' do context 'when installing java jre' do it 'installs jre' do - idempotent_apply(java_class_jre) + expect { idempotent_apply(java_class_jre) }.not_to raise_error end end context 'when installing java jdk' do it 'installs jdk' do - idempotent_apply(java_class) + expect { idempotent_apply(java_class) }.not_to raise_error end end context 'when with failure cases' do it 'fails to install java with a blank version' do - apply_manifest(blank_version, expect_failures: true) + expect { apply_manifest(blank_version, expect_failures: true) }.not_to raise_error end it 'fails to install java with an incorrect distribution' do - apply_manifest(incorrect_distro, expect_failures: true) + expect { apply_manifest(incorrect_distro, expect_failures: true) }.not_to raise_error end it 'fails to install java with a blank distribution' do - apply_manifest(blank_distro, expect_failures: true) + expect { apply_manifest(blank_distro, expect_failures: true) }.not_to raise_error end it 'fails to install java with an incorrect package' do - apply_manifest(incorrect_package, expect_failures: true) + expect { apply_manifest(incorrect_package, expect_failures: true) }.not_to raise_error end it 'fails on debian or RHEL when passed fake java_alternative and path' do if os[:family] == 'sles' - apply_manifest(bogus_alternative, catch_failures: true) + expect { apply_manifest(bogus_alternative, catch_failures: true) }.not_to raise_error else - apply_manifest(bogus_alternative, expect_failures: true) + expect { apply_manifest(bogus_alternative, expect_failures: true) }.not_to raise_error end end end @@ -259,7 +259,7 @@ end it 'installs oracle jdk and jre' do - idempotent_apply(install_oracle_jdk_jre) + expect { idempotent_apply(install_oracle_jdk_jre) }.not_to raise_error jdk_result = shell("test ! -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") jre_result = shell("test ! -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") expect(jdk_result.exit_code).to eq(0) @@ -267,13 +267,13 @@ end it 'installs oracle jdk with jce' do - idempotent_apply(install_oracle_jdk_jce) + expect { idempotent_apply(install_oracle_jdk_jce) }.not_to raise_error result = shell("test -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") expect(result.exit_code).to eq(0) end it 'installs oracle jre with jce' do - idempotent_apply(install_oracle_jre_jce) + expect { idempotent_apply(install_oracle_jre_jce) }.not_to raise_error result = shell("test -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") expect(result.exit_code).to eq(0) end @@ -289,7 +289,7 @@ end it 'installs adopt jdk and jre' do - idempotent_apply(install_adopt_jdk_jre) + expect { idempotent_apply(install_adopt_jdk_jre) }.not_to raise_error end end @@ -303,7 +303,7 @@ end it 'installs adopt jdk and jre' do - idempotent_apply(install_adoptium_jdk) + expect { idempotent_apply(install_adoptium_jdk) }.not_to raise_error end end @@ -313,7 +313,7 @@ end it 'installs adopt jdk and jre' do - idempotent_apply(install_sap_jdk_jre) + expect { idempotent_apply(install_sap_jdk_jre) }.not_to raise_error end end end diff --git a/spec/unit/facter/java_default_home_spec.rb b/spec/unit/facter/java_default_home_spec.rb index 480fec9d..0bb26367 100644 --- a/spec/unit/facter/java_default_home_spec.rb +++ b/spec/unit/facter/java_default_home_spec.rb @@ -31,7 +31,7 @@ def symlink_and_test(symlink_path, java_home) context 'when java is in /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java' do it do unlink_and_delete('./java_test') - symlink_and_test(java_7_path, java_7_home) + expect { symlink_and_test(java_7_path, java_7_home) }.not_to raise_error unlink_and_delete('./java_test') end end @@ -39,7 +39,7 @@ def symlink_and_test(symlink_path, java_home) context 'when java is in /usr/lib/jvm/oracle-java8-jre-amd64/bin/java' do it do unlink_and_delete('./java_test') - symlink_and_test(java_8_path, java_8_home) + expect { symlink_and_test(java_8_path, java_8_home) }.not_to raise_error unlink_and_delete('./java_test') end end From c59589144b1a3ee933a03353030aff85be3c07bd Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 15:29:13 +0100 Subject: [PATCH 198/259] (CONT-784) Repin puppet_agent --- .fixtures.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.fixtures.yml b/.fixtures.yml index c675307e..4de712c2 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,7 +3,9 @@ fixtures: 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' + puppet_agent: + repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' + ref: v4.13.0 provision: 'https://github.com/puppetlabs/provision.git' symlinks: java: "#{source_dir}" From ef665308b108e648a9d1eb116d43ad668eb7c4d0 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 16:05:04 +0100 Subject: [PATCH 199/259] (maint) Release Prep v10.0.0 --- CHANGELOG.md | 17 +++++++++++++++++ metadata.json | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b7651ac..00893e81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +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). +## [v10.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.1) (2023-04-17) + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.1...v9.0.1) + +### Changed + +- \(CONT-784\) Add Support for Puppet 8 / Drop Support for Puppet 6 [\#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) + +### Added + +- \(CONT-356\) Syntax update [\#543](https://github.com/puppetlabs/puppetlabs-java/pull/543) ([LukasAud](https://github.com/LukasAud)) + +### Fixed + +- Fix shell\_escape of unless command [\#550](https://github.com/puppetlabs/puppetlabs-java/pull/550) ([traylenator](https://github.com/traylenator)) + ## [v9.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.1) (2022-11-29) [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.0...v9.0.1) @@ -9,6 +25,7 @@ All notable changes to this project will be documented in this file. The format ### Fixed - 538-unresolved-fact-fix [\#540](https://github.com/puppetlabs/puppetlabs-java/pull/540) ([jordanbreen28](https://github.com/jordanbreen28)) +- Unresolved fact fix [\#539](https://github.com/puppetlabs/puppetlabs-java/pull/539) ([jordanbreen28](https://github.com/jordanbreen28)) ## [v9.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.0) (2022-11-23) diff --git a/metadata.json b/metadata.json index ad69c15d..dfeb7d17 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "9.0.1", + "version": "10.0.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 0f7ee8ec0379b7a6aff63de7ddf6840df9db6f69 Mon Sep 17 00:00:00 2001 From: david22swan Date: Mon, 17 Apr 2023 15:25:14 +0100 Subject: [PATCH 200/259] Revert "(CONT-784) Rubocop Manual Fixes 5 - RSpec/NoExpectationExample" This reverts commit 572fd1e1d3f290a54200d46bb1a1be221fb5a6f9. --- .rubocop_todo.yml | 8 +++++++ spec/acceptance/install_spec.rb | 28 +++++++++++----------- spec/unit/facter/java_default_home_spec.rb | 4 ++-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b9ca46bc..0157c284 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -35,6 +35,14 @@ RSpec/NamedSubject: - 'spec/classes/java_spec.rb' - 'spec/defines/download_spec.rb' +# Offense count: 12 +# Configuration parameters: AllowedPatterns. +# AllowedPatterns: ^expect_, ^assert_ +RSpec/NoExpectationExample: + Exclude: + - 'spec/acceptance/install_spec.rb' + - 'spec/unit/facter/java_default_home_spec.rb' + # Offense count: 1 Style/MixinUsage: Exclude: diff --git a/spec/acceptance/install_spec.rb b/spec/acceptance/install_spec.rb index 2dd687f3..6e3a1d3f 100644 --- a/spec/acceptance/install_spec.rb +++ b/spec/acceptance/install_spec.rb @@ -213,38 +213,38 @@ describe 'installing' do context 'when installing java jre' do it 'installs jre' do - expect { idempotent_apply(java_class_jre) }.not_to raise_error + idempotent_apply(java_class_jre) end end context 'when installing java jdk' do it 'installs jdk' do - expect { idempotent_apply(java_class) }.not_to raise_error + idempotent_apply(java_class) end end context 'when with failure cases' do it 'fails to install java with a blank version' do - expect { apply_manifest(blank_version, expect_failures: true) }.not_to raise_error + apply_manifest(blank_version, expect_failures: true) end it 'fails to install java with an incorrect distribution' do - expect { apply_manifest(incorrect_distro, expect_failures: true) }.not_to raise_error + apply_manifest(incorrect_distro, expect_failures: true) end it 'fails to install java with a blank distribution' do - expect { apply_manifest(blank_distro, expect_failures: true) }.not_to raise_error + apply_manifest(blank_distro, expect_failures: true) end it 'fails to install java with an incorrect package' do - expect { apply_manifest(incorrect_package, expect_failures: true) }.not_to raise_error + apply_manifest(incorrect_package, expect_failures: true) end it 'fails on debian or RHEL when passed fake java_alternative and path' do if os[:family] == 'sles' - expect { apply_manifest(bogus_alternative, catch_failures: true) }.not_to raise_error + apply_manifest(bogus_alternative, catch_failures: true) else - expect { apply_manifest(bogus_alternative, expect_failures: true) }.not_to raise_error + apply_manifest(bogus_alternative, expect_failures: true) end end end @@ -259,7 +259,7 @@ end it 'installs oracle jdk and jre' do - expect { idempotent_apply(install_oracle_jdk_jre) }.not_to raise_error + idempotent_apply(install_oracle_jdk_jre) jdk_result = shell("test ! -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") jre_result = shell("test ! -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") expect(jdk_result.exit_code).to eq(0) @@ -267,13 +267,13 @@ end it 'installs oracle jdk with jce' do - expect { idempotent_apply(install_oracle_jdk_jce) }.not_to raise_error + idempotent_apply(install_oracle_jdk_jce) result = shell("test -e #{install_path}/jdk1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/jre/lib/security/local_policy.jar") expect(result.exit_code).to eq(0) end it 'installs oracle jre with jce' do - expect { idempotent_apply(install_oracle_jre_jce) }.not_to raise_error + idempotent_apply(install_oracle_jre_jce) result = shell("test -e #{install_path}/jre1.#{oracle_version_major}.0_#{oracle_version_minor}#{version_suffix}/lib/security/local_policy.jar") expect(result.exit_code).to eq(0) end @@ -289,7 +289,7 @@ end it 'installs adopt jdk and jre' do - expect { idempotent_apply(install_adopt_jdk_jre) }.not_to raise_error + idempotent_apply(install_adopt_jdk_jre) end end @@ -303,7 +303,7 @@ end it 'installs adopt jdk and jre' do - expect { idempotent_apply(install_adoptium_jdk) }.not_to raise_error + idempotent_apply(install_adoptium_jdk) end end @@ -313,7 +313,7 @@ end it 'installs adopt jdk and jre' do - expect { idempotent_apply(install_sap_jdk_jre) }.not_to raise_error + idempotent_apply(install_sap_jdk_jre) end end end diff --git a/spec/unit/facter/java_default_home_spec.rb b/spec/unit/facter/java_default_home_spec.rb index 0bb26367..480fec9d 100644 --- a/spec/unit/facter/java_default_home_spec.rb +++ b/spec/unit/facter/java_default_home_spec.rb @@ -31,7 +31,7 @@ def symlink_and_test(symlink_path, java_home) context 'when java is in /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java' do it do unlink_and_delete('./java_test') - expect { symlink_and_test(java_7_path, java_7_home) }.not_to raise_error + symlink_and_test(java_7_path, java_7_home) unlink_and_delete('./java_test') end end @@ -39,7 +39,7 @@ def symlink_and_test(symlink_path, java_home) context 'when java is in /usr/lib/jvm/oracle-java8-jre-amd64/bin/java' do it do unlink_and_delete('./java_test') - expect { symlink_and_test(java_8_path, java_8_home) }.not_to raise_error + symlink_and_test(java_8_path, java_8_home) unlink_and_delete('./java_test') end end From 86dc0e2568731acf4753f2471272ce8c67f87d65 Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Fri, 28 Apr 2023 09:42:15 +0100 Subject: [PATCH 201/259] (MAINT) - Remove deprecated has_key --- manifests/init.pp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c70ee162..7e40c6f5 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -46,7 +46,7 @@ ) { contain java::params - $default_package_name = has_key($java::params::java, $distribution) ? { + $default_package_name = $distribution in $java::params::java ? { false => undef, default => $java::params::java[$distribution]['package'], } @@ -62,7 +62,7 @@ ## Else undef $use_java_alternative = $java_alternative ? { undef => $use_java_package_name ? { - $default_package_name => has_key($java::params::java, $distribution) ? { + $default_package_name => $distribution in $java::params::java ? { default => $java::params::java[$distribution]['alternative'], false => undef, }, @@ -74,7 +74,7 @@ ## Same logic as $java_alternative above. $use_java_alternative_path = $java_alternative_path ? { undef => $use_java_package_name ? { - $default_package_name => has_key($java::params::java, $distribution) ? { + $default_package_name => $distribution in $java::params::java ? { default => $java::params::java[$distribution]['alternative_path'], false => undef, }, @@ -85,7 +85,7 @@ $use_java_home = $java_home ? { undef => $use_java_package_name ? { - $default_package_name => has_key($java::params::java, $distribution) ? { + $default_package_name => $distribution in $java::params::java ? { default => $java::params::java[$distribution]['java_home'], false => undef, }, @@ -100,7 +100,7 @@ $use_java_package_name == undef or $use_java_alternative == undef or $use_java_alternative_path == undef or $use_java_home == undef ) and ( - ! has_key($java::params::java, $distribution) + !($distribution in $java::params::java) )) { fail("Java distribution ${distribution} is not supported. Missing default values.") } From fcc2b03fdc91bfd7afd1f02a1a301c8efc4a6517 Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Mon, 15 May 2023 14:17:42 +0100 Subject: [PATCH 202/259] (CONT-930) - Roll out new changelog generator --- .github/release_prep.yml | 15 +++++++++++++++ .github/workflows/auto_release.yml | 9 --------- 2 files changed, 15 insertions(+), 9 deletions(-) create mode 100644 .github/release_prep.yml delete mode 100644 .github/workflows/auto_release.yml diff --git a/.github/release_prep.yml b/.github/release_prep.yml new file mode 100644 index 00000000..bb0b7acc --- /dev/null +++ b/.github/release_prep.yml @@ -0,0 +1,15 @@ +name: "Release Prep" + +on: + workflow_dispatch: + inputs: + version: + description: "Module version to be released. Must be a valid semver string. (1.2.3)" + required: true + +jobs: + release_prep: + uses: "puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main" + with: + version: "${{ github.event.inputs.version }}" + secrets: "inherit" diff --git a/.github/workflows/auto_release.yml b/.github/workflows/auto_release.yml deleted file mode 100644 index d6270c56..00000000 --- a/.github/workflows/auto_release.yml +++ /dev/null @@ -1,9 +0,0 @@ -name: "Auto release" - -on: - workflow_dispatch: - -jobs: - release_prep: - uses: "puppetlabs/cat-github-actions/.github/workflows/module_release_prep.yml@main" - secrets: "inherit" From 545e32a51a9411a2650de722382a86a3ee210233 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Tue, 23 May 2023 16:16:25 +0530 Subject: [PATCH 203/259] (CONT-1001) Add litmus ~> 1.0 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 3f6f5c7d..6235e42e 100644 --- a/Gemfile +++ b/Gemfile @@ -37,7 +37,7 @@ group :development do gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do - gem "puppet_litmus", '< 1.0.0', require: false, platforms: [:ruby, :x64_mingw] + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] gem "serverspec", '~> 2.41', require: false end From 75a74e68766e6fec46c3406064cb8f7ca44e113f Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 30 May 2023 17:13:21 +0100 Subject: [PATCH 204/259] (CONT-1028) - Update Stdlib upper limit dependency --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index dfeb7d17..3f281eb9 100644 --- a/metadata.json +++ b/metadata.json @@ -10,7 +10,7 @@ "dependencies": [ { "name": "puppetlabs/stdlib", - "version_requirement": ">= 4.13.1 < 9.0.0" + "version_requirement": ">= 4.13.1 < 10.0.0" }, { "name": "puppet/archive", From 46708a66b1c7ca4b1606fea6202a67699ee66d77 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Thu, 15 Jun 2023 17:12:31 +0530 Subject: [PATCH 205/259] (CONT-990) - Community Pull Requests template --- .github/pull_request_template.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..e3a97007 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,15 @@ +## Summary +Provide a detailed description of all the changes present in this pull request. + +## Additional Context +Add any additional context about the problem here. +- [ ] Root cause and the steps to reproduce. (If applicable) +- [ ] Thought process behind the implementation. + +## Related Issues (if any) +Mention any related issues or pull requests. + +## Checklist +- [ ] 🟢 Spec tests. +- [ ] 🟢 Acceptance tests. +- [ ] Manually verified. (For example `puppet apply`) \ No newline at end of file From 214871afdde83b8475d58031669d1c53508ad213 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Fri, 16 Jun 2023 09:25:57 +0200 Subject: [PATCH 206/259] puppet/archive: Allow 7.x --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 3f281eb9..cf432393 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppet/archive", - "version_requirement": ">= 1.1.0 < 7.0.0" + "version_requirement": ">= 1.1.0 < 8.0.0" } ], "operatingsystem_support": [ From c6ce31404fbbc391c0147a0d64bdb686ecd99077 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 20 Jun 2023 11:33:42 +0100 Subject: [PATCH 207/259] (Maint) Correcting release_prep.yml path Prior to this commit, we would have a release prep action for this our module but it would not be available in our actions tab. This commit aims to fix this by moving the script to the correct folder. --- .github/{ => workflows}/release_prep.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/{ => workflows}/release_prep.yml (100%) diff --git a/.github/release_prep.yml b/.github/workflows/release_prep.yml similarity index 100% rename from .github/release_prep.yml rename to .github/workflows/release_prep.yml From 5a3c95e39813c9af834c86e27ca909759f94ebcf Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 20 Jun 2023 10:49:26 +0000 Subject: [PATCH 208/259] Release prep v10.1.0 --- CHANGELOG.md | 795 ++++++++++++++++++++++++++++---------------------- metadata.json | 2 +- 2 files changed, 453 insertions(+), 344 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 00893e81..63aba24e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,611 +1,720 @@ -# Change log + +# Changelog -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). +All notable changes to this project will be documented in this file. -## [v10.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.1) (2023-04-17) +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). -[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.1...v9.0.1) +## [v10.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v10.1.0) - 2023-06-20 -### Changed +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.0.0...v10.1.0) + +### Added + +- puppet/archive: Allow 7.x [#559](https://github.com/puppetlabs/puppetlabs-java/pull/559) ([bastelfreak](https://github.com/bastelfreak)) +- pdksync - (MAINT) - Allow Stdlib 9.x [#557](https://github.com/puppetlabs/puppetlabs-java/pull/557) ([LukasAud](https://github.com/LukasAud)) -- \(CONT-784\) Add Support for Puppet 8 / Drop Support for Puppet 6 [\#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) +## [v10.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v10.0.0) - 2023-04-17 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.1...v10.0.0) ### Added -- \(CONT-356\) Syntax update [\#543](https://github.com/puppetlabs/puppetlabs-java/pull/543) ([LukasAud](https://github.com/LukasAud)) +- (CONT-356) Syntax update [#543](https://github.com/puppetlabs/puppetlabs-java/pull/543) ([LukasAud](https://github.com/LukasAud)) + +### Changed +- (CONT-784) Add Support for Puppet 8 / Drop Support for Puppet 6 [#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) ### Fixed -- Fix shell\_escape of unless command [\#550](https://github.com/puppetlabs/puppetlabs-java/pull/550) ([traylenator](https://github.com/traylenator)) +- Fix shell_escape of unless command [#550](https://github.com/puppetlabs/puppetlabs-java/pull/550) ([traylenator](https://github.com/traylenator)) -## [v9.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.1) (2022-11-29) +## [v9.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.1) - 2022-11-29 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.0...v9.0.1) ### Fixed -- 538-unresolved-fact-fix [\#540](https://github.com/puppetlabs/puppetlabs-java/pull/540) ([jordanbreen28](https://github.com/jordanbreen28)) -- Unresolved fact fix [\#539](https://github.com/puppetlabs/puppetlabs-java/pull/539) ([jordanbreen28](https://github.com/jordanbreen28)) +- 538-unresolved-fact-fix [#540](https://github.com/puppetlabs/puppetlabs-java/pull/540) ([jordanbreen28](https://github.com/jordanbreen28)) +- Unresolved fact fix [#539](https://github.com/puppetlabs/puppetlabs-java/pull/539) ([jordanbreen28](https://github.com/jordanbreen28)) -## [v9.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.0) (2022-11-23) +## [v9.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v9.0.0) - 2022-11-23 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.2.0...v9.0.0) ### Changed - -- \(CONT-263\) Update minimum required puppet version [\#535](https://github.com/puppetlabs/puppetlabs-java/pull/535) ([LukasAud](https://github.com/LukasAud)) +- (CONT-263) Update minimum required puppet version [#535](https://github.com/puppetlabs/puppetlabs-java/pull/535) ([LukasAud](https://github.com/LukasAud)) ### Fixed -- Update package naming to differentiate between minor versions [\#534](https://github.com/puppetlabs/puppetlabs-java/pull/534) ([sd-z](https://github.com/sd-z)) -- \(CONT-173\) - Updating deprecated facter instances [\#531](https://github.com/puppetlabs/puppetlabs-java/pull/531) ([jordanbreen28](https://github.com/jordanbreen28)) -- pdksync - \(CONT-189\) Remove support for RedHat6 / OracleLinux6 / Scientific6 [\#530](https://github.com/puppetlabs/puppetlabs-java/pull/530) ([david22swan](https://github.com/david22swan)) -- pdksync - \(CONT-130\) - Dropping Support for Debian 9 [\#527](https://github.com/puppetlabs/puppetlabs-java/pull/527) ([jordanbreen28](https://github.com/jordanbreen28)) -- Hardening manifests [\#525](https://github.com/puppetlabs/puppetlabs-java/pull/525) ([LukasAud](https://github.com/LukasAud)) +- Update package naming to differentiate between minor versions [#534](https://github.com/puppetlabs/puppetlabs-java/pull/534) ([sd-z](https://github.com/sd-z)) +- (CONT-173) - Updating deprecated facter instances [#531](https://github.com/puppetlabs/puppetlabs-java/pull/531) ([jordanbreen28](https://github.com/jordanbreen28)) +- pdksync - (CONT-189) Remove support for RedHat6 / OracleLinux6 / Scientific6 [#530](https://github.com/puppetlabs/puppetlabs-java/pull/530) ([david22swan](https://github.com/david22swan)) +- pdksync - (CONT-130) - Dropping Support for Debian 9 [#527](https://github.com/puppetlabs/puppetlabs-java/pull/527) ([jordanbreen28](https://github.com/jordanbreen28)) +- Hardening manifests [#525](https://github.com/puppetlabs/puppetlabs-java/pull/525) ([LukasAud](https://github.com/LukasAud)) -## [v8.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.2.0) (2022-08-09) +## [v8.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.2.0) - 2022-08-09 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.1.0...v8.2.0) ### Added -- pdksync - \(GH-cat-11\) Certify Support for Ubuntu 22.04 [\#522](https://github.com/puppetlabs/puppetlabs-java/pull/522) ([david22swan](https://github.com/david22swan)) -- Make ubuntu 22.04 also default to openjdk-11 [\#519](https://github.com/puppetlabs/puppetlabs-java/pull/519) ([rswarts](https://github.com/rswarts)) -- pdksync - \(GH-cat-12\) Add Support for Redhat 9 [\#518](https://github.com/puppetlabs/puppetlabs-java/pull/518) ([david22swan](https://github.com/david22swan)) +- pdksync - (GH-cat-11) Certify Support for Ubuntu 22.04 [#522](https://github.com/puppetlabs/puppetlabs-java/pull/522) ([david22swan](https://github.com/david22swan)) +- Make ubuntu 22.04 also default to openjdk-11 [#519](https://github.com/puppetlabs/puppetlabs-java/pull/519) ([rswarts](https://github.com/rswarts)) +- pdksync - (GH-cat-12) Add Support for Redhat 9 [#518](https://github.com/puppetlabs/puppetlabs-java/pull/518) ([david22swan](https://github.com/david22swan)) -## [v8.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.1.0) (2022-05-30) +## [v8.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.1.0) - 2022-05-30 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.0.0...v8.1.0) ### Added -- feat: added support for aarch64 architecture download [\#516](https://github.com/puppetlabs/puppetlabs-java/pull/516) ([0Rick0](https://github.com/0Rick0)) +- feat: added support for aarch64 architecture download [#516](https://github.com/puppetlabs/puppetlabs-java/pull/516) ([0Rick0](https://github.com/0Rick0)) -## [v8.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.0.0) (2022-04-05) +## [v8.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v8.0.0) - 2022-04-05 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.3.0...v8.0.0) -### Changed - -- \(GH-C&T-7\) Remove code specific to unsupported OSs [\#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) - ### Added -- \(MODULES-11234\) Support Adoptium Temurin [\#502](https://github.com/puppetlabs/puppetlabs-java/pull/502) ([dploeger](https://github.com/dploeger)) +- (MODULES-11234) Support Adoptium Temurin [#502](https://github.com/puppetlabs/puppetlabs-java/pull/502) ([dploeger](https://github.com/dploeger)) + +### Changed +- (GH-C&T-7) Remove code specific to unsupported OSs [#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) ### Fixed -- pdksync - \(GH-iac-334\) Remove Support for Ubuntu 14.04/16.04 [\#505](https://github.com/puppetlabs/puppetlabs-java/pull/505) ([david22swan](https://github.com/david22swan)) -- pdksync - \(IAC-1787\) Remove Support for CentOS 6 [\#503](https://github.com/puppetlabs/puppetlabs-java/pull/503) ([david22swan](https://github.com/david22swan)) +- pdksync - (GH-iac-334) Remove Support for Ubuntu 14.04/16.04 [#505](https://github.com/puppetlabs/puppetlabs-java/pull/505) ([david22swan](https://github.com/david22swan)) +- pdksync - (IAC-1787) Remove Support for CentOS 6 [#503](https://github.com/puppetlabs/puppetlabs-java/pull/503) ([david22swan](https://github.com/david22swan)) -## [v7.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.3.0) (2021-10-11) +## [v7.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.3.0) - 2021-10-11 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.2.0...v7.3.0) ### Added -- pdksync - \(IAC-1753\) - Add Support for AlmaLinux 8 [\#500](https://github.com/puppetlabs/puppetlabs-java/pull/500) ([david22swan](https://github.com/david22swan)) -- pdksync - \(IAC-1751\) - Add Support for Rocky 8 [\#499](https://github.com/puppetlabs/puppetlabs-java/pull/499) ([david22swan](https://github.com/david22swan)) +- pdksync - (IAC-1753) - Add Support for AlmaLinux 8 [#500](https://github.com/puppetlabs/puppetlabs-java/pull/500) ([david22swan](https://github.com/david22swan)) +- pdksync - (IAC-1751) - Add Support for Rocky 8 [#499](https://github.com/puppetlabs/puppetlabs-java/pull/499) ([david22swan](https://github.com/david22swan)) ### Fixed -- pdksync - \(IAC-1598\) - Remove Support for Debian 8 [\#498](https://github.com/puppetlabs/puppetlabs-java/pull/498) ([david22swan](https://github.com/david22swan)) +- pdksync - (IAC-1598) - Remove Support for Debian 8 [#498](https://github.com/puppetlabs/puppetlabs-java/pull/498) ([david22swan](https://github.com/david22swan)) -## [v7.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.2.0) (2021-09-20) +## [v7.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.2.0) - 2021-09-20 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.1.1...v7.2.0) ### Added -- Enabling Rocky Linux for Install [\#488](https://github.com/puppetlabs/puppetlabs-java/pull/488) ([pmjensen](https://github.com/pmjensen)) +- Enabling Rocky Linux for Install [#488](https://github.com/puppetlabs/puppetlabs-java/pull/488) ([pmjensen](https://github.com/pmjensen)) ### Fixed -- Allow archive 6.x [\#493](https://github.com/puppetlabs/puppetlabs-java/pull/493) ([smortex](https://github.com/smortex)) +- Allow archive 6.x [#493](https://github.com/puppetlabs/puppetlabs-java/pull/493) ([smortex](https://github.com/smortex)) -## [v7.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.1) (2021-08-26) +## [v7.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.1) - 2021-08-26 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.1.0...v7.1.1) ### Fixed -- \(IAC-1741\) Allow stdlib v8.0.0 [\#491](https://github.com/puppetlabs/puppetlabs-java/pull/491) ([david22swan](https://github.com/david22swan)) +- (IAC-1741) Allow stdlib v8.0.0 [#491](https://github.com/puppetlabs/puppetlabs-java/pull/491) ([david22swan](https://github.com/david22swan)) -## [v7.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.0) (2021-08-12) +## [v7.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.1.0) - 2021-08-12 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.2...v7.1.0) ### Added -- pdksync - \(IAC-1709\) - Add Support for Debian 11 [\#489](https://github.com/puppetlabs/puppetlabs-java/pull/489) ([david22swan](https://github.com/david22swan)) +- pdksync - (IAC-1709) - Add Support for Debian 11 [#489](https://github.com/puppetlabs/puppetlabs-java/pull/489) ([david22swan](https://github.com/david22swan)) -## [v7.0.2](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.2) (2021-04-26) +## [v7.0.2](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.2) - 2021-04-26 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.1...v7.0.2) ### Fixed -- add url parameter for adoptopenjdk [\#473](https://github.com/puppetlabs/puppetlabs-java/pull/473) ([cbobinec](https://github.com/cbobinec)) +- add url parameter for adoptopenjdk [#473](https://github.com/puppetlabs/puppetlabs-java/pull/473) ([cbobinec](https://github.com/cbobinec)) -## [v7.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.1) (2021-04-19) +## [v7.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.1) - 2021-04-19 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.0.0...v7.0.1) ### Fixed -- allow v5.x of puppet/archive [\#476](https://github.com/puppetlabs/puppetlabs-java/pull/476) ([bastelfreak](https://github.com/bastelfreak)) +- allow v5.x of puppet/archive [#476](https://github.com/puppetlabs/puppetlabs-java/pull/476) ([bastelfreak](https://github.com/bastelfreak)) -## [v7.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.0) (2021-03-01) +## [v7.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v7.0.0) - 2021-03-01 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.5.0...v7.0.0) ### Changed - -- pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [\#463](https://github.com/puppetlabs/puppetlabs-java/pull/463) ([carabasdaniel](https://github.com/carabasdaniel)) +- pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [#463](https://github.com/puppetlabs/puppetlabs-java/pull/463) ([carabasdaniel](https://github.com/carabasdaniel)) ### Fixed -- \(MODULES-10935\) - Switch legacy operatingsystem fact to modern kernel one [\#461](https://github.com/puppetlabs/puppetlabs-java/pull/461) ([rjd1](https://github.com/rjd1)) +- (MODULES-10935) - Switch legacy operatingsystem fact to modern kernel one [#461](https://github.com/puppetlabs/puppetlabs-java/pull/461) ([rjd1](https://github.com/rjd1)) -## [v6.5.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.5.0) (2020-12-16) +## [v6.5.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.5.0) - 2020-12-16 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.4.0...v6.5.0) ### Added -- pdksync - \(feat\) Add support for Puppet 7 [\#454](https://github.com/puppetlabs/puppetlabs-java/pull/454) ([daianamezdrea](https://github.com/daianamezdrea)) +- pdksync - (feat) Add support for Puppet 7 [#454](https://github.com/puppetlabs/puppetlabs-java/pull/454) ([daianamezdrea](https://github.com/daianamezdrea)) -## [v6.4.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.4.0) (2020-11-09) +## [v6.4.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.4.0) - 2020-11-09 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.3.0...v6.4.0) ### Added -- Add support for SAP Java \(sapjvm / sapmachine\) [\#433](https://github.com/puppetlabs/puppetlabs-java/pull/433) ([timdeluxe](https://github.com/timdeluxe)) +- 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)) +- [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) +## [v6.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.3.0) - 2020-05-28 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.2.0...v6.3.0) ### Added -- \(MODULES-10681\) Add option to manage symlink to java::adopt [\#429](https://github.com/puppetlabs/puppetlabs-java/pull/429) ([fraenki](https://github.com/fraenki)) -- \(IAC-746\) - Add ubuntu 20.04 support [\#428](https://github.com/puppetlabs/puppetlabs-java/pull/428) ([david22swan](https://github.com/david22swan)) +- (MODULES-10681) Add option to manage symlink to java::adopt [#429](https://github.com/puppetlabs/puppetlabs-java/pull/429) ([fraenki](https://github.com/fraenki)) +- (IAC-746) - Add ubuntu 20.04 support [#428](https://github.com/puppetlabs/puppetlabs-java/pull/428) ([david22swan](https://github.com/david22swan)) -## [v6.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.2.0) (2020-02-18) +## [v6.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.2.0) - 2020-02-19 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.1.0...v6.2.0) ### Added -- Support AdoptOpenJDK [\#370](https://github.com/puppetlabs/puppetlabs-java/pull/370) ([timdeluxe](https://github.com/timdeluxe)) +- Support AdoptOpenJDK [#370](https://github.com/puppetlabs/puppetlabs-java/pull/370) ([timdeluxe](https://github.com/timdeluxe)) ### Fixed -- Replace legacy facts by modern facts [\#406](https://github.com/puppetlabs/puppetlabs-java/pull/406) ([hdeheer](https://github.com/hdeheer)) +- Replace legacy facts by modern facts [#406](https://github.com/puppetlabs/puppetlabs-java/pull/406) ([hdeheer](https://github.com/hdeheer)) -## [v6.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.1.0) (2020-02-03) +## [v6.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.1.0) - 2020-02-03 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.0.0...v6.1.0) -## [v6.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v6.0.0) (2019-11-11) +## [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) ### Added -- \(FM-8676\) Add CentOS 8 to supported OS list [\#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)) +- (FM-8676) Add CentOS 8 to supported OS list [#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 -- 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)) +- 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) +## [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) +## [v5.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v5.0.0) - 2019-08-05 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v4.1.0...v5.0.0) -### Changed - -- \[FM-8320\] Remove Oracle download [\#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) - ### Added -- \(FM-8223\) converted to use litmus [\#376](https://github.com/puppetlabs/puppetlabs-java/pull/376) ([tphoney](https://github.com/tphoney)) -- Add buster support, default to 11 [\#369](https://github.com/puppetlabs/puppetlabs-java/pull/369) ([mhjacks](https://github.com/mhjacks)) -- Add support for debian buster [\#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) +- (FM-8223) converted to use litmus [#376](https://github.com/puppetlabs/puppetlabs-java/pull/376) ([tphoney](https://github.com/tphoney)) +- Add buster support, default to 11 [#369](https://github.com/puppetlabs/puppetlabs-java/pull/369) ([mhjacks](https://github.com/mhjacks)) +- Add support for debian buster [#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) + +### Changed +- [FM-8320] Remove Oracle download [#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) ### Fixed -- \(FM-8343\) use release numbers not lsbdistcodename [\#375](https://github.com/puppetlabs/puppetlabs-java/pull/375) ([tphoney](https://github.com/tphoney)) -- Revert "Add support for debian buster" [\#374](https://github.com/puppetlabs/puppetlabs-java/pull/374) ([tphoney](https://github.com/tphoney)) +- (FM-8343) use release numbers not lsbdistcodename [#375](https://github.com/puppetlabs/puppetlabs-java/pull/375) ([tphoney](https://github.com/tphoney)) +- Revert "Add support for debian buster" [#374](https://github.com/puppetlabs/puppetlabs-java/pull/374) ([tphoney](https://github.com/tphoney)) -## [v4.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v4.1.0) (2019-05-29) +## [v4.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v4.1.0) - 2019-05-29 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v4.0.0...v4.1.0) ### Added -- \(FM-8028\) Add RedHat 8 support [\#363](https://github.com/puppetlabs/puppetlabs-java/pull/363) ([eimlav](https://github.com/eimlav)) +- (FM-8028) Add RedHat 8 support [#363](https://github.com/puppetlabs/puppetlabs-java/pull/363) ([eimlav](https://github.com/eimlav)) -## [v4.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v4.0.0) (2019-05-20) +## [v4.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v4.0.0) - 2019-05-20 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.3.0...v4.0.0) -### Changed - -- pdksync - \(MODULES-8444\) - Raise lower Puppet bound [\#356](https://github.com/puppetlabs/puppetlabs-java/pull/356) ([david22swan](https://github.com/david22swan)) - ### Added -- \(FM-7921\) - Implement Puppet Strings [\#353](https://github.com/puppetlabs/puppetlabs-java/pull/353) ([david22swan](https://github.com/david22swan)) -- Update default version & java 8 version from 8u192 to 8u201 [\#347](https://github.com/puppetlabs/puppetlabs-java/pull/347) ([valentinsavenko](https://github.com/valentinsavenko)) -- Add ability to override basedir and package type for oracle java [\#345](https://github.com/puppetlabs/puppetlabs-java/pull/345) ([fraenki](https://github.com/fraenki)) -- MODULES-8613: Add option to set a custom JCE download URL [\#344](https://github.com/puppetlabs/puppetlabs-java/pull/344) ([HielkeJ](https://github.com/HielkeJ)) +- (FM-7921) - Implement Puppet Strings [#353](https://github.com/puppetlabs/puppetlabs-java/pull/353) ([david22swan](https://github.com/david22swan)) +- Update default version & java 8 version from 8u192 to 8u201 [#347](https://github.com/puppetlabs/puppetlabs-java/pull/347) ([valentinsavenko](https://github.com/valentinsavenko)) +- Add ability to override basedir and package type for oracle java [#345](https://github.com/puppetlabs/puppetlabs-java/pull/345) ([fraenki](https://github.com/fraenki)) +- MODULES-8613: Add option to set a custom JCE download URL [#344](https://github.com/puppetlabs/puppetlabs-java/pull/344) ([HielkeJ](https://github.com/HielkeJ)) + +### Changed +- pdksync - (MODULES-8444) - Raise lower Puppet bound [#356](https://github.com/puppetlabs/puppetlabs-java/pull/356) ([david22swan](https://github.com/david22swan)) ### Fixed -- MODULES-8698: Fix $install\_path on CentOS with tar.gz package type [\#349](https://github.com/puppetlabs/puppetlabs-java/pull/349) ([fraenki](https://github.com/fraenki)) +- MODULES-8698: Fix $install_path on CentOS with tar.gz package type [#349](https://github.com/puppetlabs/puppetlabs-java/pull/349) ([fraenki](https://github.com/fraenki)) -## [3.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.3.0) (2019-01-17) +## [3.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.3.0) - 2019-01-18 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.2.0...3.3.0) ### Added -- \(MODULES-8234\) - Add SLES 15 support [\#336](https://github.com/puppetlabs/puppetlabs-java/pull/336) ([eimlav](https://github.com/eimlav)) -- \(MODULES-8234\) - Upgrade Oracle Java version to 8u192 [\#334](https://github.com/puppetlabs/puppetlabs-java/pull/334) ([eimlav](https://github.com/eimlav)) -- Support for installing JCE. Fixes MODULES-1681 [\#326](https://github.com/puppetlabs/puppetlabs-java/pull/326) ([dploeger](https://github.com/dploeger)) -- MODULES-8044: upgrade Oracle Java 8 to 181, make it the default release [\#314](https://github.com/puppetlabs/puppetlabs-java/pull/314) ([ojongerius](https://github.com/ojongerius)) +- (MODULES-8234) - Add SLES 15 support [#336](https://github.com/puppetlabs/puppetlabs-java/pull/336) ([eimlav](https://github.com/eimlav)) +- (MODULES-8234) - Upgrade Oracle Java version to 8u192 [#334](https://github.com/puppetlabs/puppetlabs-java/pull/334) ([eimlav](https://github.com/eimlav)) +- Support for installing JCE. Fixes MODULES-1681 [#326](https://github.com/puppetlabs/puppetlabs-java/pull/326) ([dploeger](https://github.com/dploeger)) +- MODULES-8044: upgrade Oracle Java 8 to 181, make it the default release [#314](https://github.com/puppetlabs/puppetlabs-java/pull/314) ([ojongerius](https://github.com/ojongerius)) ### Fixed -- pdksync - \(FM-7655\) Fix rubygems-update for ruby \< 2.3 [\#338](https://github.com/puppetlabs/puppetlabs-java/pull/338) ([tphoney](https://github.com/tphoney)) -- \(FM-7520\) - Removing Solaris from the support matrix [\#335](https://github.com/puppetlabs/puppetlabs-java/pull/335) ([pmcmaw](https://github.com/pmcmaw)) -- Optimized code for making java::oracle atomic. Fixes MODULES-8085 [\#330](https://github.com/puppetlabs/puppetlabs-java/pull/330) ([dploeger](https://github.com/dploeger)) -- Fix OpenJDK paths on Debian based OS with ARM [\#329](https://github.com/puppetlabs/puppetlabs-java/pull/329) ([mmoll](https://github.com/mmoll)) -- \(MODULES-7050\) - Fix OracleJDK reinstalling on Puppet runs [\#323](https://github.com/puppetlabs/puppetlabs-java/pull/323) ([eimlav](https://github.com/eimlav)) -- \(MODULES-8025\) Switch default for Ubuntu 18.04 to 11 [\#322](https://github.com/puppetlabs/puppetlabs-java/pull/322) ([baurmatt](https://github.com/baurmatt)) -- MODULES-7819 fix set JAVA\_HOME environments on FreeBSD platform [\#315](https://github.com/puppetlabs/puppetlabs-java/pull/315) ([olevole](https://github.com/olevole)) +- pdksync - (FM-7655) Fix rubygems-update for ruby < 2.3 [#338](https://github.com/puppetlabs/puppetlabs-java/pull/338) ([tphoney](https://github.com/tphoney)) +- (FM-7520) - Removing Solaris from the support matrix [#335](https://github.com/puppetlabs/puppetlabs-java/pull/335) ([pmcmaw](https://github.com/pmcmaw)) +- Optimized code for making java::oracle atomic. Fixes MODULES-8085 [#330](https://github.com/puppetlabs/puppetlabs-java/pull/330) ([dploeger](https://github.com/dploeger)) +- Fix OpenJDK paths on Debian based OS with ARM [#329](https://github.com/puppetlabs/puppetlabs-java/pull/329) ([mmoll](https://github.com/mmoll)) +- (MODULES-7050) - Fix OracleJDK reinstalling on Puppet runs [#323](https://github.com/puppetlabs/puppetlabs-java/pull/323) ([eimlav](https://github.com/eimlav)) +- (MODULES-8025) Switch default for Ubuntu 18.04 to 11 [#322](https://github.com/puppetlabs/puppetlabs-java/pull/322) ([baurmatt](https://github.com/baurmatt)) +- MODULES-7819 fix set JAVA_HOME environments on FreeBSD platform [#315](https://github.com/puppetlabs/puppetlabs-java/pull/315) ([olevole](https://github.com/olevole)) -## [3.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.2.0) (2018-09-27) +## [3.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.2.0) - 2018-09-27 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.1.0...3.2.0) ### Added -- pdksync - \(MODULES-6805\) metadata.json shows support for puppet 6 [\#317](https://github.com/puppetlabs/puppetlabs-java/pull/317) ([tphoney](https://github.com/tphoney)) +- pdksync - (MODULES-6805) metadata.json shows support for puppet 6 [#317](https://github.com/puppetlabs/puppetlabs-java/pull/317) ([tphoney](https://github.com/tphoney)) -## [3.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.1.0) (2018-09-06) +## [3.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.1.0) - 2018-09-10 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.0.0...3.1.0) ### Added -- pdksync - \(MODULES-7705\) - Bumping stdlib dependency from \< 5.0.0 to \< 6.0.0 [\#310](https://github.com/puppetlabs/puppetlabs-java/pull/310) ([pmcmaw](https://github.com/pmcmaw)) +- pdksync - (MODULES-7705) - Bumping stdlib dependency from < 5.0.0 to < 6.0.0 [#310](https://github.com/puppetlabs/puppetlabs-java/pull/310) ([pmcmaw](https://github.com/pmcmaw)) -## [3.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.0.0) (2018-08-13) +## [3.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/3.0.0) - 2018-08-14 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.4.0...3.0.0) +### Added + +- (MODULES-7561) - Addition of support for Ubuntu 18.04 to java [#299](https://github.com/puppetlabs/puppetlabs-java/pull/299) ([david22swan](https://github.com/david22swan)) + ### Changed +- [FM-6963] Removal of unsupported OS from java [#295](https://github.com/puppetlabs/puppetlabs-java/pull/295) ([david22swan](https://github.com/david22swan)) + +### Fixed + +- Remove ensure_resource to avoid potential conflict [#287](https://github.com/puppetlabs/puppetlabs-java/pull/287) ([sevencastles](https://github.com/sevencastles)) + +## [2.4.0](https://github.com/puppetlabs/puppetlabs-java/tree/2.4.0) - 2018-01-23 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.3.0...2.4.0) + +### Fixed + +- Fixes java_home for SLES 11.4 and relevant tests [#283](https://github.com/puppetlabs/puppetlabs-java/pull/283) ([HelenCampbell](https://github.com/HelenCampbell)) +- FM-6634 rubocop fixes [#279](https://github.com/puppetlabs/puppetlabs-java/pull/279) ([tphoney](https://github.com/tphoney)) + +## [2.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/2.3.0) - 2017-12-01 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.2.0...2.3.0) + +### Added + +- Add support for Ubuntu artful (17.10) and bionic (18.04 to be) [#270](https://github.com/puppetlabs/puppetlabs-java/pull/270) ([mhjacks](https://github.com/mhjacks)) + +### Other + +- 2.3.0PreRelease [#277](https://github.com/puppetlabs/puppetlabs-java/pull/277) ([david22swan](https://github.com/david22swan)) +- Mergeback [#274](https://github.com/puppetlabs/puppetlabs-java/pull/274) ([david22swan](https://github.com/david22swan)) +- MODULE-6105: Move `.sync.yml` travis configuration under `.travis.yml:` [#273](https://github.com/puppetlabs/puppetlabs-java/pull/273) ([](https://github.com/)) +- MODULES-4179 Updated Oracle Java supported list [#272](https://github.com/puppetlabs/puppetlabs-java/pull/272) ([davinhanlon](https://github.com/davinhanlon)) +- Cleanup ruby code via rubocop [#271](https://github.com/puppetlabs/puppetlabs-java/pull/271) ([willmeek](https://github.com/willmeek)) + +## [2.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/2.2.0) - 2017-11-20 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.1.1...2.2.0) + +### Added + +- Adding support for Ubuntu [#243](https://github.com/puppetlabs/puppetlabs-java/pull/243) ([elmobp](https://github.com/elmobp)) + +### Fixed + +- Realpath test fix [#265](https://github.com/puppetlabs/puppetlabs-java/pull/265) ([willmeek](https://github.com/willmeek)) + +## [2.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/2.1.1) - 2017-11-09 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.1.0...2.1.1) + +### Added + +- Add support for CloudLinux [#251](https://github.com/puppetlabs/puppetlabs-java/pull/251) ([shaleenx](https://github.com/shaleenx)) + +### Other + +- allow latest archive version as dependency [#261](https://github.com/puppetlabs/puppetlabs-java/pull/261) ([bastelfreak](https://github.com/bastelfreak)) +- (FACT-1754) search for matching line with java version [#257](https://github.com/puppetlabs/puppetlabs-java/pull/257) ([shuebnersr](https://github.com/shuebnersr)) +- Support for Ubuntu 17.04 Zesty Zapus [#255](https://github.com/puppetlabs/puppetlabs-java/pull/255) ([Andor](https://github.com/Andor)) +- Removing Debian 6 [#254](https://github.com/puppetlabs/puppetlabs-java/pull/254) ([pmcmaw](https://github.com/pmcmaw)) +- (MODULES-5501) - Remove unsupported Ubuntu [#253](https://github.com/puppetlabs/puppetlabs-java/pull/253) ([pmcmaw](https://github.com/pmcmaw)) +- (MODULES-5187) msync puppet 5 and ruby 2.4 [#249](https://github.com/puppetlabs/puppetlabs-java/pull/249) ([eputnam](https://github.com/eputnam)) +- 2.1.0 mergeback [#246](https://github.com/puppetlabs/puppetlabs-java/pull/246) ([hunner](https://github.com/hunner)) +- #MODULES-4069: Fail when required params are not available in params. [#203](https://github.com/puppetlabs/puppetlabs-java/pull/203) ([vStone](https://github.com/vStone)) + +## [2.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/2.1.0) - 2017-06-22 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.0.0...2.1.0) + +### Added -- \[FM-6963\] Removal of unsupported OS from java [\#295](https://github.com/puppetlabs/puppetlabs-java/pull/295) ([david22swan](https://github.com/david22swan)) +- Add support for Archlinux [#244](https://github.com/puppetlabs/puppetlabs-java/pull/244) ([kBite](https://github.com/kBite)) + +### Fixed + +- replace validate_* calls with datatypes & minor fixes [#223](https://github.com/puppetlabs/puppetlabs-java/pull/223) ([bastelfreak](https://github.com/bastelfreak)) + +### Other + +- MODULES-5047 - Update java::oracle class to work with new download URLs [#236](https://github.com/puppetlabs/puppetlabs-java/pull/236) ([HelenCampbell](https://github.com/HelenCampbell)) +- MODULES-5058 Allow a complete URL to be passed to the java::oracle class [#234](https://github.com/puppetlabs/puppetlabs-java/pull/234) ([spynappels](https://github.com/spynappels)) +- Bugfix/modules 4368 java default home invalid fact [#215](https://github.com/puppetlabs/puppetlabs-java/pull/215) ([vStone](https://github.com/vStone)) + +## [2.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/2.0.0) - 2017-05-30 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.6.0...2.0.0) ### Added -- \(MODULES-7561\) - Addition of support for Ubuntu 18.04 to java [\#299](https://github.com/puppetlabs/puppetlabs-java/pull/299) ([david22swan](https://github.com/david22swan)) +- add 'Amazon Linux AMI' supports [#209](https://github.com/puppetlabs/puppetlabs-java/pull/209) ([hedzr](https://github.com/hedzr)) +- Add proxy options for Oracle Java [#188](https://github.com/puppetlabs/puppetlabs-java/pull/188) ([edestecd](https://github.com/edestecd)) +- Add support for Oracle Linux [#185](https://github.com/puppetlabs/puppetlabs-java/pull/185) ([LightAxe](https://github.com/LightAxe)) +- (MODULES-2971) Add java_home to all operating systems [#184](https://github.com/puppetlabs/puppetlabs-java/pull/184) ([ntpttr](https://github.com/ntpttr)) + +### Fixed + +- (MODULES-4751) Fix Archive Order of Operations [#225](https://github.com/puppetlabs/puppetlabs-java/pull/225) ([bstopp](https://github.com/bstopp)) +- Fix naming of version_major and version_minor parameters [#196](https://github.com/puppetlabs/puppetlabs-java/pull/196) ([gzurowski](https://github.com/gzurowski)) + +### Other + +- fixed formatting errors + made various minor changes [#230](https://github.com/puppetlabs/puppetlabs-java/pull/230) ([jbondpdx](https://github.com/jbondpdx)) +- (MODULES-4892) Update metadata [#227](https://github.com/puppetlabs/puppetlabs-java/pull/227) ([chsnell](https://github.com/chsnell)) +- Update OpenJDK packages to 1.8.0 for SLES 12 service packs [#226](https://github.com/puppetlabs/puppetlabs-java/pull/226) ([hlmartin](https://github.com/hlmartin)) +- [MODULES-4736] Increase Xmx setting for java_version fact [#224](https://github.com/puppetlabs/puppetlabs-java/pull/224) ([vchepkov](https://github.com/vchepkov)) +- [msync] 786266 Implement puppet-module-gems, a45803 Remove metadata.json from locales config [#222](https://github.com/puppetlabs/puppetlabs-java/pull/222) ([wilson208](https://github.com/wilson208)) +- Support for Ubuntu 16.10 - Yakkety Yak [#221](https://github.com/puppetlabs/puppetlabs-java/pull/221) ([traylenator](https://github.com/traylenator)) +- [MODULES-4528] Replace Puppet.version.to_f version comparison from spec_helper.rb [#219](https://github.com/puppetlabs/puppetlabs-java/pull/219) ([wilson208](https://github.com/wilson208)) +- [MODULES-4556] Remove PE requirement from metadata.json [#218](https://github.com/puppetlabs/puppetlabs-java/pull/218) ([wilson208](https://github.com/wilson208)) +- Support SLC operatingsystem [#217](https://github.com/puppetlabs/puppetlabs-java/pull/217) ([traylenator](https://github.com/traylenator)) +- pinning to archive 1.2.0, for puppet 3 compat [#216](https://github.com/puppetlabs/puppetlabs-java/pull/216) ([tphoney](https://github.com/tphoney)) +- (MODULES-4098) Sync the rest of the files [#212](https://github.com/puppetlabs/puppetlabs-java/pull/212) ([hunner](https://github.com/hunner)) +- [MODULES-4224] Implement beaker-module_install_helper [#211](https://github.com/puppetlabs/puppetlabs-java/pull/211) ([wilson208](https://github.com/wilson208)) +- (MODULES-4097) Sync travis.yml [#210](https://github.com/puppetlabs/puppetlabs-java/pull/210) ([hunner](https://github.com/hunner)) +- (FM-5972) gettext and spec.opts [#208](https://github.com/puppetlabs/puppetlabs-java/pull/208) ([eputnam](https://github.com/eputnam)) +- (MODULES-3631) msync Gemfile for 1.9 frozen strings [#207](https://github.com/puppetlabs/puppetlabs-java/pull/207) ([hunner](https://github.com/hunner)) +- (MODULES-4081) uses /etc/profile for solaris [#205](https://github.com/puppetlabs/puppetlabs-java/pull/205) ([eputnam](https://github.com/eputnam)) +- (MODULES-3704) Update gemfile template to be identical [#204](https://github.com/puppetlabs/puppetlabs-java/pull/204) ([hunner](https://github.com/hunner)) +- MODULES-4050: Check if jre is in the path before subsubdir. [#202](https://github.com/puppetlabs/puppetlabs-java/pull/202) ([vStone](https://github.com/vStone)) +- mocha version update [#201](https://github.com/puppetlabs/puppetlabs-java/pull/201) ([eputnam](https://github.com/eputnam)) +- java::oracle Do not download archive if already installed [#200](https://github.com/puppetlabs/puppetlabs-java/pull/200) ([edestecd](https://github.com/edestecd)) +- (MODULES-3983) Update parallel_tests for ruby 2.0.0 [#198](https://github.com/puppetlabs/puppetlabs-java/pull/198) ([pmcmaw](https://github.com/pmcmaw)) +- Update modulesync_config [51f469d] [#194](https://github.com/puppetlabs/puppetlabs-java/pull/194) ([DavidS](https://github.com/DavidS)) +- Update documentation about parameters major_version and minor_version [#193](https://github.com/puppetlabs/puppetlabs-java/pull/193) ([gzurowski](https://github.com/gzurowski)) +- Allow targeting specific major/minor Oracle JDK versions [#192](https://github.com/puppetlabs/puppetlabs-java/pull/192) ([gzurowski](https://github.com/gzurowski)) +- support java on debian stretch [#191](https://github.com/puppetlabs/puppetlabs-java/pull/191) ([bodik](https://github.com/bodik)) +- Update modulesync_config [a3fe424] [#190](https://github.com/puppetlabs/puppetlabs-java/pull/190) ([DavidS](https://github.com/DavidS)) +- Support recent java versions > 8u99 built with make-jpkg 0.53 [#187](https://github.com/puppetlabs/puppetlabs-java/pull/187) ([jinnko](https://github.com/jinnko)) +- (MODULES-3581) modulesync [067d08a] [#183](https://github.com/puppetlabs/puppetlabs-java/pull/183) ([DavidS](https://github.com/DavidS)) +- Update SLES 11sp4 packages to Java 1.7.1 [#178](https://github.com/puppetlabs/puppetlabs-java/pull/178) ([tylerjl](https://github.com/tylerjl)) + +## [1.6.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.6.0) - 2016-06-13 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.5.0...1.6.0) ### Fixed -- Remove ensure\_resource to avoid potential conflict [\#287](https://github.com/puppetlabs/puppetlabs-java/pull/287) ([sevencastles](https://github.com/sevencastles)) +- Fix typo in documentation for class oracle [#170](https://github.com/puppetlabs/puppetlabs-java/pull/170) ([gerhardsam](https://github.com/gerhardsam)) +- Fix up rspec deprecation warnings. [#166](https://github.com/puppetlabs/puppetlabs-java/pull/166) ([alexharv074](https://github.com/alexharv074)) -## 2.4.0 -### Summary -This release uses the PDK convert functionality which in return makes the module PDK compliant. Also includes a clean up from Rubocop. +### Other -#### Changed -- 1.3.2 PDK convert has been applied [MODULES-6456](https://tickets.puppetlabs.com/browse/MODULES-6456) -- The modules has undergone a Rubocop cleanup. +- minor edit on new text [#176](https://github.com/puppetlabs/puppetlabs-java/pull/176) ([jbondpdx](https://github.com/jbondpdx)) +- Update java package for SLES 11.4 [#171](https://github.com/puppetlabs/puppetlabs-java/pull/171) ([jonnytdevops](https://github.com/jonnytdevops)) +- Update to newest modulesync_configs [9ca280f] [#169](https://github.com/puppetlabs/puppetlabs-java/pull/169) ([DavidS](https://github.com/DavidS)) +- 1.5.x mergeback [#167](https://github.com/puppetlabs/puppetlabs-java/pull/167) ([bmjen](https://github.com/bmjen)) -#### Fixed -- $java_home for SLES 11.4 has been updated to the correct location. +## [1.5.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.5.0) - 2016-04-12 -## Supported Release [2.3.0] -### Summary -This release is in order to implement Rubocop changes into the module. +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.4.3...1.5.0) -#### Added -- Several Modulesync changes have been made. -- Rubocop has been implemented in the module. -- CentOS 7 is now supported. -- Red Hat Enterprise Linux (RHEL) 7 is now supported. -- Ubuntu artful 1710 now supported. -- Bionic 1804 now supported. +### Added -## Supported Release [2.2.0] -### Summary -This release is a maintenance release that includes a roll up of minor changes. +- Add Ubuntu 16.04 [#164](https://github.com/puppetlabs/puppetlabs-java/pull/164) ([s12v](https://github.com/s12v)) +- Add an example for installing java 8 [#162](https://github.com/puppetlabs/puppetlabs-java/pull/162) ([npwalker](https://github.com/npwalker)) +- Add support for official Oracle Java SE jdk and jre packages for CentOS [#159](https://github.com/puppetlabs/puppetlabs-java/pull/159) ([mmarseglia](https://github.com/mmarseglia)) +- (MODULES-2928) Adds FreeBSD Support [#153](https://github.com/puppetlabs/puppetlabs-java/pull/153) ([petems](https://github.com/petems)) +- Added support for oracle-j2re1.8 and oracle-j2sdk1.8 [#152](https://github.com/puppetlabs/puppetlabs-java/pull/152) ([thomasodus](https://github.com/thomasodus)) -#### Added -- Addition of Ubuntu for Oracle Java. -- Addition of Debian 9 in supported versions. -- Addition of OpenBSD case and use `realpath` rather than `readlink` in Java Default Home Facter fact. +### Fixed -#### Removed -- Removal of OpenBSD as a special case and deprecated `with_env` in Java Version Facter Facter fact. +- Fix typo in README.markdown [#165](https://github.com/puppetlabs/puppetlabs-java/pull/165) ([alexharv074](https://github.com/alexharv074)) -## Supported Release 2.1.1 -### Summary -This release is a maintenance release that includes a roll up of minor changes. +### Other -#### Added -- Basic Arch Linux, Cloud Linux and Ubuntu 17.04 compatibility. -- Metadata bump for Puppet 5. -- Search for matching line with java version. -- ([MODULES-4069](https://tickets.puppet.com/browse/MODULES-4069)) Fail when required params are not available in params. -- A test for java version when java not installed. -- Allow latest archive version as dependency. +- Use java 8 as the default on RHEL > 7.0 [#160](https://github.com/puppetlabs/puppetlabs-java/pull/160) ([jyaworski](https://github.com/jyaworski)) +- Update metadata to note Debian 8 support [#158](https://github.com/puppetlabs/puppetlabs-java/pull/158) ([DavidS](https://github.com/DavidS)) +- (FM-4046) Update to current msync configs [006831f] [#157](https://github.com/puppetlabs/puppetlabs-java/pull/157) ([DavidS](https://github.com/DavidS)) +- Allow tildes in version to support webupd8team's packages [#156](https://github.com/puppetlabs/puppetlabs-java/pull/156) ([joerayme](https://github.com/joerayme)) +- (FM-4049) update to modulesync_configs [#154](https://github.com/puppetlabs/puppetlabs-java/pull/154) ([DavidS](https://github.com/DavidS)) +- Can now pass options to package provider [#151](https://github.com/puppetlabs/puppetlabs-java/pull/151) ([tux-o-matic](https://github.com/tux-o-matic)) +- 1.4.x Mergeback [#150](https://github.com/puppetlabs/puppetlabs-java/pull/150) ([HelenCampbell](https://github.com/HelenCampbell)) -#### Changed -- CONTRIBUTING.md document includes updates. -- Removal of Ubuntu 10.04 ad 12.04, Debian 6 in supported versions. +## [1.4.3](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.3) - 2015-12-07 -## Supported Release 2.1.0 -### Summary -This release adds fixes to restore the ability to install Oracle Java. It also fixes the paths for the latest RHEL 7 1.7.0 and 1.8.0 OpenJDKs. +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.4.2...1.4.3) ### Added -- java::oracle parameter `url` -- java::oracle parameter `url_hash` + +- Add support for Ubuntu 15.10 [#147](https://github.com/puppetlabs/puppetlabs-java/pull/147) ([oc243](https://github.com/oc243)) +- add two facts: libjvm and java executable paths [#117](https://github.com/puppetlabs/puppetlabs-java/pull/117) ([faxm0dem](https://github.com/faxm0dem)) + +### Other + +- update fixtures.yml to use git instead of http [#145](https://github.com/puppetlabs/puppetlabs-java/pull/145) ([bmjen](https://github.com/bmjen)) + +## [1.4.2](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.2) - 2015-10-07 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.4.1...1.4.2) ### Fixed -- Let `java_default_home` fact work when /usr/bin/java does not exist -- Add puppet 4 parameter types -- Use `/usr/lib/jvm/java-1.x.0` symlinks for `java_home` defaults. - -## Supported Release 2.0.0 -### Summary - -This is a major release including some bug fixes, new parameters, and general module updates. - -**This release drops Puppet 3 support** - -#### Added -- Debian Stretch, Yakkety Yak, Amazon Linux, Oracle Linux, Scientific Linux CERN compatibility -- `version_major` and `version_minor` parameters for specifying Java SE version to install -- `$JAVA_HOME` now set by the module on compatible systems. The `java_home` parameter is also provided for manual setting. [MODULES-2971](https://tickets.puppetlabs.com/browse/MODULES-2971) -- `proxy_server` and `proxy_type` for choosing a proxy server to get Java from - -#### Changed -- Moved lower Puppet version requirement to 4.7.0 - -#### Fixed -- Module no longer downloads the Java archive on Puppet runs if Java is already installed. -- java_default_home fact is not always correct on oracle packages [MODULES-4050](https://tickets.puppetlabs.com/browse/MODULES-4050) -- Order of operations for archives [MODULES-4751](https://tickets.puppetlabs.com/browse/https://tickets.puppetlabs.com/browse/MODULES-4751) -- Increase Xmx setting for `java_version` fact [MODULES-4736](https://tickets.puppetlabs.com/browse/MODULES-4736) - -## Supported Release 1.6.0 -### Summary - -Addition of a new supported OS, along with several other features and bugfixes. - -#### Features -- Ubuntu 16.04 support. -- Addition example for installing Java 8. -- Update to newest modulesync_configs. -- Addition of RedHat for Oracle Java. - -#### Bugfixes -- Custom archive type now given extract_path. -- Fix for rspec deprectation warnings. -- Typo fixes for readme. -- Fixed tests to run under strict variables. -- Updated Java package for SLES 11.4. - -## Supported Release 1.5.0 -### Summary -A release which has several support additions for different OSes. Also a couple of additional features and a few bug fixes. +- Fix rspec deprecation warnings. .should -> expect().to [#141](https://github.com/puppetlabs/puppetlabs-java/pull/141) ([vStone](https://github.com/vStone)) -#### Features -- Added Ubuntu 15.10 compatibility. -- Addition of two facts: java_libjvm_path and java_default_home. -- Added support for oracle-j2re1.8 and oracle-j2sdk1.8. -- Adds FreeBSD Support. -- Exposed the Puppet package resources install_options parameter via a new class parameter named package_options. -- Debian 8 support. -- Add support for official Oracle Java SE jdk and jre packages for CentOS. -- Use java 8 as the default on RHEL > 7.0. +### Other -#### Bugfixes -- Updated fixtures.yml to use git instead of http for stdlib. -- Updates to current msync configs. -- Small README updates and syntax error fixes. +- Update 1.4.x with master changes [#143](https://github.com/puppetlabs/puppetlabs-java/pull/143) ([hunner](https://github.com/hunner)) +- (MODULES-2637) Checks java actually installed [#142](https://github.com/puppetlabs/puppetlabs-java/pull/142) ([DavidS](https://github.com/DavidS)) +- mergeback 1.4.x [#137](https://github.com/puppetlabs/puppetlabs-java/pull/137) ([hunner](https://github.com/hunner)) -## Supported Release 1.4.3 -### Summary +## [1.4.1](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.1) - 2015-07-15 -Small release for support of newer PE versions. This increments the version of PE in the metadata.json file. +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.4.0...1.4.1) -## 2015-10-07 - Supported Release 1.4.2 -### Summary -This release fixes the fact to not trigger java every time on OS X when it is not available. +### Added -#### Bugfixes -- Causes java\_version fact to not run `java` when java is not installed on OS X +- Add OEL operatingsystem to java::params [#135](https://github.com/puppetlabs/puppetlabs-java/pull/135) ([zreichert](https://github.com/zreichert)) -## 2015-07-16 - Supported Release 1.4.1 -### Summary -This release updates the metadata for the upcoming release of PE and update params for OEL to match metadata +### Other -#### Bugfixes: -- Add missing OEL to params +- Merge 1.4.x to master [#134](https://github.com/puppetlabs/puppetlabs-java/pull/134) ([underscorgan](https://github.com/underscorgan)) -## 2015-07-07 - Supported Release 1.4.0 -### Summary -This release adds several new features, bugfixes, documentation updates, and test improvements. +## [1.4.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.0) - 2015-07-08 -#### Features: -- Puppet 4 support and testing -- Adds support for several Operating Systems - - Ubuntu 15.04 - - OpenBSD 5.6, 5.7 - - Fedora 20, 21, 22 +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.3.0...1.4.0) -#### Bugfixes: -- Fixes java_version fact to work on large systems. (MODULES-1749) -- Improves maintainability of java_version fact. -- Fixes java package names on Fedora 21+. -- Fixes java install problems on Puppet 3.7.5 - 3.8.1 (PUP-4520) -- Fixes create-java-alternatives commands on RedHat distros. -- Fixes bug with Debian systems missing java-common package. +### Added -## 2015-01-20 - Supported Release 1.3.0 -### Summary -This release adds 3 new facts for determining Java version, adds RHEL alternatives support, adds utopic support, and fixes the flag for `update-java-alternatives` when installed from a headless pacakge. +- (MODULES-2068) add fedora to metadata.json operatingsystem_support list [#129](https://github.com/puppetlabs/puppetlabs-java/pull/129) ([bmjen](https://github.com/bmjen)) +- Add helper to install puppet/pe/puppet-agent [#123](https://github.com/puppetlabs/puppetlabs-java/pull/123) ([hunner](https://github.com/hunner)) +- (BKR-147) add Gemfile setting for BEAKER_VERSION for puppet... [#115](https://github.com/puppetlabs/puppetlabs-java/pull/115) ([anodelman](https://github.com/anodelman)) -#### Features -- Added RHEL support for alternatives -- New facts - - java_major_version - - java_patch_level - - java_version -- Add support for utopic +### Fixed -#### Bugfixes -- Use `--jre-headless` in the `update-java-alternatives` command when installed from a `headless` package +- Fix incorrect metadata [#133](https://github.com/puppetlabs/puppetlabs-java/pull/133) ([hunner](https://github.com/hunner)) +- (MODULES-2095) fixes create-java-alternatives command [#128](https://github.com/puppetlabs/puppetlabs-java/pull/128) ([bmjen](https://github.com/bmjen)) +- Fix Fedora 21+ package name [#104](https://github.com/puppetlabs/puppetlabs-java/pull/104) ([cottsay](https://github.com/cottsay)) -## 2014-11-11 - Supported Version 1.2.0 +### Other -### Summary: -This release adds SLES 12 support and is tested for Future Parser Support +- updates metadata.json to include support for PE up to 2015.2.x [#132](https://github.com/puppetlabs/puppetlabs-java/pull/132) ([bmjen](https://github.com/bmjen)) +- re-orders case statements in manifests to workaround PUP-4520. [#127](https://github.com/puppetlabs/puppetlabs-java/pull/127) ([bmjen](https://github.com/bmjen)) +- Install update-java-alternatives on Debian for the java::config class [#126](https://github.com/puppetlabs/puppetlabs-java/pull/126) ([danielparks](https://github.com/danielparks)) +- Updated travisci file to remove allow_failures on Puppet 4 [#121](https://github.com/puppetlabs/puppetlabs-java/pull/121) ([jonnytdevops](https://github.com/jonnytdevops)) +- Modulesync updates [#118](https://github.com/puppetlabs/puppetlabs-java/pull/118) ([underscorgan](https://github.com/underscorgan)) +- Edits to param descriptions and other small changes in the README. [#113](https://github.com/puppetlabs/puppetlabs-java/pull/113) ([jtappa](https://github.com/jtappa)) +- Extend Limitations section [#110](https://github.com/puppetlabs/puppetlabs-java/pull/110) ([antaflos](https://github.com/antaflos)) +- Improve java_version fact maintainability [#107](https://github.com/puppetlabs/puppetlabs-java/pull/107) ([elyscape](https://github.com/elyscape)) +- (MODULES-1749) Update java_version fact with maximum memory size [#106](https://github.com/puppetlabs/puppetlabs-java/pull/106) ([petems](https://github.com/petems)) +- Pin rspec gems [#105](https://github.com/puppetlabs/puppetlabs-java/pull/105) ([cmurphy](https://github.com/cmurphy)) +- Merge 1.3.x to master [#100](https://github.com/puppetlabs/puppetlabs-java/pull/100) ([underscorgan](https://github.com/underscorgan)) -#### Bugfixes: -- Several readme updates -- Testcase flexability increased +## [1.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.3.0) - 2015-01-20 -#### Features: -- Add SLES 12 support -- Future Parser tested -- Validated against PE 3.7 +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.2.0...1.3.0) -## 2014-08-25 - Supported Version 1.1.2 +### Added -### Summary: -This release begins the support coverage of the puppetlabs-java module. +- FM-1523: Added module summary to metadata.json [#90](https://github.com/puppetlabs/puppetlabs-java/pull/90) ([jbondpdx](https://github.com/jbondpdx)) +- Add Java alternatives for RHEL based distros. [#89](https://github.com/puppetlabs/puppetlabs-java/pull/89) ([rdrgmnzs](https://github.com/rdrgmnzs)) +- add utopic support [#88](https://github.com/puppetlabs/puppetlabs-java/pull/88) ([pherjung](https://github.com/pherjung)) +- Revert "Add alternative support for RedHat" [#87](https://github.com/puppetlabs/puppetlabs-java/pull/87) ([underscorgan](https://github.com/underscorgan)) +- cosmetic change to add missing space to bullet point in markdown so it r... [#80](https://github.com/puppetlabs/puppetlabs-java/pull/80) ([stevenalexander](https://github.com/stevenalexander)) +- Add alternative support for RedHat [#61](https://github.com/puppetlabs/puppetlabs-java/pull/61) ([rdrgmnzs](https://github.com/rdrgmnzs)) -### Bugfixes: -- Update java alternative values from deprecated names -- Readme updated -- Testing updated +### Fixed -## 2014-05-02 - Version 1.1.1 +- Acceptance test fix for wheezy [#96](https://github.com/puppetlabs/puppetlabs-java/pull/96) ([underscorgan](https://github.com/underscorgan)) +- Test fix for RHEL with alternatives [#94](https://github.com/puppetlabs/puppetlabs-java/pull/94) ([underscorgan](https://github.com/underscorgan)) -### Summary: +### Other -Add support for new versions of Debian and Ubuntu! +- Use --jre-headless instead of --jre [#97](https://github.com/puppetlabs/puppetlabs-java/pull/97) ([electrical](https://github.com/electrical)) +- Sync with modulesync [#95](https://github.com/puppetlabs/puppetlabs-java/pull/95) ([cmurphy](https://github.com/cmurphy)) +- Sync files with modulesync [#93](https://github.com/puppetlabs/puppetlabs-java/pull/93) ([underscorgan](https://github.com/underscorgan)) +- MODULES-1570 Java Version facts [#92](https://github.com/puppetlabs/puppetlabs-java/pull/92) ([petems](https://github.com/petems)) +- variable best practice (stop yelling at me linter) [#91](https://github.com/puppetlabs/puppetlabs-java/pull/91) ([justinstoller](https://github.com/justinstoller)) +- Merge 1.2.x [#86](https://github.com/puppetlabs/puppetlabs-java/pull/86) ([underscorgan](https://github.com/underscorgan)) +- cosmetic: default in last position [#76](https://github.com/puppetlabs/puppetlabs-java/pull/76) ([PierreR](https://github.com/PierreR)) -#### Features: -- Add support for Ubuntu Trusty (14.04) -- Add support for Debian Jessie (8.x) +## [1.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.2.0) - 2014-11-10 -## 2014-01-06 - Version 1.1.0 +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.1.2...1.2.0) -### Summary: +### Fixed -Primarily a release for Ubuntu users! +- Fix syntax [#77](https://github.com/puppetlabs/puppetlabs-java/pull/77) ([PierreR](https://github.com/PierreR)) -#### Features: -- Add support for Ubuntu Saucy (13.10) -- Add `java_home` parameter for centralized setting of JAVA_HOME. -- Add Scientific Linux +### Other -#### Bugfixes: -- Plus signs are valid in debian/ubuntu package names. +- Remove misleading changelog, no readme changes done [#85](https://github.com/puppetlabs/puppetlabs-java/pull/85) ([cyberious](https://github.com/cyberious)) +- Fixed issue with installing stdlib on certain platforms due to ssl issues [#82](https://github.com/puppetlabs/puppetlabs-java/pull/82) ([cyberious](https://github.com/cyberious)) +- Remove puppet_module_install in favor of copy_module_to [#79](https://github.com/puppetlabs/puppetlabs-java/pull/79) ([cyberious](https://github.com/cyberious)) +- place default case last in selectors [#64](https://github.com/puppetlabs/puppetlabs-java/pull/64) ([kian](https://github.com/kian)) -## 2013-08-01 - Version 1.0.1 +## [1.1.2](https://github.com/puppetlabs/puppetlabs-java/tree/1.1.2) - 2014-09-03 -Matthaus Owens -* Update java packages for Fedora systems +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.1.1...1.1.2) -## 2013-07-29 - Version 1.0.0 +### Added -#### Detailed Changes +- Add metadata.json and remove Modulefile [#65](https://github.com/puppetlabs/puppetlabs-java/pull/65) ([hunner](https://github.com/hunner)) -Krzysztof Suszyński -* Adding support for Oracle Enterprise Linux +### Other -Peter Drake -* Add support for natty +- OEL 5 is trying to use up2date which doesn't work [#78](https://github.com/puppetlabs/puppetlabs-java/pull/78) ([hunner](https://github.com/hunner)) +- Ah hah, got it [#75](https://github.com/puppetlabs/puppetlabs-java/pull/75) ([hunner](https://github.com/hunner)) +- Maybe spec filters work like this [#74](https://github.com/puppetlabs/puppetlabs-java/pull/74) ([hunner](https://github.com/hunner)) +- Spec typo [#73](https://github.com/puppetlabs/puppetlabs-java/pull/73) ([hunner](https://github.com/hunner)) +- Misplaced comma [#72](https://github.com/puppetlabs/puppetlabs-java/pull/72) ([hunner](https://github.com/hunner)) +- Remove sci 7 from metadata [#71](https://github.com/puppetlabs/puppetlabs-java/pull/71) ([hunner](https://github.com/hunner)) +- Update spec_helper for consistency [#69](https://github.com/puppetlabs/puppetlabs-java/pull/69) ([underscorgan](https://github.com/underscorgan)) +- Make deb work [#67](https://github.com/puppetlabs/puppetlabs-java/pull/67) ([hunner](https://github.com/hunner)) +- Java readme [#62](https://github.com/puppetlabs/puppetlabs-java/pull/62) ([jbondpdx](https://github.com/jbondpdx)) -Robert Munteanu -* Add support for OpenSUSE +## [1.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/1.1.1) - 2014-05-02 -Martin Jackson -* Added support Amazon Linux using facter >= 1.7.x +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.1.0...1.1.1) -Gareth Rushgrove -Brett Porter -* Fixes for older versions of CentOS -* Improvements to module build and tests +### Added + +- Added jessie as a supported realese [#56](https://github.com/puppetlabs/puppetlabs-java/pull/56) ([3h4x](https://github.com/3h4x)) +- add support for ubuntu 14.04 trusty [#55](https://github.com/puppetlabs/puppetlabs-java/pull/55) ([atta](https://github.com/atta)) -Nathan R Valentine -* Add support for Ubuntu quantal and raring +## [1.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.1.0) - 2014-01-06 -Sharif Nassar -* Add support for Debian alternatives, and more than one JDK/JRE per platform. +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.0.1...1.1.0) -## 2013-04-04 - Version 0.3.0 -Reid Vandewiele - -* Refactor, introduce params pattern +### Added -## 2012-11-15 - Version 0.2.0 -Scott Schneider -* Add Solaris support +- Add $java_home variable [#47](https://github.com/puppetlabs/puppetlabs-java/pull/47) ([liwo](https://github.com/liwo)) +- adding support for ubuntu saucy [#46](https://github.com/puppetlabs/puppetlabs-java/pull/46) ([ppouliot](https://github.com/ppouliot)) -## 2011-06-16 - Version 0.1.5 -Jeff McCune -* Add Debian based distro (Lucid) support +### Fixed -## 2011-06-02 - Version 0.1.4 -Jeff McCune -* Fix class composition ordering problems +- Fix travis script. [#36](https://github.com/puppetlabs/puppetlabs-java/pull/36) ([apenney](https://github.com/apenney)) -## 2011-05-28 - Version 0.1.3 -Jeff McCune -* Remove stages +### Other -## 2011-05-26 - Version 0.1.2 -Jeff McCune -* Changes JRE/JDK selection class parameter to $distribution +- plus signs are valid in debian/ubuntu package versions [#50](https://github.com/puppetlabs/puppetlabs-java/pull/50) ([CpuID](https://github.com/CpuID)) +- Update params.pp [#44](https://github.com/puppetlabs/puppetlabs-java/pull/44) ([jengels](https://github.com/jengels)) +- Support Scientific Linux [#38](https://github.com/puppetlabs/puppetlabs-java/pull/38) ([brettporter](https://github.com/brettporter)) +- CHANGELOG for 1.0.1 [#35](https://github.com/puppetlabs/puppetlabs-java/pull/35) ([brettporter](https://github.com/brettporter)) -## 2011-05-25 - Version 0.1.1 -Jeff McCune -* Re-did versioning to follow semantic versioning -* Add validation of class parameters +## [1.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/1.0.1) - 2013-08-01 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.3.0...1.0.1) + +### Added -## 2011-05-24 - Version 0.1.0 -Jeff McCune -* Default to JDK version 6u25 +- Add a .travis.yml file. [#32](https://github.com/puppetlabs/puppetlabs-java/pull/32) ([apenney](https://github.com/apenney)) +- Added support for Amazon linux [#29](https://github.com/puppetlabs/puppetlabs-java/pull/29) ([actionjack](https://github.com/actionjack)) +- Add support for OpenSUSE [#27](https://github.com/puppetlabs/puppetlabs-java/pull/27) ([rombert](https://github.com/rombert)) +- add support for Ubuntu quantal and raring [#26](https://github.com/puppetlabs/puppetlabs-java/pull/26) ([nrvale0](https://github.com/nrvale0)) -## 2011-05-24 - Version 0.0.1 -Jeff McCune -* Initial release +### Fixed + +- Fixes for centos versions [#24](https://github.com/puppetlabs/puppetlabs-java/pull/24) ([garethr](https://github.com/garethr)) + +### Other + +- Update fedora java [#34](https://github.com/puppetlabs/puppetlabs-java/pull/34) ([haus](https://github.com/haus)) +- Update version to 1.0.0 [#31](https://github.com/puppetlabs/puppetlabs-java/pull/31) ([brettporter](https://github.com/brettporter)) +- Support multiple JVM, and Debian alternatives. [#28](https://github.com/puppetlabs/puppetlabs-java/pull/28) ([mrwacky42](https://github.com/mrwacky42)) + +## [0.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/0.3.0) - 2013-05-08 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.2.0...0.3.0) + +### Added + +- Add special case for fedora operating systems, where java is installable... [#23](https://github.com/puppetlabs/puppetlabs-java/pull/23) ([haus](https://github.com/haus)) +- Adding java::package_suse class [#22](https://github.com/puppetlabs/puppetlabs-java/pull/22) ([sschneid](https://github.com/sschneid)) + +### Other + +- Reduce complexity [#25](https://github.com/puppetlabs/puppetlabs-java/pull/25) ([reidmv](https://github.com/reidmv)) + +## [0.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/0.2.0) - 2012-11-15 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v0.1.5...0.2.0) + +### Added + +- Add Solaris support [#18](https://github.com/puppetlabs/puppetlabs-java/pull/18) ([sschneid](https://github.com/sschneid)) +- 4 - Add license file. [#8](https://github.com/puppetlabs/puppetlabs-java/pull/8) ([kbarber](https://github.com/kbarber)) + +### Other + +- Use osfamily instead of operatingsystem to determine package [#14](https://github.com/puppetlabs/puppetlabs-java/pull/14) ([eshamow](https://github.com/eshamow)) +- Moves debain packages to openjdk. [#13](https://github.com/puppetlabs/puppetlabs-java/pull/13) ([ody](https://github.com/ody)) +- Allow distributions starting with string `java` [#11](https://github.com/puppetlabs/puppetlabs-java/pull/11) ([ccaum](https://github.com/ccaum)) +- 9 - remove empty metadata.json from repo to avoid errors when using from [#10](https://github.com/puppetlabs/puppetlabs-java/pull/10) ([kbarber](https://github.com/kbarber)) +- 5 - Provide a preseed file that preseeds license signing for java package [#7](https://github.com/puppetlabs/puppetlabs-java/pull/7) ([kbarber](https://github.com/kbarber)) + +## [v0.1.5](https://github.com/puppetlabs/puppetlabs-java/tree/v0.1.5) - 2011-06-16 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.1.4...v0.1.5) + +## [0.1.4](https://github.com/puppetlabs/puppetlabs-java/tree/0.1.4) - 2011-06-02 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.1.3...0.1.4) + +## [0.1.3](https://github.com/puppetlabs/puppetlabs-java/tree/0.1.3) - 2011-05-28 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.1.2...0.1.3) + +## [0.1.2](https://github.com/puppetlabs/puppetlabs-java/tree/0.1.2) - 2011-05-26 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.1.1...0.1.2) + +## [0.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/0.1.1) - 2011-05-25 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.0.1...0.1.1) + +### Added -[2.3.0]:https://github.com/puppetlabs/puppetlabs-java/compare/2.2.0...2.3.0 -[2.2.0]:https://github.com/puppetlabs/puppetlabs-java/compare/2.1.1...2.2.0 +- Add basic validation to class parameters [#1](https://github.com/puppetlabs/puppetlabs-java/pull/1) ([jeffmccune](https://github.com/jeffmccune)) +## [0.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/0.0.1) - 2011-05-24 -\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)* +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/55a2ab8b198b806e2e8866fc46165e4a10ebe043...0.0.1) diff --git a/metadata.json b/metadata.json index cf432393..02a8f790 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "10.0.0", + "version": "10.1.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From f402091ae148a8500e136ddabd589399b6b47806 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Fri, 30 Jun 2023 08:32:34 +0530 Subject: [PATCH 209/259] (CONT-1179) - Fixing build failures --- manifests/init.pp | 10 ++++++++++ spec/classes/java_spec.rb | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 7e40c6f5..c2295fb6 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -110,6 +110,16 @@ default => '--jre' } + # Enable legacy repo to install net-tools-deprecated package + # If SUSE OS major version is >= 15 and minor version is > 3 + if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['major'], '15') >= 0 and versioncmp($facts['os']['release']['minor'], '3') == 1) { + exec { 'Enable legacy repos': + path => '/bin:/usr/bin/:/sbin:/usr/sbin', + command => 'SUSEConnect --product sle-module-legacy/15.4/x86_64', + unless => 'SUSEConnect --status-text | grep sle-module-legacy/15.4/x86_64', + } + } + if $facts['os']['family'] == 'Debian' { # Needed for update-java-alternatives package { 'java-common': diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index de2f3966..61f357fb 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -144,14 +144,14 @@ end context 'when selecting default for SLES 11.3' do - let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.3' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.3', major: '11', minor: '3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_6_0-ibm-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.6.0-ibm-1.6.0/') } end context 'when selecting default for SLES 11.4' do - let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.4' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'Suse', name: 'SLES', release: { full: '11.4', major: '11', minor: '4' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_1-ibm-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.1-ibm-1.7.1/') } From c84d927998ffa4ccaf6b3f7107a3f7ebc3895aca Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 3 Jul 2023 04:11:52 +0000 Subject: [PATCH 210/259] Release prep v10.1.1 --- CHANGELOG.md | 157 ++------------------------------------------------ metadata.json | 2 +- 2 files changed, 6 insertions(+), 153 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 63aba24e..1313a6d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ 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). +## [v10.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/v10.1.1) - 2023-07-03 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.0...v10.1.1) + ## [v10.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v10.1.0) - 2023-06-20 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.0.0...v10.1.0) @@ -332,14 +336,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add support for Ubuntu artful (17.10) and bionic (18.04 to be) [#270](https://github.com/puppetlabs/puppetlabs-java/pull/270) ([mhjacks](https://github.com/mhjacks)) -### Other - -- 2.3.0PreRelease [#277](https://github.com/puppetlabs/puppetlabs-java/pull/277) ([david22swan](https://github.com/david22swan)) -- Mergeback [#274](https://github.com/puppetlabs/puppetlabs-java/pull/274) ([david22swan](https://github.com/david22swan)) -- MODULE-6105: Move `.sync.yml` travis configuration under `.travis.yml:` [#273](https://github.com/puppetlabs/puppetlabs-java/pull/273) ([](https://github.com/)) -- MODULES-4179 Updated Oracle Java supported list [#272](https://github.com/puppetlabs/puppetlabs-java/pull/272) ([davinhanlon](https://github.com/davinhanlon)) -- Cleanup ruby code via rubocop [#271](https://github.com/puppetlabs/puppetlabs-java/pull/271) ([willmeek](https://github.com/willmeek)) - ## [2.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/2.2.0) - 2017-11-20 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.1.1...2.2.0) @@ -360,16 +356,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add support for CloudLinux [#251](https://github.com/puppetlabs/puppetlabs-java/pull/251) ([shaleenx](https://github.com/shaleenx)) -### Other +### Fixed -- allow latest archive version as dependency [#261](https://github.com/puppetlabs/puppetlabs-java/pull/261) ([bastelfreak](https://github.com/bastelfreak)) - (FACT-1754) search for matching line with java version [#257](https://github.com/puppetlabs/puppetlabs-java/pull/257) ([shuebnersr](https://github.com/shuebnersr)) -- Support for Ubuntu 17.04 Zesty Zapus [#255](https://github.com/puppetlabs/puppetlabs-java/pull/255) ([Andor](https://github.com/Andor)) -- Removing Debian 6 [#254](https://github.com/puppetlabs/puppetlabs-java/pull/254) ([pmcmaw](https://github.com/pmcmaw)) -- (MODULES-5501) - Remove unsupported Ubuntu [#253](https://github.com/puppetlabs/puppetlabs-java/pull/253) ([pmcmaw](https://github.com/pmcmaw)) -- (MODULES-5187) msync puppet 5 and ruby 2.4 [#249](https://github.com/puppetlabs/puppetlabs-java/pull/249) ([eputnam](https://github.com/eputnam)) -- 2.1.0 mergeback [#246](https://github.com/puppetlabs/puppetlabs-java/pull/246) ([hunner](https://github.com/hunner)) -- #MODULES-4069: Fail when required params are not available in params. [#203](https://github.com/puppetlabs/puppetlabs-java/pull/203) ([vStone](https://github.com/vStone)) ## [2.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/2.1.0) - 2017-06-22 @@ -382,11 +371,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Fixed - replace validate_* calls with datatypes & minor fixes [#223](https://github.com/puppetlabs/puppetlabs-java/pull/223) ([bastelfreak](https://github.com/bastelfreak)) - -### Other - -- MODULES-5047 - Update java::oracle class to work with new download URLs [#236](https://github.com/puppetlabs/puppetlabs-java/pull/236) ([HelenCampbell](https://github.com/HelenCampbell)) -- MODULES-5058 Allow a complete URL to be passed to the java::oracle class [#234](https://github.com/puppetlabs/puppetlabs-java/pull/234) ([spynappels](https://github.com/spynappels)) - Bugfix/modules 4368 java default home invalid fact [#215](https://github.com/puppetlabs/puppetlabs-java/pull/215) ([vStone](https://github.com/vStone)) ## [2.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/2.0.0) - 2017-05-30 @@ -405,38 +389,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - (MODULES-4751) Fix Archive Order of Operations [#225](https://github.com/puppetlabs/puppetlabs-java/pull/225) ([bstopp](https://github.com/bstopp)) - Fix naming of version_major and version_minor parameters [#196](https://github.com/puppetlabs/puppetlabs-java/pull/196) ([gzurowski](https://github.com/gzurowski)) -### Other - -- fixed formatting errors + made various minor changes [#230](https://github.com/puppetlabs/puppetlabs-java/pull/230) ([jbondpdx](https://github.com/jbondpdx)) -- (MODULES-4892) Update metadata [#227](https://github.com/puppetlabs/puppetlabs-java/pull/227) ([chsnell](https://github.com/chsnell)) -- Update OpenJDK packages to 1.8.0 for SLES 12 service packs [#226](https://github.com/puppetlabs/puppetlabs-java/pull/226) ([hlmartin](https://github.com/hlmartin)) -- [MODULES-4736] Increase Xmx setting for java_version fact [#224](https://github.com/puppetlabs/puppetlabs-java/pull/224) ([vchepkov](https://github.com/vchepkov)) -- [msync] 786266 Implement puppet-module-gems, a45803 Remove metadata.json from locales config [#222](https://github.com/puppetlabs/puppetlabs-java/pull/222) ([wilson208](https://github.com/wilson208)) -- Support for Ubuntu 16.10 - Yakkety Yak [#221](https://github.com/puppetlabs/puppetlabs-java/pull/221) ([traylenator](https://github.com/traylenator)) -- [MODULES-4528] Replace Puppet.version.to_f version comparison from spec_helper.rb [#219](https://github.com/puppetlabs/puppetlabs-java/pull/219) ([wilson208](https://github.com/wilson208)) -- [MODULES-4556] Remove PE requirement from metadata.json [#218](https://github.com/puppetlabs/puppetlabs-java/pull/218) ([wilson208](https://github.com/wilson208)) -- Support SLC operatingsystem [#217](https://github.com/puppetlabs/puppetlabs-java/pull/217) ([traylenator](https://github.com/traylenator)) -- pinning to archive 1.2.0, for puppet 3 compat [#216](https://github.com/puppetlabs/puppetlabs-java/pull/216) ([tphoney](https://github.com/tphoney)) -- (MODULES-4098) Sync the rest of the files [#212](https://github.com/puppetlabs/puppetlabs-java/pull/212) ([hunner](https://github.com/hunner)) -- [MODULES-4224] Implement beaker-module_install_helper [#211](https://github.com/puppetlabs/puppetlabs-java/pull/211) ([wilson208](https://github.com/wilson208)) -- (MODULES-4097) Sync travis.yml [#210](https://github.com/puppetlabs/puppetlabs-java/pull/210) ([hunner](https://github.com/hunner)) -- (FM-5972) gettext and spec.opts [#208](https://github.com/puppetlabs/puppetlabs-java/pull/208) ([eputnam](https://github.com/eputnam)) -- (MODULES-3631) msync Gemfile for 1.9 frozen strings [#207](https://github.com/puppetlabs/puppetlabs-java/pull/207) ([hunner](https://github.com/hunner)) -- (MODULES-4081) uses /etc/profile for solaris [#205](https://github.com/puppetlabs/puppetlabs-java/pull/205) ([eputnam](https://github.com/eputnam)) -- (MODULES-3704) Update gemfile template to be identical [#204](https://github.com/puppetlabs/puppetlabs-java/pull/204) ([hunner](https://github.com/hunner)) -- MODULES-4050: Check if jre is in the path before subsubdir. [#202](https://github.com/puppetlabs/puppetlabs-java/pull/202) ([vStone](https://github.com/vStone)) -- mocha version update [#201](https://github.com/puppetlabs/puppetlabs-java/pull/201) ([eputnam](https://github.com/eputnam)) -- java::oracle Do not download archive if already installed [#200](https://github.com/puppetlabs/puppetlabs-java/pull/200) ([edestecd](https://github.com/edestecd)) -- (MODULES-3983) Update parallel_tests for ruby 2.0.0 [#198](https://github.com/puppetlabs/puppetlabs-java/pull/198) ([pmcmaw](https://github.com/pmcmaw)) -- Update modulesync_config [51f469d] [#194](https://github.com/puppetlabs/puppetlabs-java/pull/194) ([DavidS](https://github.com/DavidS)) -- Update documentation about parameters major_version and minor_version [#193](https://github.com/puppetlabs/puppetlabs-java/pull/193) ([gzurowski](https://github.com/gzurowski)) -- Allow targeting specific major/minor Oracle JDK versions [#192](https://github.com/puppetlabs/puppetlabs-java/pull/192) ([gzurowski](https://github.com/gzurowski)) -- support java on debian stretch [#191](https://github.com/puppetlabs/puppetlabs-java/pull/191) ([bodik](https://github.com/bodik)) -- Update modulesync_config [a3fe424] [#190](https://github.com/puppetlabs/puppetlabs-java/pull/190) ([DavidS](https://github.com/DavidS)) -- Support recent java versions > 8u99 built with make-jpkg 0.53 [#187](https://github.com/puppetlabs/puppetlabs-java/pull/187) ([jinnko](https://github.com/jinnko)) -- (MODULES-3581) modulesync [067d08a] [#183](https://github.com/puppetlabs/puppetlabs-java/pull/183) ([DavidS](https://github.com/DavidS)) -- Update SLES 11sp4 packages to Java 1.7.1 [#178](https://github.com/puppetlabs/puppetlabs-java/pull/178) ([tylerjl](https://github.com/tylerjl)) - ## [1.6.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.6.0) - 2016-06-13 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.5.0...1.6.0) @@ -446,13 +398,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Fix typo in documentation for class oracle [#170](https://github.com/puppetlabs/puppetlabs-java/pull/170) ([gerhardsam](https://github.com/gerhardsam)) - Fix up rspec deprecation warnings. [#166](https://github.com/puppetlabs/puppetlabs-java/pull/166) ([alexharv074](https://github.com/alexharv074)) -### Other - -- minor edit on new text [#176](https://github.com/puppetlabs/puppetlabs-java/pull/176) ([jbondpdx](https://github.com/jbondpdx)) -- Update java package for SLES 11.4 [#171](https://github.com/puppetlabs/puppetlabs-java/pull/171) ([jonnytdevops](https://github.com/jonnytdevops)) -- Update to newest modulesync_configs [9ca280f] [#169](https://github.com/puppetlabs/puppetlabs-java/pull/169) ([DavidS](https://github.com/DavidS)) -- 1.5.x mergeback [#167](https://github.com/puppetlabs/puppetlabs-java/pull/167) ([bmjen](https://github.com/bmjen)) - ## [1.5.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.5.0) - 2016-04-12 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.4.3...1.5.0) @@ -469,16 +414,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Fix typo in README.markdown [#165](https://github.com/puppetlabs/puppetlabs-java/pull/165) ([alexharv074](https://github.com/alexharv074)) -### Other - -- Use java 8 as the default on RHEL > 7.0 [#160](https://github.com/puppetlabs/puppetlabs-java/pull/160) ([jyaworski](https://github.com/jyaworski)) -- Update metadata to note Debian 8 support [#158](https://github.com/puppetlabs/puppetlabs-java/pull/158) ([DavidS](https://github.com/DavidS)) -- (FM-4046) Update to current msync configs [006831f] [#157](https://github.com/puppetlabs/puppetlabs-java/pull/157) ([DavidS](https://github.com/DavidS)) -- Allow tildes in version to support webupd8team's packages [#156](https://github.com/puppetlabs/puppetlabs-java/pull/156) ([joerayme](https://github.com/joerayme)) -- (FM-4049) update to modulesync_configs [#154](https://github.com/puppetlabs/puppetlabs-java/pull/154) ([DavidS](https://github.com/DavidS)) -- Can now pass options to package provider [#151](https://github.com/puppetlabs/puppetlabs-java/pull/151) ([tux-o-matic](https://github.com/tux-o-matic)) -- 1.4.x Mergeback [#150](https://github.com/puppetlabs/puppetlabs-java/pull/150) ([HelenCampbell](https://github.com/HelenCampbell)) - ## [1.4.3](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.3) - 2015-12-07 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.4.2...1.4.3) @@ -488,10 +423,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add support for Ubuntu 15.10 [#147](https://github.com/puppetlabs/puppetlabs-java/pull/147) ([oc243](https://github.com/oc243)) - add two facts: libjvm and java executable paths [#117](https://github.com/puppetlabs/puppetlabs-java/pull/117) ([faxm0dem](https://github.com/faxm0dem)) -### Other - -- update fixtures.yml to use git instead of http [#145](https://github.com/puppetlabs/puppetlabs-java/pull/145) ([bmjen](https://github.com/bmjen)) - ## [1.4.2](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.2) - 2015-10-07 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.4.1...1.4.2) @@ -500,12 +431,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Fix rspec deprecation warnings. .should -> expect().to [#141](https://github.com/puppetlabs/puppetlabs-java/pull/141) ([vStone](https://github.com/vStone)) -### Other - -- Update 1.4.x with master changes [#143](https://github.com/puppetlabs/puppetlabs-java/pull/143) ([hunner](https://github.com/hunner)) -- (MODULES-2637) Checks java actually installed [#142](https://github.com/puppetlabs/puppetlabs-java/pull/142) ([DavidS](https://github.com/DavidS)) -- mergeback 1.4.x [#137](https://github.com/puppetlabs/puppetlabs-java/pull/137) ([hunner](https://github.com/hunner)) - ## [1.4.1](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.1) - 2015-07-15 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.4.0...1.4.1) @@ -514,10 +439,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add OEL operatingsystem to java::params [#135](https://github.com/puppetlabs/puppetlabs-java/pull/135) ([zreichert](https://github.com/zreichert)) -### Other - -- Merge 1.4.x to master [#134](https://github.com/puppetlabs/puppetlabs-java/pull/134) ([underscorgan](https://github.com/underscorgan)) - ## [1.4.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.0) - 2015-07-08 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.3.0...1.4.0) @@ -534,20 +455,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - (MODULES-2095) fixes create-java-alternatives command [#128](https://github.com/puppetlabs/puppetlabs-java/pull/128) ([bmjen](https://github.com/bmjen)) - Fix Fedora 21+ package name [#104](https://github.com/puppetlabs/puppetlabs-java/pull/104) ([cottsay](https://github.com/cottsay)) -### Other - -- updates metadata.json to include support for PE up to 2015.2.x [#132](https://github.com/puppetlabs/puppetlabs-java/pull/132) ([bmjen](https://github.com/bmjen)) -- re-orders case statements in manifests to workaround PUP-4520. [#127](https://github.com/puppetlabs/puppetlabs-java/pull/127) ([bmjen](https://github.com/bmjen)) -- Install update-java-alternatives on Debian for the java::config class [#126](https://github.com/puppetlabs/puppetlabs-java/pull/126) ([danielparks](https://github.com/danielparks)) -- Updated travisci file to remove allow_failures on Puppet 4 [#121](https://github.com/puppetlabs/puppetlabs-java/pull/121) ([jonnytdevops](https://github.com/jonnytdevops)) -- Modulesync updates [#118](https://github.com/puppetlabs/puppetlabs-java/pull/118) ([underscorgan](https://github.com/underscorgan)) -- Edits to param descriptions and other small changes in the README. [#113](https://github.com/puppetlabs/puppetlabs-java/pull/113) ([jtappa](https://github.com/jtappa)) -- Extend Limitations section [#110](https://github.com/puppetlabs/puppetlabs-java/pull/110) ([antaflos](https://github.com/antaflos)) -- Improve java_version fact maintainability [#107](https://github.com/puppetlabs/puppetlabs-java/pull/107) ([elyscape](https://github.com/elyscape)) -- (MODULES-1749) Update java_version fact with maximum memory size [#106](https://github.com/puppetlabs/puppetlabs-java/pull/106) ([petems](https://github.com/petems)) -- Pin rspec gems [#105](https://github.com/puppetlabs/puppetlabs-java/pull/105) ([cmurphy](https://github.com/cmurphy)) -- Merge 1.3.x to master [#100](https://github.com/puppetlabs/puppetlabs-java/pull/100) ([underscorgan](https://github.com/underscorgan)) - ## [1.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.3.0) - 2015-01-20 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.2.0...1.3.0) @@ -566,16 +473,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Acceptance test fix for wheezy [#96](https://github.com/puppetlabs/puppetlabs-java/pull/96) ([underscorgan](https://github.com/underscorgan)) - Test fix for RHEL with alternatives [#94](https://github.com/puppetlabs/puppetlabs-java/pull/94) ([underscorgan](https://github.com/underscorgan)) -### Other - -- Use --jre-headless instead of --jre [#97](https://github.com/puppetlabs/puppetlabs-java/pull/97) ([electrical](https://github.com/electrical)) -- Sync with modulesync [#95](https://github.com/puppetlabs/puppetlabs-java/pull/95) ([cmurphy](https://github.com/cmurphy)) -- Sync files with modulesync [#93](https://github.com/puppetlabs/puppetlabs-java/pull/93) ([underscorgan](https://github.com/underscorgan)) -- MODULES-1570 Java Version facts [#92](https://github.com/puppetlabs/puppetlabs-java/pull/92) ([petems](https://github.com/petems)) -- variable best practice (stop yelling at me linter) [#91](https://github.com/puppetlabs/puppetlabs-java/pull/91) ([justinstoller](https://github.com/justinstoller)) -- Merge 1.2.x [#86](https://github.com/puppetlabs/puppetlabs-java/pull/86) ([underscorgan](https://github.com/underscorgan)) -- cosmetic: default in last position [#76](https://github.com/puppetlabs/puppetlabs-java/pull/76) ([PierreR](https://github.com/PierreR)) - ## [1.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.2.0) - 2014-11-10 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.1.2...1.2.0) @@ -584,13 +481,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Fix syntax [#77](https://github.com/puppetlabs/puppetlabs-java/pull/77) ([PierreR](https://github.com/PierreR)) -### Other - -- Remove misleading changelog, no readme changes done [#85](https://github.com/puppetlabs/puppetlabs-java/pull/85) ([cyberious](https://github.com/cyberious)) -- Fixed issue with installing stdlib on certain platforms due to ssl issues [#82](https://github.com/puppetlabs/puppetlabs-java/pull/82) ([cyberious](https://github.com/cyberious)) -- Remove puppet_module_install in favor of copy_module_to [#79](https://github.com/puppetlabs/puppetlabs-java/pull/79) ([cyberious](https://github.com/cyberious)) -- place default case last in selectors [#64](https://github.com/puppetlabs/puppetlabs-java/pull/64) ([kian](https://github.com/kian)) - ## [1.1.2](https://github.com/puppetlabs/puppetlabs-java/tree/1.1.2) - 2014-09-03 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.1.1...1.1.2) @@ -599,18 +489,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add metadata.json and remove Modulefile [#65](https://github.com/puppetlabs/puppetlabs-java/pull/65) ([hunner](https://github.com/hunner)) -### Other - -- OEL 5 is trying to use up2date which doesn't work [#78](https://github.com/puppetlabs/puppetlabs-java/pull/78) ([hunner](https://github.com/hunner)) -- Ah hah, got it [#75](https://github.com/puppetlabs/puppetlabs-java/pull/75) ([hunner](https://github.com/hunner)) -- Maybe spec filters work like this [#74](https://github.com/puppetlabs/puppetlabs-java/pull/74) ([hunner](https://github.com/hunner)) -- Spec typo [#73](https://github.com/puppetlabs/puppetlabs-java/pull/73) ([hunner](https://github.com/hunner)) -- Misplaced comma [#72](https://github.com/puppetlabs/puppetlabs-java/pull/72) ([hunner](https://github.com/hunner)) -- Remove sci 7 from metadata [#71](https://github.com/puppetlabs/puppetlabs-java/pull/71) ([hunner](https://github.com/hunner)) -- Update spec_helper for consistency [#69](https://github.com/puppetlabs/puppetlabs-java/pull/69) ([underscorgan](https://github.com/underscorgan)) -- Make deb work [#67](https://github.com/puppetlabs/puppetlabs-java/pull/67) ([hunner](https://github.com/hunner)) -- Java readme [#62](https://github.com/puppetlabs/puppetlabs-java/pull/62) ([jbondpdx](https://github.com/jbondpdx)) - ## [1.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/1.1.1) - 2014-05-02 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/1.1.0...1.1.1) @@ -633,13 +511,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Fix travis script. [#36](https://github.com/puppetlabs/puppetlabs-java/pull/36) ([apenney](https://github.com/apenney)) -### Other - -- plus signs are valid in debian/ubuntu package versions [#50](https://github.com/puppetlabs/puppetlabs-java/pull/50) ([CpuID](https://github.com/CpuID)) -- Update params.pp [#44](https://github.com/puppetlabs/puppetlabs-java/pull/44) ([jengels](https://github.com/jengels)) -- Support Scientific Linux [#38](https://github.com/puppetlabs/puppetlabs-java/pull/38) ([brettporter](https://github.com/brettporter)) -- CHANGELOG for 1.0.1 [#35](https://github.com/puppetlabs/puppetlabs-java/pull/35) ([brettporter](https://github.com/brettporter)) - ## [1.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/1.0.1) - 2013-08-01 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.3.0...1.0.1) @@ -655,12 +526,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Fixes for centos versions [#24](https://github.com/puppetlabs/puppetlabs-java/pull/24) ([garethr](https://github.com/garethr)) -### Other - -- Update fedora java [#34](https://github.com/puppetlabs/puppetlabs-java/pull/34) ([haus](https://github.com/haus)) -- Update version to 1.0.0 [#31](https://github.com/puppetlabs/puppetlabs-java/pull/31) ([brettporter](https://github.com/brettporter)) -- Support multiple JVM, and Debian alternatives. [#28](https://github.com/puppetlabs/puppetlabs-java/pull/28) ([mrwacky42](https://github.com/mrwacky42)) - ## [0.3.0](https://github.com/puppetlabs/puppetlabs-java/tree/0.3.0) - 2013-05-08 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.2.0...0.3.0) @@ -670,10 +535,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add special case for fedora operating systems, where java is installable... [#23](https://github.com/puppetlabs/puppetlabs-java/pull/23) ([haus](https://github.com/haus)) - Adding java::package_suse class [#22](https://github.com/puppetlabs/puppetlabs-java/pull/22) ([sschneid](https://github.com/sschneid)) -### Other - -- Reduce complexity [#25](https://github.com/puppetlabs/puppetlabs-java/pull/25) ([reidmv](https://github.com/reidmv)) - ## [0.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/0.2.0) - 2012-11-15 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v0.1.5...0.2.0) @@ -683,14 +544,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add Solaris support [#18](https://github.com/puppetlabs/puppetlabs-java/pull/18) ([sschneid](https://github.com/sschneid)) - 4 - Add license file. [#8](https://github.com/puppetlabs/puppetlabs-java/pull/8) ([kbarber](https://github.com/kbarber)) -### Other - -- Use osfamily instead of operatingsystem to determine package [#14](https://github.com/puppetlabs/puppetlabs-java/pull/14) ([eshamow](https://github.com/eshamow)) -- Moves debain packages to openjdk. [#13](https://github.com/puppetlabs/puppetlabs-java/pull/13) ([ody](https://github.com/ody)) -- Allow distributions starting with string `java` [#11](https://github.com/puppetlabs/puppetlabs-java/pull/11) ([ccaum](https://github.com/ccaum)) -- 9 - remove empty metadata.json from repo to avoid errors when using from [#10](https://github.com/puppetlabs/puppetlabs-java/pull/10) ([kbarber](https://github.com/kbarber)) -- 5 - Provide a preseed file that preseeds license signing for java package [#7](https://github.com/puppetlabs/puppetlabs-java/pull/7) ([kbarber](https://github.com/kbarber)) - ## [v0.1.5](https://github.com/puppetlabs/puppetlabs-java/tree/v0.1.5) - 2011-06-16 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/0.1.4...v0.1.5) diff --git a/metadata.json b/metadata.json index 02a8f790..540e1cfe 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "10.1.0", + "version": "10.1.1", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 4f9a1ded1d2fe43b57b56ce5db844c892510b1ae Mon Sep 17 00:00:00 2001 From: jordanbreen28 Date: Mon, 17 Jul 2023 11:56:45 +0100 Subject: [PATCH 211/259] (maint) - Replace legacy facts in spec/default_facts.yml --- spec/default_facts.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/spec/default_facts.yml b/spec/default_facts.yml index f777abfc..f3946607 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -2,7 +2,8 @@ # # 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" +networking: + ip: "172.16.254.254" + ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" + mac: "AA:AA:AA:AA:AA:AA" is_pe: false -macaddress: "AA:AA:AA:AA:AA:AA" From fa4ddd2b2443c30d7d261dd752712da6455240fc Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Mon, 17 Jul 2023 21:36:14 +0530 Subject: [PATCH 212/259] CONT-1219 : fail ci for puppetlabs members if no label --- .github/workflows/labeller.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml index 5434d3ff..aa34247a 100644 --- a/.github/workflows/labeller.yml +++ b/.github/workflows/labeller.yml @@ -1,22 +1,27 @@ -name: community-labeller +name: Labeller on: issues: types: - opened + - labeled + - unlabeled pull_request_target: types: - opened + - labeled + - unlabeled jobs: label: runs-on: ubuntu-latest steps: - - uses: puppetlabs/community-labeller@v0 + - uses: puppetlabs/community-labeller@v1.0.1 name: Label issues or pull requests with: label_name: community label_color: '5319e7' org_membership: puppetlabs - token: ${{ secrets.IAC_COMMUNITY_LABELER }} + fail_if_member: 'true' + token: ${{ secrets.IAC_COMMUNITY_LABELER }} \ No newline at end of file From 89887f89ea7c26287f309251b4ba2d726e339c07 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Mon, 17 Jul 2023 21:46:04 +0530 Subject: [PATCH 213/259] CONT-1219 : fail ci for puppetlabs members if no label --- .github/workflows/labeller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml index aa34247a..ee149bf5 100644 --- a/.github/workflows/labeller.yml +++ b/.github/workflows/labeller.yml @@ -24,4 +24,4 @@ jobs: label_color: '5319e7' org_membership: puppetlabs fail_if_member: 'true' - token: ${{ secrets.IAC_COMMUNITY_LABELER }} \ No newline at end of file + token: ${{ secrets.IAC_COMMUNITY_LABELER }} From 7322c15f97ccb4ad72e9de4e769fbef424053d4d Mon Sep 17 00:00:00 2001 From: praj1001 <134480625+praj1001@users.noreply.github.com> Date: Thu, 27 Jul 2023 11:31:01 +0530 Subject: [PATCH 214/259] (CAT-1250)-Update SUSE repo name --- manifests/init.pp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index c2295fb6..78ba209e 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -115,8 +115,8 @@ if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['major'], '15') >= 0 and versioncmp($facts['os']['release']['minor'], '3') == 1) { exec { 'Enable legacy repos': path => '/bin:/usr/bin/:/sbin:/usr/sbin', - command => 'SUSEConnect --product sle-module-legacy/15.4/x86_64', - unless => 'SUSEConnect --status-text | grep sle-module-legacy/15.4/x86_64', + command => 'SUSEConnect --product sle-module-legacy/15.5/x86_64', + unless => 'SUSEConnect --status-text | grep sle-module-legacy/15.5/x86_64', } } From 51bc5dea4a2bcb8d05cb5b7fb9f4f79fa3d52271 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Thu, 27 Jul 2023 10:46:58 +0000 Subject: [PATCH 215/259] Release prep v10.1.2 --- CHANGELOG.md | 8 ++++++++ metadata.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1313a6d4..a46653af 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ 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). +## [v10.1.2](https://github.com/puppetlabs/puppetlabs-java/tree/v10.1.2) - 2023-07-27 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.1...v10.1.2) + +### Fixed + +- (CAT-1250)-updating legacy SUSE repo name [#570](https://github.com/puppetlabs/puppetlabs-java/pull/570) ([praj1001](https://github.com/praj1001)) + ## [v10.1.1](https://github.com/puppetlabs/puppetlabs-java/tree/v10.1.1) - 2023-07-03 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.0...v10.1.1) diff --git a/metadata.json b/metadata.json index 540e1cfe..301be87f 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "10.1.1", + "version": "10.1.2", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 2ee359777db732e18672b5888e6a678bd9f01cbd Mon Sep 17 00:00:00 2001 From: Gavin Patton Date: Thu, 10 Aug 2023 12:20:04 +0100 Subject: [PATCH 216/259] (CAT-343) Audit modules and tools for references to travis. Removed all needless references to travis. --- provision.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/provision.yaml b/provision.yaml index 6ab21074..3c152f17 100644 --- a/provision.yaml +++ b/provision.yaml @@ -8,23 +8,23 @@ vagrant: images: - centos/7 - generic/ubuntu1804 -travis_deb: +docker_deb: provisioner: docker images: - litmusimage/debian:9 - litmusimage/debian:10 -travis_ub_6: +docker_ub_6: provisioner: docker images: - litmusimage/ubuntu:18.04 - litmusimage/ubuntu:20.04 -travis_el7: +docker_el7: provisioner: docker images: - litmusimage/centos:7 - litmusimage/oraclelinux:7 - litmusimage/scientificlinux:7 -travis_el8: +docker_el8: provisioner: docker images: - litmusimage/centos:8 From 60b6df7e5b0d0ce269c923e8adb522e4ef4e4d98 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Mon, 4 Sep 2023 10:15:18 +0530 Subject: [PATCH 217/259] CAT-1366 : Fix issue url from old jira to github --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 301be87f..16926110 100644 --- a/metadata.json +++ b/metadata.json @@ -6,7 +6,7 @@ "license": "Apache-2.0", "source": "git://github.com/puppetlabs/puppetlabs-java", "project_page": "https://github.com/puppetlabs/puppetlabs-java", - "issues_url": "https://tickets.puppet.com/CreateIssueDetails!init.jspa?pid=10707&issuetype=1&team=Modules&customfield_14200=14302&labels=triage&customfield_10005=2147&summary=Issue+found+with+module%3A+puppetlabs-java", + "issues_url": "https://github.com/puppetlabs/puppetlabs-java/issues", "dependencies": [ { "name": "puppetlabs/stdlib", From f87c86ec115106ed9903972f3a03da93c5debefb Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Wed, 20 Sep 2023 22:16:45 +0530 Subject: [PATCH 218/259] Removing RedHat/Scientific/OracleLinux 6 --- README.md | 15 ++++--- manifests/params.pp | 13 +------ spec/classes/java_spec.rb | 73 ++--------------------------------- spec/defines/adopt_spec.rb | 2 +- spec/defines/adoptium_spec.rb | 2 +- spec/defines/download_spec.rb | 2 +- spec/defines/sap_spec.rb | 2 +- 7 files changed, 16 insertions(+), 93 deletions(-) diff --git a/README.md b/README.md index 4877fd25..82414c02 100644 --- a/README.md +++ b/README.md @@ -239,19 +239,18 @@ This module is officially [supported](https://forge.puppetlabs.com/supported) fo OpenJDK is supported on: -* Red Hat Enterprise Linux (RHEL) 6, 7 -* CentOS 6, 7 -* Oracle Linux 6, 7 -* Scientific Linux 6 -* Debian 9 -* Ubuntu 18.04, 20.04 +* Red Hat Enterprise Linux (RHEL) 7, 8, 9 +* CentOS 7, 8 +* Oracle Linux 7 +* Debian 10, 11 +* Ubuntu 18.04, 20.04, 22.04 * Solaris 11 -* SLES 11, 12 +* SLES 12, 15 Oracle Java is supported on: -* CentOS 6 * CentOS 7 +* CentOS 8 * Red Hat Enterprise Linux (RHEL) 7 AdoptOpenJDK Java is supported on: diff --git a/manifests/params.pp b/manifests/params.pp index d60bb5ca..00120706 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -9,19 +9,8 @@ 'RedHat': { case $facts['os']['name'] { 'AlmaLinux', 'Rocky', 'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL', 'SLC', 'CloudLinux': { - if (versioncmp($facts['os']['release']['full'], '5.0') < 0) { - $jdk_package = 'java-1.6.0-sun-devel' - $jre_package = 'java-1.6.0-sun' - $java_home = '/usr/lib/jvm/java-1.6.0-sun/jre/' - } - # See cde7046 for why >= 5.0 < 6.3 - elsif (versioncmp($facts['os']['release']['full'], '6.3') < 0) { - $jdk_package = 'java-1.6.0-openjdk-devel' - $jre_package = 'java-1.6.0-openjdk' - $java_home = '/usr/lib/jvm/java-1.6.0/' - } # See PR#160 / c8e46b5 for why >= 6.3 < 7.1 - elsif (versioncmp($facts['os']['release']['full'], '7.1') < 0) { + if (versioncmp($facts['os']['release']['full'], '7.1') < 0) { $jdk_package = 'java-1.7.0-openjdk-devel' $jre_package = 'java-1.7.0-openjdk' $java_home = '/usr/lib/jvm/java-1.7.0/' diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 61f357fb..09906916 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -3,20 +3,6 @@ require 'spec_helper' describe 'java', type: :class do - context 'when selecting openjdk for CentOS 5.8' do - let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.8' }, architecture: 'x86_64' } } } - - it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.6.0/') } - end - - context 'when selecting openjdk for CentOS 6.3' do - let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } - - it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } - it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.7.0/') } - end - context 'when selecting openjdk for CentOS 7.1.1503' do let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '7.1.1503' }, architecture: 'x86_64' } } } @@ -24,51 +10,6 @@ it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0/') } end - context 'when selecting openjdk for CentOS 6.2' do - let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.2' }, architecture: 'x86_64' } } } - - it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } - it { is_expected.not_to contain_exec('update-java-alternatives') } - end - - context 'when selecting Oracle JRE with alternatives for CentOS 6.3' do - let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } - let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java/jre1.7.0_67/bin/java' } } - - it { is_expected.to contain_package('java').with_name('jre') } - - it { - expect(subject).to contain_exec('create-java-alternatives').with( - { command: ['alternatives', '--install', '/usr/bin/java', 'java', '/usr/java/jre1.7.0_67/bin/java', '20000'], - unless: 'alternatives --display java | grep -q /usr/java/jre1.7.0_67/bin/java' }, - ) - } - - it { is_expected.to contain_exec('update-java-alternatives').with_command(['alternatives', '--set', 'java', '/usr/java/jre1.7.0_67/bin/java']) } - end - - context 'when selecting Malicious JRE with alternatives for CentOS 6.3' do - let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '6.3' }, architecture: 'x86_64' } } } - let(:params) { { 'package' => 'jre', 'java_alternative' => '/usr/bin/java', 'java_alternative_path' => '/usr/java ; rm -rf /etc' } } - - it { is_expected.to contain_exec('create-java-alternatives').with_unless('alternatives --display java | grep -q /usr/java\\ \\;\\ rm\\ -rf\\ /etc') } - end - - context 'when selecting passed value for CentOS 5.3' do - let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.3' }, architecture: 'x86_64' } } } - let(:params) { { 'package' => 'jdk', 'java_home' => '/usr/local/lib/jre' } } - - it { is_expected.to contain_package('java').with_name('jdk') } - it { is_expected.not_to contain_exec('update-java-alternatives') } - end - - context 'when selecting default for CentOS 5.3' do - let(:facts) { { os: { family: 'RedHat', name: 'CentOS', release: { full: '5.3' }, architecture: 'x86_64' } } } - - it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } - it { is_expected.not_to contain_exec('update-java-alternatives') } - end - context 'when selecting jdk for Debian Buster (10.0)' do let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '10' }, architecture: 'amd64' } } } let(:params) { { 'distribution' => 'jdk' } } @@ -102,26 +43,20 @@ end context 'when selecting openjdk for Oracle Linux' do - let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.4' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '7.0' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } end - context 'when selecting openjdk for Oracle Linux 6.2' do - let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.2' }, architecture: 'x86_64' } } } - - it { is_expected.to contain_package('java').with_name('java-1.6.0-openjdk-devel') } - end - context 'when selecting passed value for Oracle Linux' do - let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '6.3' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '7.0' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } end context 'when selecting passed value for Scientific Linux' do - let(:facts) { { os: { family: 'RedHat', name: 'Scientific', release: { full: '6.4' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'RedHat', name: 'Scientific', release: { full: '7.0' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } @@ -129,7 +64,7 @@ end context 'when selecting passed value for Scientific Linux CERN (SLC)' do - let(:facts) { { os: { family: 'RedHat', name: 'SLC', release: { full: '6.4' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'RedHat', name: 'SLC', release: { full: '7.0' }, architecture: 'x86_64' } } } let(:params) { { 'distribution' => 'jre' } } it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } diff --git a/spec/defines/adopt_spec.rb b/spec/defines/adopt_spec.rb index 1d97a0c7..c56fc48a 100644 --- a/spec/defines/adopt_spec.rb +++ b/spec/defines/adopt_spec.rb @@ -4,7 +4,7 @@ describe 'java::adopt', 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' } } } } + let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'x86_64', name: 'CentOS', release: { full: '7.0' } } } } context 'when manage_symlink is set to true' do let(:params) do diff --git a/spec/defines/adoptium_spec.rb b/spec/defines/adoptium_spec.rb index ba268912..94fb2ca3 100644 --- a/spec/defines/adoptium_spec.rb +++ b/spec/defines/adoptium_spec.rb @@ -4,7 +4,7 @@ describe 'java::adoptium', 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' } } } } + let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'x86_64', name: 'CentOS', release: { full: '7.0' } } } } context 'when manage_symlink is set to true' do let(:params) do diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index 42a4f4d0..c6b8e7a6 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -6,7 +6,7 @@ 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' } } } } + let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'x86_64', name: 'CentOS', release: { full: '7.0' } } } } context 'when passing URL to url parameter' do let(:params) do diff --git a/spec/defines/sap_spec.rb b/spec/defines/sap_spec.rb index 3340f332..5f4f9945 100644 --- a/spec/defines/sap_spec.rb +++ b/spec/defines/sap_spec.rb @@ -4,7 +4,7 @@ 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' } } } } + let(:facts) { { kernel: 'Linux', os: { family: 'RedHat', architecture: 'x86_64', name: 'CentOS', release: { full: '7.0' } } } } context 'when manage_symlink is set to true' do let(:params) do From c53e4e115b76e52e585ca31cf3ccaa56f6b7753c Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Thu, 21 Sep 2023 11:48:06 +0530 Subject: [PATCH 219/259] Removing Debian 9 --- manifests/params.pp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index 00120706..cfbaa289 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -62,22 +62,6 @@ default => $facts['os']['architecture'] } case $facts['os']['release']['major'] { - '9': { - $java = { - 'jdk' => { - 'package' => 'openjdk-8-jdk', - 'alternative' => "java-1.8.0-openjdk-${openjdk_architecture}", - 'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/", - }, - 'jre' => { - 'package' => 'openjdk-8-jre-headless', - 'alternative' => "java-1.8.0-openjdk-${openjdk_architecture}", - 'alternative_path' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/java-1.8.0-openjdk-${openjdk_architecture}/", - }, - } - } '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04', '22.04': { $java = { 'jdk' => { From b9e6a057821d90cc6f434dc46d5b59369661c7f0 Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Mon, 6 Nov 2023 18:07:12 +0530 Subject: [PATCH 220/259] Adding github directory to pdkignore --- .pdkignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.pdkignore b/.pdkignore index c538bea8..960a62ab 100644 --- a/.pdkignore +++ b/.pdkignore @@ -31,6 +31,7 @@ /.fixtures.yml /Gemfile /.gitattributes +/.github/ /.gitignore /.gitlab-ci.yml /.pdkignore From f98c1b203d45eb108ec2bdfd9396d89066de3097 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Mon, 20 Nov 2023 15:15:04 +0530 Subject: [PATCH 221/259] '(CAT-1599) - Fixing CI/Nightly pipelines' --- .github/workflows/ci.yml | 2 ++ .github/workflows/nightly.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5738adb..1b0e39c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,3 +15,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" + with: + runs_on: "ubuntu-20.04" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1b06c471..aaa4967f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,3 +14,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" + with: + runs_on: "ubuntu-20.04" From ee4d5ed0031c691490486b738c39c5bf0444ff80 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Mon, 20 Nov 2023 11:32:10 +0530 Subject: [PATCH 222/259] "CAT-945 - Update README.md LICENSE" --- README.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 82414c02..6c6c6bd0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,8 @@ 4. [Usage - Configuration options and additional functionality](#usage) 5. [Reference - An under-the-hood peek at what the module is doing and how](#reference) 6. [Limitations - OS compatibility, etc.](#limitations) -7. [Development - Guide for contributing to the module](#development) +7. [License](#license) +8. [Development - Guide for contributing to the module](#development) ## Overview @@ -288,6 +289,10 @@ the binaries to a standard directory. Because of that, the path to this location is hardcoded in the `java_version` fact. Whenever you upgrade Java to a newer version, you have to update the path in this fact. +## License + +This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html), [BSD-2](https://opensource.org/license/bsd-2-claus), [BSD-3](https://opensource.org/license/bsd-3-claus), [GPL2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html), [LGPL](https://opensource.org/license/lgpl-3-0/), [MIT](https://opensource.org/license/mit/) and [MPL](https://opensource.org/license/mpl-2-0/) Licensing. + ## Development Puppet modules on the Puppet Forge are open projects, and community contributions are essential for keeping them great. To contribute to Puppet projects, see our [module contribution guide.](https://docs.puppetlabs.com/forge/contributing.html) From 7b2b68db5ef92da9f2e90e714c53bb87882f9e78 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Thu, 23 Nov 2023 10:42:12 +0530 Subject: [PATCH 223/259] Addressing review comments --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6c6c6bd0..d06d6518 100644 --- a/README.md +++ b/README.md @@ -291,7 +291,7 @@ version, you have to update the path in this fact. ## License -This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of [AGPL](https://www.gnu.org/licenses/agpl-3.0.en.html), [BSD-2](https://opensource.org/license/bsd-2-claus), [BSD-3](https://opensource.org/license/bsd-3-claus), [GPL2.0](https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html), [LGPL](https://opensource.org/license/lgpl-3-0/), [MIT](https://opensource.org/license/mit/) and [MPL](https://opensource.org/license/mpl-2-0/) Licensing. +This codebase is licensed under the Apache2.0 licensing, however due to the nature of the codebase the open source dependencies may also use a combination of [AGPL](https://opensource.org/license/agpl-v3/), [BSD-2](https://opensource.org/license/bsd-2-clause/), [BSD-3](https://opensource.org/license/bsd-3-clause/), [GPL2.0](https://opensource.org/license/gpl-2-0/), [LGPL](https://opensource.org/license/lgpl-3-0/), [MIT](https://opensource.org/license/mit/) and [MPL](https://opensource.org/license/mpl-2-0/) Licensing. ## Development From e8fac6df843399ba974da7b3b97d94f6ed9d11b8 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Tue, 28 Nov 2023 10:40:25 +0530 Subject: [PATCH 224/259] (CAT-1608) - PDK update --- .gitignore | 2 +- .pdkignore | 8 +- .rubocop.yml | 646 ++++++++++++++++++++++++++++++++++++++++- .rubocop_todo.yml | 39 +-- .sync.yml | 3 +- Gemfile | 48 +-- Rakefile | 9 +- metadata.json | 4 +- spec/default_facts.yml | 6 +- spec/spec_helper.rb | 4 +- 10 files changed, 686 insertions(+), 83 deletions(-) diff --git a/.gitignore b/.gitignore index 988dcbbe..3f155121 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt diff --git a/.pdkignore b/.pdkignore index 960a62ab..862847a7 100644 --- a/.pdkignore +++ b/.pdkignore @@ -16,7 +16,7 @@ /log/ /pkg/ /spec/fixtures/manifests/ -/spec/fixtures/modules/ +/spec/fixtures/modules/* /tmp/ /vendor/ /convert_report.txt @@ -26,21 +26,17 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml -/appveyor.yml -/.editorconfig /.fixtures.yml /Gemfile /.gitattributes /.github/ /.gitignore -/.gitlab-ci.yml /.pdkignore /.puppet-lint.rc /Rakefile /rakelib/ /.rspec -/.rubocop.yml -/.travis.yml +/..yml /.yardopts /spec/ /.vscode/ diff --git a/.rubocop.yml b/.rubocop.yml index 2367276d..7a66e083 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,8 +5,6 @@ require: AllCops: NewCops: enable DisplayCopNames: true - ExtraDetails: true - DisplayStyleGuide: true TargetRubyVersion: '2.7' Include: - "**/*.rb" @@ -21,6 +19,7 @@ AllCops: - "**/Puppetfile" - "**/Vagrantfile" - "**/Guardfile" +inherit_from: ".rubocop_todo.yml" Layout/LineLength: Description: People have wide screens, use them. Max: 200 @@ -74,7 +73,6 @@ Style/TrailingCommaInArrayLiteral: Style/SymbolArray: Description: Using percent style obscures symbolic intent of array's contents. EnforcedStyle: brackets -inherit_from: ".rubocop_todo.yml" RSpec/MessageSpies: EnforcedStyle: receive Style/Documentation: @@ -83,5 +81,645 @@ Style/Documentation: - spec/**/* Style/WordArray: EnforcedStyle: brackets +Performance/AncestorsInclude: + Enabled: true +Performance/BigDecimalWithNumericArgument: + Enabled: true +Performance/BlockGivenWithExplicitBlock: + Enabled: true +Performance/CaseWhenSplat: + Enabled: true +Performance/ConstantRegexp: + Enabled: true +Performance/MethodObjectAsBlock: + Enabled: true +Performance/RedundantSortBlock: + Enabled: true +Performance/RedundantStringChars: + Enabled: true +Performance/ReverseFirst: + Enabled: true +Performance/SortReverse: + Enabled: true +Performance/Squeeze: + Enabled: true +Performance/StringInclude: + Enabled: true +Performance/Sum: + Enabled: true +Style/CollectionMethods: + Enabled: true +Style/MethodCalledOnDoEndBlock: + Enabled: true +Style/StringMethods: + Enabled: true +Bundler/GemFilename: + Enabled: false +Bundler/InsecureProtocolSource: + Enabled: false +Capybara/CurrentPathExpectation: + Enabled: false +Capybara/VisibilityMatcher: + Enabled: false +Gemspec/DuplicatedAssignment: + Enabled: false +Gemspec/OrderedDependencies: + Enabled: false +Gemspec/RequiredRubyVersion: + Enabled: false +Gemspec/RubyVersionGlobalsUsage: + Enabled: false +Layout/ArgumentAlignment: + Enabled: false +Layout/BeginEndAlignment: + Enabled: false +Layout/ClosingHeredocIndentation: + Enabled: false +Layout/EmptyComment: + Enabled: false +Layout/EmptyLineAfterGuardClause: + Enabled: false +Layout/EmptyLinesAroundArguments: + Enabled: false +Layout/EmptyLinesAroundAttributeAccessor: + Enabled: false +Layout/EndOfLine: + Enabled: false +Layout/FirstArgumentIndentation: + Enabled: false +Layout/HashAlignment: + Enabled: false +Layout/HeredocIndentation: + Enabled: false +Layout/LeadingEmptyLines: + Enabled: false +Layout/SpaceAroundMethodCallOperator: + Enabled: false +Layout/SpaceInsideArrayLiteralBrackets: + Enabled: false +Layout/SpaceInsideReferenceBrackets: + Enabled: false +Lint/BigDecimalNew: + Enabled: false +Lint/BooleanSymbol: + Enabled: false +Lint/ConstantDefinitionInBlock: + Enabled: false +Lint/DeprecatedOpenSSLConstant: + Enabled: false +Lint/DisjunctiveAssignmentInConstructor: + Enabled: false +Lint/DuplicateElsifCondition: + Enabled: false +Lint/DuplicateRequire: + Enabled: false +Lint/DuplicateRescueException: + Enabled: false +Lint/EmptyConditionalBody: + Enabled: false +Lint/EmptyFile: + Enabled: false +Lint/ErbNewArguments: + Enabled: false +Lint/FloatComparison: + Enabled: false +Lint/HashCompareByIdentity: + Enabled: false +Lint/IdentityComparison: + Enabled: false +Lint/InterpolationCheck: + Enabled: false +Lint/MissingCopEnableDirective: + Enabled: false +Lint/MixedRegexpCaptureTypes: + Enabled: false +Lint/NestedPercentLiteral: + Enabled: false +Lint/NonDeterministicRequireOrder: + Enabled: false +Lint/OrderedMagicComments: + Enabled: false +Lint/OutOfRangeRegexpRef: + Enabled: false +Lint/RaiseException: + Enabled: false +Lint/RedundantCopEnableDirective: + Enabled: false +Lint/RedundantRequireStatement: + Enabled: false +Lint/RedundantSafeNavigation: + Enabled: false +Lint/RedundantWithIndex: + Enabled: false +Lint/RedundantWithObject: + Enabled: false +Lint/RegexpAsCondition: + Enabled: false +Lint/ReturnInVoidContext: + Enabled: false +Lint/SafeNavigationConsistency: + Enabled: false +Lint/SafeNavigationWithEmpty: + Enabled: false +Lint/SelfAssignment: + Enabled: false +Lint/SendWithMixinArgument: + Enabled: false +Lint/ShadowedArgument: + Enabled: false +Lint/StructNewOverride: + Enabled: false +Lint/ToJSON: + Enabled: false +Lint/TopLevelReturnWithArgument: + Enabled: false +Lint/TrailingCommaInAttributeDeclaration: + Enabled: false +Lint/UnreachableLoop: + Enabled: false +Lint/UriEscapeUnescape: + Enabled: false +Lint/UriRegexp: + Enabled: false +Lint/UselessMethodDefinition: + Enabled: false +Lint/UselessTimes: + Enabled: false +Metrics/AbcSize: + Enabled: false +Metrics/BlockLength: + Enabled: false +Metrics/BlockNesting: + Enabled: false +Metrics/ClassLength: + Enabled: false +Metrics/CyclomaticComplexity: + Enabled: false +Metrics/MethodLength: + Enabled: false +Metrics/ModuleLength: + Enabled: false +Metrics/ParameterLists: + Enabled: false +Metrics/PerceivedComplexity: + Enabled: false +Migration/DepartmentName: + Enabled: false +Naming/AccessorMethodName: + Enabled: false +Naming/BlockParameterName: + Enabled: false +Naming/HeredocDelimiterCase: + Enabled: false +Naming/HeredocDelimiterNaming: + Enabled: false +Naming/MemoizedInstanceVariableName: + Enabled: false +Naming/MethodParameterName: + Enabled: false +Naming/RescuedExceptionsVariableName: + Enabled: false +Naming/VariableNumber: + Enabled: false +Performance/BindCall: + Enabled: false +Performance/DeletePrefix: + Enabled: false +Performance/DeleteSuffix: + Enabled: false +Performance/InefficientHashSearch: + Enabled: false +Performance/UnfreezeString: + Enabled: false +Performance/UriDefaultParser: + Enabled: false +RSpec/Be: + Enabled: false +RSpec/Capybara/FeatureMethods: + Enabled: false +RSpec/ContainExactly: + Enabled: false +RSpec/ContextMethod: + Enabled: false +RSpec/ContextWording: + Enabled: false +RSpec/DescribeClass: + Enabled: false +RSpec/EmptyHook: + Enabled: false +RSpec/EmptyLineAfterExample: + Enabled: false +RSpec/EmptyLineAfterExampleGroup: + Enabled: false +RSpec/EmptyLineAfterHook: + Enabled: false +RSpec/ExampleLength: + Enabled: false +RSpec/ExampleWithoutDescription: + Enabled: false +RSpec/ExpectChange: + Enabled: false +RSpec/ExpectInHook: + Enabled: false +RSpec/FactoryBot/AttributeDefinedStatically: + Enabled: false +RSpec/FactoryBot/CreateList: + Enabled: false +RSpec/FactoryBot/FactoryClassName: + Enabled: false +RSpec/HooksBeforeExamples: + Enabled: false +RSpec/ImplicitBlockExpectation: + Enabled: false +RSpec/ImplicitSubject: + Enabled: false +RSpec/LeakyConstantDeclaration: + Enabled: false +RSpec/LetBeforeExamples: + Enabled: false +RSpec/MatchArray: + Enabled: false +RSpec/MissingExampleGroupArgument: + Enabled: false RSpec/MultipleExpectations: - Max: 3 + Enabled: false +RSpec/MultipleMemoizedHelpers: + Enabled: false +RSpec/MultipleSubjects: + Enabled: false +RSpec/NestedGroups: + Enabled: false +RSpec/PredicateMatcher: + Enabled: false +RSpec/ReceiveCounts: + Enabled: false +RSpec/ReceiveNever: + Enabled: false +RSpec/RepeatedExampleGroupBody: + Enabled: false +RSpec/RepeatedExampleGroupDescription: + Enabled: false +RSpec/RepeatedIncludeExample: + Enabled: false +RSpec/ReturnFromStub: + Enabled: false +RSpec/SharedExamples: + Enabled: false +RSpec/StubbedMock: + Enabled: false +RSpec/UnspecifiedException: + Enabled: false +RSpec/VariableDefinition: + Enabled: false +RSpec/VoidExpect: + Enabled: false +RSpec/Yield: + Enabled: false +Security/Open: + Enabled: false +Style/AccessModifierDeclarations: + Enabled: false +Style/AccessorGrouping: + Enabled: false +Style/BisectedAttrAccessor: + Enabled: false +Style/CaseLikeIf: + Enabled: false +Style/ClassEqualityComparison: + Enabled: false +Style/ColonMethodDefinition: + Enabled: false +Style/CombinableLoops: + Enabled: false +Style/CommentedKeyword: + Enabled: false +Style/Dir: + Enabled: false +Style/DoubleCopDisableDirective: + Enabled: false +Style/EmptyBlockParameter: + Enabled: false +Style/EmptyLambdaParameter: + Enabled: false +Style/Encoding: + Enabled: false +Style/EvalWithLocation: + Enabled: false +Style/ExpandPathArguments: + Enabled: false +Style/ExplicitBlockArgument: + Enabled: false +Style/ExponentialNotation: + Enabled: false +Style/FloatDivision: + Enabled: false +Style/FrozenStringLiteralComment: + Enabled: false +Style/GlobalStdStream: + Enabled: false +Style/HashAsLastArrayItem: + Enabled: false +Style/HashLikeCase: + Enabled: false +Style/HashTransformKeys: + Enabled: false +Style/HashTransformValues: + Enabled: false +Style/IfUnlessModifier: + Enabled: false +Style/KeywordParametersOrder: + Enabled: false +Style/MinMax: + Enabled: false +Style/MixinUsage: + Enabled: false +Style/MultilineWhenThen: + Enabled: false +Style/NegatedUnless: + Enabled: false +Style/NumericPredicate: + Enabled: false +Style/OptionalBooleanParameter: + Enabled: false +Style/OrAssignment: + Enabled: false +Style/RandomWithOffset: + Enabled: false +Style/RedundantAssignment: + Enabled: false +Style/RedundantCondition: + Enabled: false +Style/RedundantConditional: + Enabled: false +Style/RedundantFetchBlock: + Enabled: false +Style/RedundantFileExtensionInRequire: + Enabled: false +Style/RedundantRegexpCharacterClass: + Enabled: false +Style/RedundantRegexpEscape: + Enabled: false +Style/RedundantSelfAssignment: + Enabled: false +Style/RedundantSort: + Enabled: false +Style/RescueStandardError: + Enabled: false +Style/SingleArgumentDig: + Enabled: false +Style/SlicingWithRange: + Enabled: false +Style/SoleNestedConditional: + Enabled: false +Style/StderrPuts: + Enabled: false +Style/StringConcatenation: + Enabled: false +Style/Strip: + Enabled: false +Style/SymbolProc: + Enabled: false +Style/TrailingBodyOnClass: + Enabled: false +Style/TrailingBodyOnMethodDefinition: + Enabled: false +Style/TrailingBodyOnModule: + Enabled: false +Style/TrailingCommaInHashLiteral: + Enabled: false +Style/TrailingMethodEndStatement: + Enabled: false +Style/UnpackFirst: + Enabled: false +Capybara/MatchStyle: + Enabled: false +Capybara/NegationMatcher: + Enabled: false +Capybara/SpecificActions: + Enabled: false +Capybara/SpecificFinders: + Enabled: false +Capybara/SpecificMatcher: + Enabled: false +Gemspec/DeprecatedAttributeAssignment: + Enabled: false +Gemspec/DevelopmentDependencies: + Enabled: false +Gemspec/RequireMFA: + Enabled: false +Layout/LineContinuationLeadingSpace: + Enabled: false +Layout/LineContinuationSpacing: + Enabled: false +Layout/LineEndStringConcatenationIndentation: + Enabled: false +Layout/SpaceBeforeBrackets: + Enabled: false +Lint/AmbiguousAssignment: + Enabled: false +Lint/AmbiguousOperatorPrecedence: + Enabled: false +Lint/AmbiguousRange: + Enabled: false +Lint/ConstantOverwrittenInRescue: + Enabled: false +Lint/DeprecatedConstants: + Enabled: false +Lint/DuplicateBranch: + Enabled: false +Lint/DuplicateMagicComment: + Enabled: false +Lint/DuplicateRegexpCharacterClassElement: + Enabled: false +Lint/EmptyBlock: + Enabled: false +Lint/EmptyClass: + Enabled: false +Lint/EmptyInPattern: + Enabled: false +Lint/IncompatibleIoSelectWithFiberScheduler: + Enabled: false +Lint/LambdaWithoutLiteralBlock: + Enabled: false +Lint/NoReturnInBeginEndBlocks: + Enabled: false +Lint/NonAtomicFileOperation: + Enabled: false +Lint/NumberedParameterAssignment: + Enabled: false +Lint/OrAssignmentToConstant: + Enabled: false +Lint/RedundantDirGlobSort: + Enabled: false +Lint/RefinementImportMethods: + Enabled: false +Lint/RequireRangeParentheses: + Enabled: false +Lint/RequireRelativeSelfPath: + Enabled: false +Lint/SymbolConversion: + Enabled: false +Lint/ToEnumArguments: + Enabled: false +Lint/TripleQuotes: + Enabled: false +Lint/UnexpectedBlockArity: + Enabled: false +Lint/UnmodifiedReduceAccumulator: + Enabled: false +Lint/UselessRescue: + Enabled: false +Lint/UselessRuby2Keywords: + Enabled: false +Metrics/CollectionLiteralLength: + Enabled: false +Naming/BlockForwarding: + Enabled: false +Performance/CollectionLiteralInLoop: + Enabled: false +Performance/ConcurrentMonotonicTime: + Enabled: false +Performance/MapCompact: + Enabled: false +Performance/RedundantEqualityComparisonBlock: + Enabled: false +Performance/RedundantSplitRegexpArgument: + Enabled: false +Performance/StringIdentifierArgument: + Enabled: false +RSpec/BeEq: + Enabled: false +RSpec/BeNil: + Enabled: false +RSpec/ChangeByZero: + Enabled: false +RSpec/ClassCheck: + Enabled: false +RSpec/DuplicatedMetadata: + Enabled: false +RSpec/ExcessiveDocstringSpacing: + Enabled: false +RSpec/FactoryBot/ConsistentParenthesesStyle: + Enabled: false +RSpec/FactoryBot/FactoryNameStyle: + Enabled: false +RSpec/FactoryBot/SyntaxMethods: + Enabled: false +RSpec/IdenticalEqualityAssertion: + Enabled: false +RSpec/NoExpectationExample: + Enabled: false +RSpec/PendingWithoutReason: + Enabled: false +RSpec/Rails/AvoidSetupHook: + Enabled: false +RSpec/Rails/HaveHttpStatus: + Enabled: false +RSpec/Rails/InferredSpecType: + Enabled: false +RSpec/Rails/MinitestAssertions: + Enabled: false +RSpec/Rails/TravelAround: + Enabled: false +RSpec/RedundantAround: + Enabled: false +RSpec/SkipBlockInsideExample: + Enabled: false +RSpec/SortMetadata: + Enabled: false +RSpec/SubjectDeclaration: + Enabled: false +RSpec/VerifiedDoubleReference: + Enabled: false +Security/CompoundHash: + Enabled: false +Security/IoMethods: + Enabled: false +Style/ArgumentsForwarding: + Enabled: false +Style/ArrayIntersect: + Enabled: false +Style/CollectionCompact: + Enabled: false +Style/ComparableClamp: + Enabled: false +Style/ConcatArrayLiterals: + Enabled: false +Style/DirEmpty: + Enabled: false +Style/DocumentDynamicEvalDefinition: + Enabled: false +Style/EmptyHeredoc: + Enabled: false +Style/EndlessMethod: + Enabled: false +Style/EnvHome: + Enabled: false +Style/FetchEnvVar: + Enabled: false +Style/FileEmpty: + Enabled: false +Style/FileRead: + Enabled: false +Style/FileWrite: + Enabled: false +Style/HashConversion: + Enabled: false +Style/HashExcept: + Enabled: false +Style/IfWithBooleanLiteralBranches: + Enabled: false +Style/InPatternThen: + Enabled: false +Style/MagicCommentFormat: + Enabled: false +Style/MapCompactWithConditionalBlock: + Enabled: false +Style/MapToHash: + Enabled: false +Style/MapToSet: + Enabled: false +Style/MinMaxComparison: + Enabled: false +Style/MultilineInPatternThen: + Enabled: false +Style/NegatedIfElseCondition: + Enabled: false +Style/NestedFileDirname: + Enabled: false +Style/NilLambda: + Enabled: false +Style/NumberedParameters: + Enabled: false +Style/NumberedParametersLimit: + Enabled: false +Style/ObjectThen: + Enabled: false +Style/OpenStructUse: + Enabled: false +Style/OperatorMethodCall: + Enabled: false +Style/QuotedSymbols: + Enabled: false +Style/RedundantArgument: + Enabled: false +Style/RedundantConstantBase: + Enabled: false +Style/RedundantDoubleSplatHashBraces: + Enabled: false +Style/RedundantEach: + Enabled: false +Style/RedundantHeredocDelimiterQuotes: + Enabled: false +Style/RedundantInitialize: + Enabled: false +Style/RedundantSelfAssignmentBranch: + Enabled: false +Style/RedundantStringEscape: + Enabled: false +Style/SelectByRegexp: + Enabled: false +Style/StringChars: + Enabled: false +Style/SwapValues: + Enabled: false diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0157c284..32286ea0 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,49 +1,14 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2023-04-17 12:22:29 UTC using RuboCop version 1.48.1. +# on 2023-11-28 05:16:01 UTC using RuboCop version 1.48.1. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new # versions of RuboCop, may require this file to be generated again. -# Offense count: 11 -# Configuration parameters: IgnoredMetadata. -RSpec/DescribeClass: - Exclude: - - '**/spec/features/**/*' - - '**/spec/requests/**/*' - - '**/spec/routing/**/*' - - '**/spec/system/**/*' - - '**/spec/views/**/*' - - 'spec/acceptance/install_spec.rb' - - 'spec/classes/java_spec.rb' - - 'spec/defines/adopt_spec.rb' - - 'spec/defines/adoptium_spec.rb' - - 'spec/defines/download_spec.rb' - - 'spec/defines/sap_spec.rb' - - 'spec/unit/facter/java_default_home_spec.rb' - - 'spec/unit/facter/java_libjvm_path_spec.rb' - - 'spec/unit/facter/java_major_version_spec.rb' - - 'spec/unit/facter/java_patch_level_spec.rb' - - 'spec/unit/facter/java_version_spec.rb' - -# Offense count: 3 +# Offense count: 2 # Configuration parameters: EnforcedStyle, IgnoreSharedExamples. # SupportedStyles: always, named_only RSpec/NamedSubject: Exclude: - - 'spec/classes/java_spec.rb' - 'spec/defines/download_spec.rb' - -# Offense count: 12 -# Configuration parameters: AllowedPatterns. -# AllowedPatterns: ^expect_, ^assert_ -RSpec/NoExpectationExample: - Exclude: - - 'spec/acceptance/install_spec.rb' - - 'spec/unit/facter/java_default_home_spec.rb' - -# Offense count: 1 -Style/MixinUsage: - Exclude: - - 'spec/spec_helper.rb' diff --git a/.sync.yml b/.sync.yml index 28f0f9b0..5baf54b1 100644 --- a/.sync.yml +++ b/.sync.yml @@ -3,7 +3,8 @@ delete: true appveyor.yml: delete: true - +.rubocop.yml: + include_todos: true Gemfile: optional: ":development": diff --git a/Gemfile b/Gemfile index 6235e42e..86e337ad 100644 --- a/Gemfile +++ b/Gemfile @@ -14,31 +14,35 @@ def location_for(place_or_version, fake_version = nil) end group :development do - 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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "voxpupuli-puppet-lint-plugins", '~> 4.0', require: false - gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '>= 2.0.2', '< 4.0.0', require: false - gem "puppetlabs_spec_helper", '~> 5.0', require: false - gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false - gem "dependency_checker", '~> 0.2', require: false - gem "parallel_tests", '= 3.12.1', require: false - gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false - gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.48.1', require: false - gem "rubocop-performance", '= 1.16.0', require: false - gem "rubocop-rspec", '= 2.19.0', require: false - gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '= 1.15.2', require: false + 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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false + gem "facterdb", '~> 1.18', require: false + gem "metadata-json-lint", '~> 3.0', require: false + gem "rspec-puppet-facts", '~> 2.0', require: false + gem "codecov", '~> 0.2', require: false + gem "dependency_checker", '~> 1.0.0', require: false + gem "parallel_tests", '= 3.12.1', require: false + gem "pry", '~> 0.10', require: false + gem "simplecov-console", '~> 0.5', require: false + gem "puppet-debugger", '~> 1.0', require: false + gem "rubocop", '= 1.48.1', require: false + gem "rubocop-performance", '= 1.16.0', require: false + gem "rubocop-rspec", '= 2.19.0', require: false + gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] - gem "serverspec", '~> 2.41', require: false + gem "serverspec", '~> 2.41', require: false +end +group :release_prep do + gem "puppet-strings", '~> 4.0', require: false + gem "puppetlabs_spec_helper", '~> 7.0', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index 0f8754eb..74415a96 100644 --- a/Rakefile +++ b/Rakefile @@ -1,12 +1,11 @@ # frozen_string_literal: true require 'bundler' -require 'puppet_litmus/rake_tasks' if Bundler.rubygems.find_name('puppet_litmus').any? +require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -require 'puppet_blacksmith/rake_tasks' if Bundler.rubygems.find_name('puppet-blacksmith').any? -require 'github_changelog_generator/task' if Bundler.rubygems.find_name('github_changelog_generator').any? -require 'puppet-strings/tasks' if Bundler.rubygems.find_name('puppet-strings').any? +require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' +require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' def changelog_user return unless Rake.application.top_level_tasks.include? "changelog" @@ -44,7 +43,7 @@ end PuppetLint.configuration.send('disable_relative') -if Bundler.rubygems.find_name('github_changelog_generator').any? +if Gem.loaded_specs.key? 'github_changelog_generator' GitHubChangelogGenerator::RakeTask.new :changelog do |config| raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? config.user = "#{changelog_user}" diff --git a/metadata.json b/metadata.json index 16926110..0a58b448 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-gc6d4446", - "pdk-version": "2.7.1" + "template-ref": "heads/main-0-g01c6a19", + "pdk-version": "3.0.0" } diff --git a/spec/default_facts.yml b/spec/default_facts.yml index f3946607..3346c394 100644 --- a/spec/default_facts.yml +++ b/spec/default_facts.yml @@ -3,7 +3,7 @@ # Facts specified here will override the values provided by rspec-puppet-facts. --- networking: - ip: "172.16.254.254" - ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" - mac: "AA:AA:AA:AA:AA:AA" + ip: "172.16.254.254" + ip6: "FE80:0000:0000:0000:AAAA:AAAA:AAAA" + mac: "AA:AA:AA:AA:AA:AA" is_pe: false diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index c6e55257..6820cebe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -13,7 +13,7 @@ default_facts = { puppetversion: Puppet.version, - facterversion: Facter.version + facterversion: Facter.version, } default_fact_files = [ @@ -25,7 +25,7 @@ next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), [], [], true)) + default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end From 5cf4f07e63e9b9347cf754d37dd884e40045d3b0 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Thu, 21 Dec 2023 13:02:43 +0530 Subject: [PATCH 225/259] (MAINT) PDK Update --- .sync.yml | 5 ---- Gemfile | 5 ++-- Rakefile | 79 --------------------------------------------------- metadata.json | 2 +- 4 files changed, 4 insertions(+), 87 deletions(-) diff --git a/.sync.yml b/.sync.yml index 5baf54b1..afecd940 100644 --- a/.sync.yml +++ b/.sync.yml @@ -5,11 +5,6 @@ appveyor.yml: delete: true .rubocop.yml: include_todos: true -Gemfile: - optional: - ":development": - - gem: github_changelog_generator - version: '= 1.15.2' spec/spec_helper.rb: mock_with: ":rspec" coverage_report: true diff --git a/Gemfile b/Gemfile index 86e337ad..ca0e773e 100644 --- a/Gemfile +++ b/Gemfile @@ -23,6 +23,7 @@ group :development do gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false gem "facterdb", '~> 1.18', require: false gem "metadata-json-lint", '~> 3.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false gem "rspec-puppet-facts", '~> 2.0', require: false gem "codecov", '~> 0.2', require: false gem "dependency_checker", '~> 1.0.0', require: false @@ -33,8 +34,8 @@ group :development do gem "rubocop", '= 1.48.1', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false + gem "puppet-strings", '~> 4.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "github_changelog_generator", '= 1.15.2', require: false end group :system_tests do gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] @@ -42,7 +43,7 @@ group :system_tests do end group :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 7.0', require: false + gem "puppetlabs_spec_helper", '~> 6.0', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/Rakefile b/Rakefile index 74415a96..77590fe6 100644 --- a/Rakefile +++ b/Rakefile @@ -4,85 +4,6 @@ require 'bundler' require 'puppet_litmus/rake_tasks' if Gem.loaded_specs.key? 'puppet_litmus' require 'puppetlabs_spec_helper/rake_tasks' require 'puppet-syntax/tasks/puppet-syntax' -require 'github_changelog_generator/task' if Gem.loaded_specs.key? 'github_changelog_generator' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' -def changelog_user - return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = nil || JSON.load(File.read('metadata.json'))['author'] - raise "unable to find the changelog_user in .sync.yml, or the author in metadata.json" if returnVal.nil? - puts "GitHubChangelogGenerator user:#{returnVal}" - returnVal -end - -def changelog_project - return unless Rake.application.top_level_tasks.include? "changelog" - - 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 - -def changelog_future_release - return unless Rake.application.top_level_tasks.include? "changelog" - returnVal = "v%s" % JSON.load(File.read('metadata.json'))['version'] - raise "unable to find the future_release (version) in metadata.json" if returnVal.nil? - puts "GitHubChangelogGenerator future_release:#{returnVal}" - returnVal -end - PuppetLint.configuration.send('disable_relative') - - -if Gem.loaded_specs.key? 'github_changelog_generator' - GitHubChangelogGenerator::RakeTask.new :changelog do |config| - raise "Set CHANGELOG_GITHUB_TOKEN environment variable eg 'export CHANGELOG_GITHUB_TOKEN=valid_token_here'" if Rake.application.top_level_tasks.include? "changelog" and ENV['CHANGELOG_GITHUB_TOKEN'].nil? - config.user = "#{changelog_user}" - config.project = "#{changelog_project}" - config.future_release = "#{changelog_future_release}" - config.exclude_labels = ['maintenance'] - 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; LABEL THEM ON GITHUB" - config.configure_sections = { - "Changed" => { - "prefix" => "### Changed", - "labels" => ["backwards-incompatible"], - }, - "Added" => { - "prefix" => "### Added", - "labels" => ["enhancement", "feature"], - }, - "Fixed" => { - "prefix" => "### Fixed", - "labels" => ["bug", "documentation", "bugfix"], - }, - } - end -else - desc 'Generate a Changelog from GitHub' - task :changelog do - raise < 1.15' - condition: "Gem::Version.new(RUBY_VERSION.dup) >= Gem::Version.new('2.3.0')" -EOM - end -end - diff --git a/metadata.json b/metadata.json index 0a58b448..b50a98a0 100644 --- a/metadata.json +++ b/metadata.json @@ -81,6 +81,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g01c6a19", + "template-ref": "heads/main-0-g79a2f93", "pdk-version": "3.0.0" } From f111a5f98c568135d71564847f151d483857bb21 Mon Sep 17 00:00:00 2001 From: Ramesh Sencha Date: Thu, 18 Jan 2024 18:14:25 +0530 Subject: [PATCH 226/259] (CAT-1696) - Skip CI pipeline for ARM OS --- .github/workflows/ci.yml | 1 + .github/workflows/nightly.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b0e39c3..87458beb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,3 +17,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index aaa4967f..ebbaa7ff 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,3 +16,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" From b4119681e47eb1dc5324e8d21b948e99c8926f85 Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 29 Feb 2024 12:01:22 +0100 Subject: [PATCH 227/259] Refactor params to have less duplication This introduces variables to make it easier to support multiple versions. --- manifests/params.pp | 57 +++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index cfbaa289..75c81292 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -11,27 +11,23 @@ 'AlmaLinux', 'Rocky', 'RedHat', 'CentOS', 'OracleLinux', 'Scientific', 'OEL', 'SLC', 'CloudLinux': { # See PR#160 / c8e46b5 for why >= 6.3 < 7.1 if (versioncmp($facts['os']['release']['full'], '7.1') < 0) { - $jdk_package = 'java-1.7.0-openjdk-devel' - $jre_package = 'java-1.7.0-openjdk' - $java_home = '/usr/lib/jvm/java-1.7.0/' - } - else { - $jdk_package = 'java-1.8.0-openjdk-devel' - $jre_package = 'java-1.8.0-openjdk' - $java_home = '/usr/lib/jvm/java-1.8.0/' + $openjdk = '1.7.0' + } else { + $openjdk = '1.8.0' } + $jdk_package = "java-${openjdk}-openjdk-devel" + $jre_package = "java-${openjdk}-openjdk" + $java_home = "/usr/lib/jvm/java-${openjdk}/" } 'Fedora': { if (versioncmp($facts['os']['release']['full'], '21') < 0) { - $jdk_package = 'java-1.7.0-openjdk-devel' - $jre_package = 'java-1.7.0-openjdk' - $java_home = "/usr/lib/jvm/java-1.7.0-openjdk-${facts['os']['architecture']}/" - } - else { - $jdk_package = 'java-1.8.0-openjdk-devel' - $jre_package = 'java-1.8.0-openjdk' - $java_home = "/usr/lib/jvm/java-1.8.0-openjdk-${facts['os']['architecture']}/" + $openjdk = '1.7.0' + } else { + $openjdk = '1.8.0' } + $jdk_package = "java-${openjdk}-openjdk-devel" + $jre_package = "java-${openjdk}-openjdk" + $java_home = "/usr/lib/jvm/java-${openjdk}-openjdk-${facts['os']['architecture']}/" } 'Amazon': { $jdk_package = 'java-1.7.0-openjdk-devel' @@ -63,23 +59,24 @@ } case $facts['os']['release']['major'] { '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04', '22.04': { - $java = { - 'jdk' => { - 'package' => 'openjdk-11-jdk', - 'alternative' => "java-1.11.0-openjdk-${openjdk_architecture}", - 'alternative_path' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/", - }, - 'jre' => { - 'package' => 'openjdk-11-jre-headless', - 'alternative' => "java-1.11.0-openjdk-${openjdk_architecture}", - 'alternative_path' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/bin/java", - 'java_home' => "/usr/lib/jvm/java-1.11.0-openjdk-${openjdk_architecture}/", - }, - } + $openjdk = 11 } default: { fail("unsupported release ${facts['os']['release']['major']}") } } + $java = { + 'jdk' => { + 'package' => "openjdk-${openjdk}-jdk", + 'alternative' => "java-1.${openjdk}.0-openjdk-${openjdk_architecture}", + 'alternative_path' => "/usr/lib/jvm/java-1.${openjdk}.0-openjdk-${openjdk_architecture}/bin/java", + 'java_home' => "/usr/lib/jvm/java-1.${openjdk}.0-openjdk-${openjdk_architecture}/", + }, + 'jre' => { + 'package' => "openjdk-${openjdk}-jre-headless", + 'alternative' => "java-1.${openjdk}.0-openjdk-${openjdk_architecture}", + 'alternative_path' => "/usr/lib/jvm/java-1.${openjdk}.0-openjdk-${openjdk_architecture}/bin/java", + 'java_home' => "/usr/lib/jvm/java-1.${openjdk}.0-openjdk-${openjdk_architecture}/", + }, + } } 'OpenBSD': { $java = { From bd970c95817fca74eb8cdb211e1eac7072b52fad Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 29 Feb 2024 12:05:51 +0100 Subject: [PATCH 228/259] Reduce duplication in spec tests by using nesting This sets up common contexts for an OS and then runs the tests within those. This avoids duplicating the fact definitions. --- spec/classes/java_spec.rb | 59 +++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 09906916..632987d5 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -10,49 +10,54 @@ it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.8.0/') } end - context 'when selecting jdk for Debian Buster (10.0)' do + context 'on Debian Buster (10.0)' do let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '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 selecting jdk' do + let(:params) { { 'distribution' => 'jdk' } } - context 'when selecting jre for Debian Buster (10.0)' do - let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'buster' }, release: { major: '10' }, architecture: 'amd64' } } } - let(:params) { { 'distribution' => 'jre' } } + 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 selecting jre' do + 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/') } + 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 end - context 'when selecting jdk for Ubuntu Bionic (18.04)' do + context 'on Ubuntu Bionic (18.04)' do let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, 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 selecting jdk' do + let(:params) { { 'distribution' => 'jdk' } } - context 'when selecting jre for Ubuntu Bionic (18.04)' do - let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } - let(:params) { { 'distribution' => 'jre' } } + 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 selecting jre' do + 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/') } + 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 end - context 'when selecting openjdk for Oracle Linux' do + context 'on Oracle Linux 7.0' do let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '7.0' }, architecture: 'x86_64' } } } - it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } - end + context 'when selecting openjdk' do + it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk-devel') } + end - context 'when selecting passed value for Oracle Linux' do - let(:facts) { { os: { family: 'RedHat', name: 'OracleLinux', release: { full: '7.0' }, architecture: 'x86_64' } } } - let(:params) { { 'distribution' => 'jre' } } + context 'when selecting passed value for Oracle Linux' do + let(:params) { { 'distribution' => 'jre' } } - it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } + it { is_expected.to contain_package('java').with_name('java-1.7.0-openjdk') } + end end context 'when selecting passed value for Scientific Linux' do From 00c7eb14802f1658a24d842d8f8b9717ca2b7f5b Mon Sep 17 00:00:00 2001 From: Ewoud Kohl van Wijngaarden Date: Thu, 29 Feb 2024 12:03:21 +0100 Subject: [PATCH 229/259] Support Debian 12 --- manifests/params.pp | 3 +++ metadata.json | 3 ++- spec/classes/java_spec.rb | 18 ++++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/manifests/params.pp b/manifests/params.pp index 75c81292..a301347f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -58,6 +58,9 @@ default => $facts['os']['architecture'] } case $facts['os']['release']['major'] { + '12': { + $openjdk = 17 + } '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04', '22.04': { $openjdk = 11 } diff --git a/metadata.json b/metadata.json index b50a98a0..529e45f8 100644 --- a/metadata.json +++ b/metadata.json @@ -43,7 +43,8 @@ "operatingsystem": "Debian", "operatingsystemrelease": [ "10", - "11" + "11", + "12" ] }, { diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 632987d5..9908af9c 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -28,6 +28,24 @@ end end + context 'on Debian Bookworm (12)' do + let(:facts) { { os: { family: 'Debian', name: 'Debian', lsb: { distcodename: 'bookworm' }, release: { major: '12' }, architecture: 'amd64' } } } + + context 'when selecting jdk' do + let(:params) { { 'distribution' => 'jdk' } } + + it { is_expected.to contain_package('java').with_name('openjdk-17-jdk') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64/') } + end + + context 'when selecting jre' do + let(:params) { { 'distribution' => 'jre' } } + + it { is_expected.to contain_package('java').with_name('openjdk-17-jre-headless') } + it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib/jvm/java-1.17.0-openjdk-amd64/') } + end + end + context 'on Ubuntu Bionic (18.04)' do let(:facts) { { os: { family: 'Debian', name: 'Ubuntu', lsb: { distcodename: 'bionic' }, release: { major: '18.04' }, architecture: 'amd64' } } } From 686ea55e571ac4efef76551b08ad2f1cc2ccfe08 Mon Sep 17 00:00:00 2001 From: Sven Dewit Date: Thu, 14 Mar 2024 11:49:17 +0100 Subject: [PATCH 230/259] fix: remove puppetlabs-puppet_agent pinning --- .fixtures.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index 4de712c2..c675307e 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -3,9 +3,7 @@ fixtures: 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: - repo: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' - ref: v4.13.0 + puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git' provision: 'https://github.com/puppetlabs/provision.git' symlinks: java: "#{source_dir}" From baf10dcbc5b18e5a2087bdba0e690bc6d623ede6 Mon Sep 17 00:00:00 2001 From: Sven Dewit Date: Thu, 14 Mar 2024 12:20:25 +0100 Subject: [PATCH 231/259] chore: remove legacy symlink --- .fixtures.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.fixtures.yml b/.fixtures.yml index c675307e..c5ff6f25 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -5,5 +5,3 @@ fixtures: 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}" From fd4a9c9cfc2877b7ebfacec39c8d592f1c158fa3 Mon Sep 17 00:00:00 2001 From: Julien Godin Date: Thu, 21 Mar 2024 12:39:41 +0100 Subject: [PATCH 232/259] Feat: Allow to download from a login/password protected URL Signed-off-by: Julien Godin --- manifests/download.pp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/manifests/download.pp b/manifests/download.pp index e8593820..4d451ffc 100644 --- a/manifests/download.pp +++ b/manifests/download.pp @@ -28,11 +28,23 @@ # @param url # Full URL # +# @param username +# Username for the URL +# +# @param password +# Password for the URL +# # @param jce # Install Oracles Java Cryptographic Extensions into the JRE or JDK # # @param jce_url # Full URL to the jce zip file +# +# @param jce_username +# Username for the JCE URL +# +# @param jce_password +# Password for the JCE URL # # @param basedir # Directory under which the installation will occur. If not set, defaults to @@ -62,8 +74,12 @@ Optional[String] $proxy_server = undef, Optional[Enum['none', 'http', 'https', 'ftp']] $proxy_type = undef, Optional[String] $url = undef, + Optional[String] $username = undef, + Optional[String] $password = undef, Boolean $jce = false, Optional[String] $jce_url = undef, + Optional[String] $jce_username = undef, + Optional[String] $jce_password = undef, Optional[String] $basedir = undef, Boolean $manage_basedir = false, Optional[String] $package_type = undef, @@ -258,6 +274,8 @@ archive { $destination : ensure => present, source => $source, + username => $username, + password => $password, extract_path => '/tmp', cleanup => false, creates => $creates_path, @@ -309,6 +327,8 @@ extract_path => $jce_path, extract_flags => '-oj', creates => "${jce_path}/US_export_policy.jar", + username => $jce_username, + password => $jce_password, cleanup => false, proxy_server => $proxy_server, proxy_type => $proxy_type, From 9669378fb2fb147772df4e0504cc2bcf34988368 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Tue, 26 Mar 2024 14:14:38 +0100 Subject: [PATCH 233/259] Add bastelfreak to CODEOWNERS I'm in the trusted contributors group but somehow the CODEOWNERS change was missing. --- CODEOWNERS | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CODEOWNERS b/CODEOWNERS index a5d109e9..13360c54 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -1,2 +1,3 @@ # Setting ownership to the modules team -* @puppetlabs/modules +# include Trusted Contributors +* @puppetlabs/modules @bastelfreak From 5d7eb1bcd9ec7f2723638e00a74f083d7dc1ff24 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 2 Apr 2024 21:09:38 +0530 Subject: [PATCH 234/259] Fix mend to run on cron --- .github/workflows/mend.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index b4100a5a..8b5b4018 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -1,9 +1,10 @@ name: "mend" on: - pull_request: - branches: - - "main" + pull_request_target: + types: + - opened + - synchronize schedule: - cron: "0 0 * * *" workflow_dispatch: From db63dcf1c576e7de1469e749090686e49ee556b8 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 15 Apr 2024 06:46:38 +0000 Subject: [PATCH 235/259] Release prep v11.0.0 --- CHANGELOG.md | 41 ++++++++++++------- REFERENCE.md | 107 +++++++++++++++++++++++++------------------------- metadata.json | 2 +- 3 files changed, 81 insertions(+), 69 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a46653af..8cb6b800 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ 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). +## [v11.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.0) - 2024-04-15 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.2...v11.0.0) + +### Changed +- [CAT-1427] : Removing RedHat/Scientific/OracleLinux 6 [#576](https://github.com/puppetlabs/puppetlabs-java/pull/576) ([rajat-puppet](https://github.com/rajat-puppet)) + +### Added + +- Support Debian 12 and refactor to make that easier [#585](https://github.com/puppetlabs/puppetlabs-java/pull/585) ([ekohl](https://github.com/ekohl)) + ## [v10.1.2](https://github.com/puppetlabs/puppetlabs-java/tree/v10.1.2) - 2023-07-27 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.1...v10.1.2) @@ -30,13 +41,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.1...v10.0.0) +### Changed +- (CONT-784) Add Support for Puppet 8 / Drop Support for Puppet 6 [#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) + ### Added - (CONT-356) Syntax update [#543](https://github.com/puppetlabs/puppetlabs-java/pull/543) ([LukasAud](https://github.com/LukasAud)) -### Changed -- (CONT-784) Add Support for Puppet 8 / Drop Support for Puppet 6 [#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) - ### Fixed - Fix shell_escape of unless command [#550](https://github.com/puppetlabs/puppetlabs-java/pull/550) ([traylenator](https://github.com/traylenator)) @@ -87,13 +98,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.3.0...v8.0.0) +### Changed +- (GH-C&T-7) Remove code specific to unsupported OSs [#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) + ### Added - (MODULES-11234) Support Adoptium Temurin [#502](https://github.com/puppetlabs/puppetlabs-java/pull/502) ([dploeger](https://github.com/dploeger)) -### Changed -- (GH-C&T-7) Remove code specific to unsupported OSs [#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) - ### Fixed - pdksync - (GH-iac-334) Remove Support for Ubuntu 14.04/16.04 [#505](https://github.com/puppetlabs/puppetlabs-java/pull/505) ([david22swan](https://github.com/david22swan)) @@ -235,15 +246,15 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v4.1.0...v5.0.0) +### Changed +- [FM-8320] Remove Oracle download [#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) + ### Added - (FM-8223) converted to use litmus [#376](https://github.com/puppetlabs/puppetlabs-java/pull/376) ([tphoney](https://github.com/tphoney)) - Add buster support, default to 11 [#369](https://github.com/puppetlabs/puppetlabs-java/pull/369) ([mhjacks](https://github.com/mhjacks)) - Add support for debian buster [#364](https://github.com/puppetlabs/puppetlabs-java/pull/364) ([TomRitserveldt](https://github.com/TomRitserveldt)) -### Changed -- [FM-8320] Remove Oracle download [#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) - ### Fixed - (FM-8343) use release numbers not lsbdistcodename [#375](https://github.com/puppetlabs/puppetlabs-java/pull/375) ([tphoney](https://github.com/tphoney)) @@ -261,6 +272,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.3.0...v4.0.0) +### Changed +- pdksync - (MODULES-8444) - Raise lower Puppet bound [#356](https://github.com/puppetlabs/puppetlabs-java/pull/356) ([david22swan](https://github.com/david22swan)) + ### Added - (FM-7921) - Implement Puppet Strings [#353](https://github.com/puppetlabs/puppetlabs-java/pull/353) ([david22swan](https://github.com/david22swan)) @@ -268,9 +282,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a - Add ability to override basedir and package type for oracle java [#345](https://github.com/puppetlabs/puppetlabs-java/pull/345) ([fraenki](https://github.com/fraenki)) - MODULES-8613: Add option to set a custom JCE download URL [#344](https://github.com/puppetlabs/puppetlabs-java/pull/344) ([HielkeJ](https://github.com/HielkeJ)) -### Changed -- pdksync - (MODULES-8444) - Raise lower Puppet bound [#356](https://github.com/puppetlabs/puppetlabs-java/pull/356) ([david22swan](https://github.com/david22swan)) - ### Fixed - MODULES-8698: Fix $install_path on CentOS with tar.gz package type [#349](https://github.com/puppetlabs/puppetlabs-java/pull/349) ([fraenki](https://github.com/fraenki)) @@ -316,13 +327,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.4.0...3.0.0) +### Changed +- [FM-6963] Removal of unsupported OS from java [#295](https://github.com/puppetlabs/puppetlabs-java/pull/295) ([david22swan](https://github.com/david22swan)) + ### Added - (MODULES-7561) - Addition of support for Ubuntu 18.04 to java [#299](https://github.com/puppetlabs/puppetlabs-java/pull/299) ([david22swan](https://github.com/david22swan)) -### Changed -- [FM-6963] Removal of unsupported OS from java [#295](https://github.com/puppetlabs/puppetlabs-java/pull/295) ([david22swan](https://github.com/david22swan)) - ### Fixed - Remove ensure_resource to avoid potential conflict [#287](https://github.com/puppetlabs/puppetlabs-java/pull/287) ([sevencastles](https://github.com/sevencastles)) diff --git a/REFERENCE.md b/REFERENCE.md index 9ed34192..f8064267 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -137,7 +137,7 @@ The following parameters are available in the `java::adopt` defined type: ##### `ensure` -Data type: `Any` +Data type: `Enum['present']` Install or remove the package. @@ -145,7 +145,7 @@ Default value: `'present'` ##### `version` -Data type: `Any` +Data type: `String[1]` Version of Java to install, e.g. '8' or '9'. Default values for major and minor versions will be used. @@ -153,7 +153,7 @@ Default value: `'8'` ##### `version_major` -Data type: `Any` +Data type: `Optional[String]` Major version which should be installed, e.g. '8u101' or '9.0.4'. Must be used together with version_minor. @@ -161,15 +161,16 @@ Default value: `undef` ##### `version_minor` -Data type: `Any` +Data type: `Optional[String]` -Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). Must be used together with version_major. +Minor version which should be installed, e.g. 'b12' (for version = '8') or '11' (for version != '8'). +Must be used together with version_major. Default value: `undef` ##### `java` -Data type: `Any` +Data type: `String[1]` Type of Java Standard Edition to install, jdk or jre. @@ -177,7 +178,7 @@ Default value: `'jdk'` ##### `proxy_server` -Data type: `Any` +Data type: `Optional[String]` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) @@ -185,7 +186,7 @@ Default value: `undef` ##### `proxy_type` -Data type: `Any` +Data type: `Optional[String]` Proxy server type (none|http|https|ftp). (passed to archive) @@ -193,7 +194,7 @@ Default value: `undef` ##### `url` -Data type: `Any` +Data type: `Optional[String]` Full URL @@ -201,7 +202,7 @@ Default value: `undef` ##### `basedir` -Data type: `Any` +Data type: `Optional[String]` Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -210,16 +211,16 @@ Default value: `undef` ##### `manage_basedir` -Data type: `Any` +Data type: `Boolean` -Whether to manage the basedir directory. Defaults to false. +Whether to manage the basedir directory. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. Default value: `true` ##### `package_type` -Data type: `Any` +Data type: `Optional[String]` Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. @@ -229,7 +230,7 @@ Default value: `undef` ##### `manage_symlink` -Data type: `Any` +Data type: `Boolean` Whether to manage a symlink that points to the installation directory. Defaults to false. @@ -237,7 +238,7 @@ Default value: `false` ##### `symlink_name` -Data type: `Any` +Data type: `Optional[String]` The name for the optional symlink in the installation directory. @@ -266,7 +267,7 @@ The following parameters are available in the `java::adoptium` defined type: ##### `ensure` -Data type: `Any` +Data type: `Enum['present']` Install or remove the package. @@ -274,7 +275,7 @@ Default value: `'present'` ##### `version_major` -Data type: `Any` +Data type: `Optional[String]` Major version which should be installed, e.g. '16' or '17' @@ -282,7 +283,7 @@ Default value: `undef` ##### `version_minor` -Data type: `Any` +Data type: `Optional[String]` Minor version which should be installed, e.g. '0' @@ -290,7 +291,7 @@ Default value: `undef` ##### `version_patch` -Data type: `Any` +Data type: `Optional[String]` Minor version which should be installed, e.g. '2' @@ -298,7 +299,7 @@ Default value: `undef` ##### `version_build` -Data type: `Any` +Data type: `Optional[String]` Build version which should be installed, e.g. '07' @@ -306,7 +307,7 @@ Default value: `undef` ##### `proxy_server` -Data type: `Any` +Data type: `Optional[String]` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) @@ -314,7 +315,7 @@ Default value: `undef` ##### `proxy_type` -Data type: `Any` +Data type: `Optional[Enum['none', 'http', 'https', 'ftp']]` Proxy server type (none|http|https|ftp). (passed to archive) @@ -322,7 +323,7 @@ Default value: `undef` ##### `url` -Data type: `Any` +Data type: `Optional[String]` Full URL @@ -330,7 +331,7 @@ Default value: `undef` ##### `basedir` -Data type: `Any` +Data type: `Optional[String]` Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -339,7 +340,7 @@ Default value: `undef` ##### `manage_basedir` -Data type: `Any` +Data type: `Boolean` Whether to manage the basedir directory. Defaults to false. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. @@ -348,7 +349,7 @@ Default value: `true` ##### `manage_symlink` -Data type: `Any` +Data type: `Boolean` Whether to manage a symlink that points to the installation directory. Defaults to false. @@ -356,7 +357,7 @@ Default value: `false` ##### `symlink_name` -Data type: `Any` +Data type: `Optional[String]` The name for the optional symlink in the installation directory. @@ -388,7 +389,7 @@ The following parameters are available in the `java::download` defined type: ##### `ensure` -Data type: `Any` +Data type: `Enum['present']` Install or remove the package. @@ -396,7 +397,7 @@ Default value: `'present'` ##### `version` -Data type: `Any` +Data type: `String[1]` Version of Java to install, e.g. '7' or '8'. Default values for major and minor versions will be used. @@ -404,7 +405,7 @@ Default value: `'8'` ##### `version_major` -Data type: `Any` +Data type: `Optional[String]` Major version which should be installed, e.g. '8u101'. Must be used together with version_minor. @@ -412,7 +413,7 @@ Default value: `undef` ##### `version_minor` -Data type: `Any` +Data type: `Optional[String]` Minor version which should be installed, e.g. 'b12'. Must be used together with version_major. @@ -420,7 +421,7 @@ Default value: `undef` ##### `java_se` -Data type: `Any` +Data type: `String[1]` Type of Java Standard Edition to install, jdk or jre. @@ -428,7 +429,7 @@ Default value: `'jdk'` ##### `proxy_server` -Data type: `Any` +Data type: `Optional[String]` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) @@ -436,7 +437,7 @@ Default value: `undef` ##### `proxy_type` -Data type: `Any` +Data type: `Optional[Enum['none', 'http', 'https', 'ftp']]` Proxy server type (none|http|https|ftp). (passed to archive) @@ -444,7 +445,7 @@ Default value: `undef` ##### `url` -Data type: `Any` +Data type: `Optional[String]` Full URL @@ -452,7 +453,7 @@ Default value: `undef` ##### `jce` -Data type: `Any` +Data type: `Boolean` Install Oracles Java Cryptographic Extensions into the JRE or JDK @@ -460,7 +461,7 @@ Default value: `false` ##### `jce_url` -Data type: `Any` +Data type: `Optional[String]` Full URL to the jce zip file @@ -468,7 +469,7 @@ Default value: `undef` ##### `basedir` -Data type: `Any` +Data type: `Optional[String]` Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -477,7 +478,7 @@ Default value: `undef` ##### `manage_basedir` -Data type: `Any` +Data type: `Boolean` Whether to manage the basedir directory. Defaults to false. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. @@ -486,7 +487,7 @@ Default value: `false` ##### `package_type` -Data type: `Any` +Data type: `Optional[String]` Type of installation package for specified version of java_se. java_se 6 comes in a few installation package flavors and we need to account for them. @@ -496,7 +497,7 @@ Default value: `undef` ##### `manage_symlink` -Data type: `Any` +Data type: `Boolean` Whether to manage a symlink that points to the installation directory. Defaults to false. @@ -504,7 +505,7 @@ Default value: `false` ##### `symlink_name` -Data type: `Any` +Data type: `Optional[String]` The name for the optional symlink in the installation directory. @@ -531,7 +532,7 @@ The following parameters are available in the `java::sap` defined type: ##### `ensure` -Data type: `Any` +Data type: `Enum['present']` Install or remove the package. @@ -539,7 +540,7 @@ Default value: `'present'` ##### `version` -Data type: `Any` +Data type: `String[1]` Version of Java to install, e.g. '8' or '9'. Default values for full versions will be used. @@ -547,7 +548,7 @@ Default value: `'8'` ##### `version_full` -Data type: `Any` +Data type: `Optional[String]` Major version which should be installed, e.g. '8.1.063' or '11.0.7'. If used, "version" parameter is ignored. @@ -555,7 +556,7 @@ Default value: `undef` ##### `java` -Data type: `Any` +Data type: `String[1]` Type of Java Edition to install, jdk or jre. @@ -563,7 +564,7 @@ Default value: `'jdk'` ##### `proxy_server` -Data type: `Any` +Data type: `Optional[String]` Specify a proxy server, with port number if needed. ie: https://example.com:8080. (passed to archive) @@ -571,7 +572,7 @@ Default value: `undef` ##### `proxy_type` -Data type: `Any` +Data type: `Optional[Enum['none', 'http', 'https', 'ftp']]` Proxy server type (none|http|https|ftp). (passed to archive) @@ -579,7 +580,7 @@ Default value: `undef` ##### `basedir` -Data type: `Any` +Data type: `Optional[String]` Directory under which the installation will occur. If not set, defaults to /usr/lib/jvm for Debian and /usr/java for RedHat. @@ -588,16 +589,16 @@ Default value: `undef` ##### `manage_basedir` -Data type: `Any` +Data type: `Boolean` -Whether to manage the basedir directory. Defaults to false. +Whether to manage the basedir directory. Note: /usr/lib/jvm is managed for Debian by default, separate from this parameter. Default value: `true` ##### `manage_symlink` -Data type: `Any` +Data type: `Boolean` Whether to manage a symlink that points to the installation directory. Defaults to false. @@ -605,7 +606,7 @@ Default value: `false` ##### `symlink_name` -Data type: `Any` +Data type: `Optional[String]` The name for the optional symlink in the installation directory. diff --git a/metadata.json b/metadata.json index 529e45f8..8fe1c175 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "10.1.2", + "version": "11.0.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From 7a86199de35d825919390358d3bac271f5a55531 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 21 May 2024 21:14:32 +0530 Subject: [PATCH 236/259] ITHELP-87329 : replace pull_request_target with pull_request --- .github/workflows/mend.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/mend.yml b/.github/workflows/mend.yml index 8b5b4018..b4100a5a 100644 --- a/.github/workflows/mend.yml +++ b/.github/workflows/mend.yml @@ -1,10 +1,9 @@ name: "mend" on: - pull_request_target: - types: - - opened - - synchronize + pull_request: + branches: + - "main" schedule: - cron: "0 0 * * *" workflow_dispatch: From 6209e8190202d6b6343048486c6ef0ba381221a1 Mon Sep 17 00:00:00 2001 From: Malik Parvez <84777619+malikparvez@users.noreply.github.com> Date: Tue, 4 Jun 2024 13:55:04 +0530 Subject: [PATCH 237/259] ITHELP-87329 : replace pull_request_target with pull_request --- .github/workflows/labeller.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml index ee149bf5..0d4870d7 100644 --- a/.github/workflows/labeller.yml +++ b/.github/workflows/labeller.yml @@ -6,7 +6,7 @@ on: - opened - labeled - unlabeled - pull_request_target: + pull_request: types: - opened - labeled From a26b3eae52177b7a1e6e6ebe27b2d6922e232c19 Mon Sep 17 00:00:00 2001 From: rajat-puppet Date: Mon, 22 Jul 2024 17:31:19 +0530 Subject: [PATCH 238/259] Remove labeller.yml --- .github/workflows/labeller.yml | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 .github/workflows/labeller.yml diff --git a/.github/workflows/labeller.yml b/.github/workflows/labeller.yml deleted file mode 100644 index 0d4870d7..00000000 --- a/.github/workflows/labeller.yml +++ /dev/null @@ -1,27 +0,0 @@ -name: Labeller - -on: - issues: - types: - - opened - - labeled - - unlabeled - pull_request: - types: - - opened - - labeled - - unlabeled - -jobs: - label: - runs-on: ubuntu-latest - steps: - - - uses: puppetlabs/community-labeller@v1.0.1 - name: Label issues or pull requests - with: - label_name: community - label_color: '5319e7' - org_membership: puppetlabs - fail_if_member: 'true' - token: ${{ secrets.IAC_COMMUNITY_LABELER }} From 63955c95be883b1cb2fc12f9b5ebcf79af5e3214 Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Tue, 10 Sep 2024 10:52:28 +0530 Subject: [PATCH 239/259] pdksync - (PF-3525) - pdk update for module --- .github/workflows/ci.yml | 3 ++- .github/workflows/nightly.yml | 3 ++- .github/workflows/release.yml | 2 +- .gitignore | 7 +++++++ .pdkignore | 7 +++++++ .rubocop.yml | 8 +++++++- .vscode/extensions.json | 2 +- Gemfile | 28 ++++++++++++++-------------- metadata.json | 4 ++-- spec/spec_helper.rb | 5 +++-- 10 files changed, 46 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87458beb..459c9045 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,4 +17,5 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" + \ No newline at end of file diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ebbaa7ff..22544b8f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,4 +16,5 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" + \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0b7b8a05..4b3b80fc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,7 +2,7 @@ name: "Publish module" on: workflow_dispatch: - + jobs: release: uses: "puppetlabs/cat-github-actions/.github/workflows/module_release.yml@main" diff --git a/.gitignore b/.gitignore index 3f155121..2803e566 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ /spec/fixtures/modules/* /tmp/ /vendor/ +/.vendor/ /convert_report.txt /update_report.txt .DS_Store @@ -26,3 +27,9 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml +.resource_types +.modules +.task_cache.json +.plan_cache.json +.rerun.json +bolt-debug.log diff --git a/.pdkignore b/.pdkignore index 862847a7..84684be6 100644 --- a/.pdkignore +++ b/.pdkignore @@ -19,6 +19,7 @@ /spec/fixtures/modules/* /tmp/ /vendor/ +/.vendor/ /convert_report.txt /update_report.txt .DS_Store @@ -26,6 +27,12 @@ .envrc /inventory.yaml /spec/fixtures/litmus_inventory.yaml +.resource_types +.modules +.task_cache.json +.plan_cache.json +.rerun.json +bolt-debug.log /.fixtures.yml /Gemfile /.gitattributes diff --git a/.rubocop.yml b/.rubocop.yml index 7a66e083..439ea84e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.7' + TargetRubyVersion: '2.6' Include: - "**/*.rb" Exclude: @@ -529,6 +529,8 @@ Lint/DuplicateBranch: Enabled: false Lint/DuplicateMagicComment: Enabled: false +Lint/DuplicateMatchPattern: + Enabled: false Lint/DuplicateRegexpCharacterClassElement: Enabled: false Lint/EmptyBlock: @@ -645,6 +647,8 @@ Style/ComparableClamp: Enabled: false Style/ConcatArrayLiterals: Enabled: false +Style/DataInheritance: + Enabled: false Style/DirEmpty: Enabled: false Style/DocumentDynamicEvalDefinition: @@ -713,6 +717,8 @@ Style/RedundantHeredocDelimiterQuotes: Enabled: false Style/RedundantInitialize: Enabled: false +Style/RedundantLineContinuation: + Enabled: false Style/RedundantSelfAssignmentBranch: Enabled: false Style/RedundantStringEscape: diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 2f1e4f73..6da8d472 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,6 +1,6 @@ { "recommendations": [ "puppet.puppet-vscode", - "rebornix.Ruby" + "Shopify.ruby-lsp" ] } diff --git a/Gemfile b/Gemfile index ca0e773e..8e9f845e 100644 --- a/Gemfile +++ b/Gemfile @@ -20,30 +20,30 @@ group :development do gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "deep_merge", '~> 1.2.2', require: false gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false - gem "facterdb", '~> 1.18', require: false - gem "metadata-json-lint", '~> 3.0', require: false - gem "puppetlabs_spec_helper", '~> 6.0', require: false - gem "rspec-puppet-facts", '~> 2.0', require: false - gem "codecov", '~> 0.2', require: false + gem "facterdb", '~> 2.1', require: false + gem "metadata-json-lint", '~> 4.0', require: false + gem "rspec-puppet-facts", '~> 4.0', require: false gem "dependency_checker", '~> 1.0.0', require: false gem "parallel_tests", '= 3.12.1', require: false gem "pry", '~> 0.10', require: false - gem "simplecov-console", '~> 0.5', require: false + gem "simplecov-console", '~> 0.9', require: false gem "puppet-debugger", '~> 1.0', require: false - gem "rubocop", '= 1.48.1', require: false + gem "rubocop", '~> 1.50.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false - gem "puppet-strings", '~> 4.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "rexml", '>= 3.0.0', '< 3.2.7', require: false end -group :system_tests do - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] - gem "serverspec", '~> 2.41', require: false -end -group :release_prep do +group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 6.0', require: false + gem "puppetlabs_spec_helper", '~> 7.0', require: false +end +group :system_tests do + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] + gem "serverspec", '~> 2.41', require: false end puppet_version = ENV['PUPPET_GEM_VERSION'] diff --git a/metadata.json b/metadata.json index 8fe1c175..f51a3627 100644 --- a/metadata.json +++ b/metadata.json @@ -82,6 +82,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "heads/main-0-g79a2f93", - "pdk-version": "3.0.0" + "template-ref": "tags/3.2.0.4-0-g5d17ec1", + "pdk-version": "3.2.0" } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 6820cebe..ae7c1f68 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -25,7 +25,8 @@ next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) + require 'deep_merge' + default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end @@ -33,7 +34,7 @@ # read default_facts and merge them over what is provided by facterdb default_facts.each do |fact, value| - add_custom_fact fact, value + add_custom_fact fact, value, merge_facts: true end RSpec.configure do |c| From 2478e842dbd1823275259c7b59b67094b27434a5 Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Thu, 3 Oct 2024 13:54:18 +0530 Subject: [PATCH 240/259] (CAT-2051): Fixed SUSEConnect command so that java installation succeeds on SLES-15 --- manifests/init.pp | 9 ++++----- spec/classes/java_spec.rb | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 78ba209e..31750303 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -110,13 +110,12 @@ default => '--jre' } - # Enable legacy repo to install net-tools-deprecated package - # If SUSE OS major version is >= 15 and minor version is > 3 - if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['major'], '15') >= 0 and versioncmp($facts['os']['release']['minor'], '3') == 1) { + # If the OS is SLES >= 15.3, enable the legacy repo to install net-tools-deprecated package + if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['full'], '15.3') >= 0) { exec { 'Enable legacy repos': path => '/bin:/usr/bin/:/sbin:/usr/sbin', - command => 'SUSEConnect --product sle-module-legacy/15.5/x86_64', - unless => 'SUSEConnect --status-text | grep sle-module-legacy/15.5/x86_64', + command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['full']}/x86_64", + unless => "SUSEConnect --status-text | grep sle-module-legacy/${facts['os']['release']['full']}/x86_64", } } diff --git a/spec/classes/java_spec.rb b/spec/classes/java_spec.rb index 9908af9c..90efa9f5 100644 --- a/spec/classes/java_spec.rb +++ b/spec/classes/java_spec.rb @@ -95,7 +95,7 @@ end context 'when selecting default for OpenSUSE 12.3' do - let(:facts) { { os: { family: 'Suse', name: 'OpenSUSE', release: { major: '12.3' }, architecture: 'x86_64' } } } + let(:facts) { { os: { family: 'Suse', name: 'OpenSUSE', release: { full: '12.3', major: '12', minor: '3' }, architecture: 'x86_64' } } } it { is_expected.to contain_package('java').with_name('java-1_7_0-openjdk-devel') } it { is_expected.to contain_file_line('java-home-environment').with_line('JAVA_HOME=/usr/lib64/jvm/java-1.7.0-openjdk-1.7.0/') } From d80911b89e264a8dbf724bd997335003e7078803 Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Tue, 1 Oct 2024 17:17:39 +0530 Subject: [PATCH 241/259] (CAT-2051): Exclude Debian-12-arm64 platform --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index ebbaa7ff..617decd9 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,4 +16,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" From 9ec03b23997d9931d30037f7a5fd6c43f87e6129 Mon Sep 17 00:00:00 2001 From: Saurabh Pandit Date: Thu, 3 Oct 2024 18:51:29 +0530 Subject: [PATCH 242/259] (CAT-2051): Excluded debian-12-arm from ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 87458beb..c4838ff5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,4 +17,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\"]'" + flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" From b1e88b2b17e90c95ce77ddebc33063f4296eeafa Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Mon, 7 Oct 2024 10:47:14 +0000 Subject: [PATCH 243/259] Release prep v11.0.1 --- CHANGELOG.md | 22 +++++++++++++++++++--- metadata.json | 2 +- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb6b800..90f07579 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,11 +5,20 @@ 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). -## [v11.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.0) - 2024-04-15 +## [v11.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.1) - 2024-10-07 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.0.0...v11.0.1) + +### Fixed + +- (CAT-2051): Fixed SUSEConnect command so that java installation succeeds on SLES-15 [#601](https://github.com/puppetlabs/puppetlabs-java/pull/601) ([span786](https://github.com/span786)) + +## [v11.0.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.0) - 2024-04-16 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v10.1.2...v11.0.0) ### Changed + - [CAT-1427] : Removing RedHat/Scientific/OracleLinux 6 [#576](https://github.com/puppetlabs/puppetlabs-java/pull/576) ([rajat-puppet](https://github.com/rajat-puppet)) ### Added @@ -42,6 +51,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v9.0.1...v10.0.0) ### Changed + - (CONT-784) Add Support for Puppet 8 / Drop Support for Puppet 6 [#548](https://github.com/puppetlabs/puppetlabs-java/pull/548) ([david22swan](https://github.com/david22swan)) ### Added @@ -66,6 +76,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v8.2.0...v9.0.0) ### Changed + - (CONT-263) Update minimum required puppet version [#535](https://github.com/puppetlabs/puppetlabs-java/pull/535) ([LukasAud](https://github.com/LukasAud)) ### Fixed @@ -99,6 +110,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v7.3.0...v8.0.0) ### Changed + - (GH-C&T-7) Remove code specific to unsupported OSs [#507](https://github.com/puppetlabs/puppetlabs-java/pull/507) ([david22swan](https://github.com/david22swan)) ### Added @@ -172,6 +184,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v6.5.0...v7.0.0) ### Changed + - pdksync - Remove Puppet 5 from testing and bump minimal version to 6.0.0 [#463](https://github.com/puppetlabs/puppetlabs-java/pull/463) ([carabasdaniel](https://github.com/carabasdaniel)) ### Fixed @@ -247,6 +260,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v4.1.0...v5.0.0) ### Changed + - [FM-8320] Remove Oracle download [#372](https://github.com/puppetlabs/puppetlabs-java/pull/372) ([carabasdaniel](https://github.com/carabasdaniel)) ### Added @@ -273,6 +287,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/3.3.0...v4.0.0) ### Changed + - pdksync - (MODULES-8444) - Raise lower Puppet bound [#356](https://github.com/puppetlabs/puppetlabs-java/pull/356) ([david22swan](https://github.com/david22swan)) ### Added @@ -328,6 +343,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/2.4.0...3.0.0) ### Changed + - [FM-6963] Removal of unsupported OS from java [#295](https://github.com/puppetlabs/puppetlabs-java/pull/295) ([david22swan](https://github.com/david22swan)) ### Added @@ -415,7 +431,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Fixed - Fix typo in documentation for class oracle [#170](https://github.com/puppetlabs/puppetlabs-java/pull/170) ([gerhardsam](https://github.com/gerhardsam)) -- Fix up rspec deprecation warnings. [#166](https://github.com/puppetlabs/puppetlabs-java/pull/166) ([alexharv074](https://github.com/alexharv074)) +- Fix up rspec deprecation warnings. [#166](https://github.com/puppetlabs/puppetlabs-java/pull/166) ([alex-harvey-z3q](https://github.com/alex-harvey-z3q)) ## [1.5.0](https://github.com/puppetlabs/puppetlabs-java/tree/1.5.0) - 2016-04-12 @@ -431,7 +447,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) a ### Fixed -- Fix typo in README.markdown [#165](https://github.com/puppetlabs/puppetlabs-java/pull/165) ([alexharv074](https://github.com/alexharv074)) +- Fix typo in README.markdown [#165](https://github.com/puppetlabs/puppetlabs-java/pull/165) ([alex-harvey-z3q](https://github.com/alex-harvey-z3q)) ## [1.4.3](https://github.com/puppetlabs/puppetlabs-java/tree/1.4.3) - 2015-12-07 diff --git a/metadata.json b/metadata.json index 8fe1c175..a4ea3424 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "11.0.0", + "version": "11.0.1", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From bc3fd6352bca16c61b16fa059c9840e3f0ab8d75 Mon Sep 17 00:00:00 2001 From: Amit Karsale Date: Mon, 18 Nov 2024 09:52:46 +0530 Subject: [PATCH 244/259] (CAT-2158) Upgrade rexml to address CVE-2024-49761 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 8e9f845e..2d8e1608 100644 --- a/Gemfile +++ b/Gemfile @@ -34,7 +34,7 @@ group :development do gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "rexml", '>= 3.0.0', '< 3.2.7', require: false + gem "rexml", '>= 3.3.9', require: false end group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false From 5db785fd6a4899d5d0fa863b58d50fd1d8cac9c4 Mon Sep 17 00:00:00 2001 From: John Cooper Date: Wed, 2 Oct 2024 17:04:28 +0100 Subject: [PATCH 245/259] Add support for Ubuntu 24.04 This adds the same settings for Debian 12. While Ubuntu has v21 of openjdk available it uses the more conservative v17 --- manifests/params.pp | 2 +- metadata.json | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/manifests/params.pp b/manifests/params.pp index a301347f..708d3e6f 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -58,7 +58,7 @@ default => $facts['os']['architecture'] } case $facts['os']['release']['major'] { - '12': { + '12', '24.04': { $openjdk = 17 } '10', '11', '18.04', '18.10', '19.04', '19.10', '20.04', '22.04': { diff --git a/metadata.json b/metadata.json index 5348561e..7a2b4144 100644 --- a/metadata.json +++ b/metadata.json @@ -52,7 +52,8 @@ "operatingsystemrelease": [ "18.04", "20.04", - "22.04" + "22.04", + "24.04" ] }, { From c1e0299cd68c091aab9e4b7405249ed7f2d4dc41 Mon Sep 17 00:00:00 2001 From: John Cooper Date: Fri, 8 Nov 2024 15:51:35 +0000 Subject: [PATCH 246/259] Don't test on ubuntu 24.04 for arm --- .github/workflows/ci.yml | 3 +-- .github/workflows/nightly.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c98157b..a4cc7b9d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,5 +17,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" - + flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 963e6290..85d2bd8f 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -16,5 +16,4 @@ jobs: secrets: "inherit" with: runs_on: "ubuntu-20.04" - flags: "--exclude-platforms '[\"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" - + flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" From 73535ee0592ac052ee977834f3f0a0cb36baa246 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 17 Dec 2024 05:18:15 +0000 Subject: [PATCH 247/259] Release prep v11.1.0 --- CHANGELOG.md | 12 ++++++++++++ metadata.json | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90f07579..4b956617 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ 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). +## [v11.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.1.0) - 2024-12-17 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.0.1...v11.1.0) + +### Fixed + +- (CAT-2158) Upgrade rexml to address CVE-2024-49761 [#605](https://github.com/puppetlabs/puppetlabs-java/pull/605) ([amitkarsale](https://github.com/amitkarsale)) + +### Other + +- Add support for Ubuntu 24.04 [#600](https://github.com/puppetlabs/puppetlabs-java/pull/600) ([choffee](https://github.com/choffee)) + ## [v11.0.1](https://github.com/puppetlabs/puppetlabs-java/tree/v11.0.1) - 2024-10-07 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.0.0...v11.0.1) diff --git a/metadata.json b/metadata.json index 7a2b4144..cdb368e8 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "11.0.1", + "version": "11.1.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From f258e16451816587f29193175b5310761e5434a5 Mon Sep 17 00:00:00 2001 From: Shubham Shinde Date: Tue, 22 Apr 2025 13:53:14 +0530 Subject: [PATCH 248/259] (CAT-2296) Update github runner image to ubuntu-24.04 ubuntu-20.04 is not supported anymore: https://github.com/actions/runner-images/issues/11101 --- .github/workflows/ci.yml | 2 +- .github/workflows/nightly.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4cc7b9d..969d3b8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,5 +16,5 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" with: - runs_on: "ubuntu-20.04" + runs_on: "ubuntu-24.04" flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 85d2bd8f..63df8c47 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -15,5 +15,5 @@ jobs: uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" with: - runs_on: "ubuntu-20.04" + runs_on: "ubuntu-24.04" flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" From 61013d78b9e88407554a7e071b9f993af9b06bd6 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Fri, 18 Jul 2025 13:18:03 +0200 Subject: [PATCH 249/259] puppet/archive: Allow 8.x Signed-off-by: Evgeni Golov --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index cdb368e8..45aed58a 100644 --- a/metadata.json +++ b/metadata.json @@ -14,7 +14,7 @@ }, { "name": "puppet/archive", - "version_requirement": ">= 1.1.0 < 8.0.0" + "version_requirement": ">= 1.1.0 < 9.0.0" } ], "operatingsystem_support": [ From 67cee367190470397a220d1cd1fb1c694839719c Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 18 Jul 2025 11:23:01 +0000 Subject: [PATCH 250/259] Release prep v11.2.0 --- CHANGELOG.md | 9 +++++++++ metadata.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b956617..c92ee508 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ 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). +## [v11.2.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.2.0) - 2025-07-18 + +[Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.1.0...v11.2.0) + +### Other + +- puppet/archive: Allow 8.x [#611](https://github.com/puppetlabs/puppetlabs-java/pull/611) ([evgeni](https://github.com/evgeni)) +- (CAT-2296) Update github runner image to ubuntu-24.04 [#610](https://github.com/puppetlabs/puppetlabs-java/pull/610) ([shubhamshinde360](https://github.com/shubhamshinde360)) + ## [v11.1.0](https://github.com/puppetlabs/puppetlabs-java/tree/v11.1.0) - 2024-12-17 [Full Changelog](https://github.com/puppetlabs/puppetlabs-java/compare/v11.0.1...v11.1.0) diff --git a/metadata.json b/metadata.json index 45aed58a..40bd8099 100644 --- a/metadata.json +++ b/metadata.json @@ -1,6 +1,6 @@ { "name": "puppetlabs-java", - "version": "11.1.0", + "version": "11.2.0", "author": "puppetlabs", "summary": "Installs the correct Java package on various platforms.", "license": "Apache-2.0", From d8ef8279d2231390bb71d556a58591e0f72bec02 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 11 Sep 2025 14:15:28 +0100 Subject: [PATCH 251/259] (CAT-2376) Puppetcore update A set of changes dedicated to implementing puppetcore into our modules. This update, amongst other changes, removes Puppet 7 support. --- metadata.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 40bd8099..77631c6c 100644 --- a/metadata.json +++ b/metadata.json @@ -79,7 +79,7 @@ "requirements": [ { "name": "puppet", - "version_requirement": ">= 7.0.0 < 9.0.0" + "version_requirement": ">= 8.0.0 < 9.0.0" } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", From ed4fc3cc0991ebb46c6a7236feb170fb0f2fad45 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 11 Sep 2025 14:18:10 +0100 Subject: [PATCH 252/259] PDK update --- .github/workflows/ci.yml | 3 -- .github/workflows/nightly.yml | 3 -- .puppet-lint.rc | 8 ++++ .rubocop.yml | 2 +- Gemfile | 89 ++++++++++++++++++++++------------- Rakefile | 9 ++++ metadata.json | 4 +- 7 files changed, 76 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 969d3b8b..a5738adb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,6 +15,3 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" - with: - runs_on: "ubuntu-24.04" - flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 63df8c47..1b06c471 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,6 +14,3 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" secrets: "inherit" - with: - runs_on: "ubuntu-24.04" - flags: "--exclude-platforms '[\"Ubuntu-24.04-arm\", \"Ubuntu-22.04-arm\", \"RedHat-9-arm\", \"Debian-12-arm\"]'" diff --git a/.puppet-lint.rc b/.puppet-lint.rc index cc96ece0..9e15c6e0 100644 --- a/.puppet-lint.rc +++ b/.puppet-lint.rc @@ -1 +1,9 @@ +--fail-on-warnings --relative +--no-80chars-check +--no-140chars-check +--no-class_inherits_from_params_class-check +--no-autoloader_layout-check +--no-documentation-check +--no-single_quote_string_with_variables-check +--ignore-paths=.vendor/**/*.pp,.bundle/**/*.pp,pkg/**/*.pp,spec/**/*.pp,tests/**/*.pp,types/**/*.pp,vendor/**/*.pp diff --git a/.rubocop.yml b/.rubocop.yml index 439ea84e..47b1aadb 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,7 +5,7 @@ require: AllCops: NewCops: enable DisplayCopNames: true - TargetRubyVersion: '2.6' + TargetRubyVersion: 3.1 Include: - "**/*.rb" Exclude: diff --git a/Gemfile b/Gemfile index 2d8e1608..4e7de031 100644 --- a/Gemfile +++ b/Gemfile @@ -1,65 +1,86 @@ -source ENV['GEM_SOURCE'] || 'https://rubygems.org' +# frozen_string_literal: true -def location_for(place_or_version, fake_version = nil) - git_url_regex = %r{\A(?(https?|git)[:@][^#]*)(#(?.*))?} - file_url_regex = %r{\Afile:\/\/(?.*)} +# For puppetcore, set GEM_SOURCE_PUPPETCORE = 'https://rubygems-puppetcore.puppet.com' +gemsource_default = ENV['GEM_SOURCE'] || 'https://rubygems.org' +gemsource_puppetcore = if ENV['PUPPET_FORGE_TOKEN'] + 'https://rubygems-puppetcore.puppet.com' +else + ENV['GEM_SOURCE_PUPPETCORE'] || gemsource_default +end +source gemsource_default + +def location_for(place_or_constraint, fake_constraint = nil, opts = {}) + git_url_regex = /\A(?(?:https?|git)[:@][^#]*)(?:#(?.*))?/ + file_url_regex = %r{\Afile://(?.*)} + + if place_or_constraint && (git_url = place_or_constraint.match(git_url_regex)) + # Git source → ignore :source, keep fake_constraint + [fake_constraint, { git: git_url[:url], branch: git_url[:branch], require: false }].compact + + elsif place_or_constraint && (file_url = place_or_constraint.match(file_url_regex)) + # File source → ignore :source, keep fake_constraint or default >= 0 + [fake_constraint || '>= 0', { path: File.expand_path(file_url[:path]), require: false }] - if place_or_version && (git_url = place_or_version.match(git_url_regex)) - [fake_version, { git: git_url[:url], branch: git_url[:branch], require: false }].compact - elsif place_or_version && (file_url = place_or_version.match(file_url_regex)) - ['>= 0', { path: File.expand_path(file_url[:path]), require: false }] else - [place_or_version, { require: false }] + # Plain version constraint → merge opts (including :source if provided) + [place_or_constraint, { require: false }.merge(opts)] + end +end + +# Print debug information if DEBUG_GEMS or VERBOSE is set +def print_gem_statement_for(gems) + puts 'DEBUG: Gem definitions that will be generated:' + gems.each do |gem_name, gem_params| + puts "DEBUG: gem #{([gem_name.inspect] + gem_params.map(&:inspect)).join(', ')}" end end group :development do - 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 "json", '= 2.3.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) - gem "json", '= 2.5.1', require: false if Gem::Requirement.create(['>= 3.0.0', '< 3.0.5']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.1', require: false if Gem::Requirement.create(['>= 3.1.0', '< 3.1.3']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "json", '= 2.6.3', require: false if Gem::Requirement.create(['>= 3.2.0', '< 4.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "racc", '~> 1.4.0', require: false if Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "deep_merge", '~> 1.2.2', require: false gem "voxpupuli-puppet-lint-plugins", '~> 5.0', require: false - gem "facterdb", '~> 2.1', require: false + gem "facterdb", '~> 2.1', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "facterdb", '~> 3.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "metadata-json-lint", '~> 4.0', require: false - gem "rspec-puppet-facts", '~> 4.0', require: false + gem "json-schema", '< 5.1.1', require: false + gem "rspec-puppet-facts", '~> 4.0', require: false if Gem::Requirement.create(['< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) + gem "rspec-puppet-facts", '~> 5.0', require: false if Gem::Requirement.create(['>= 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup)) gem "dependency_checker", '~> 1.0.0', require: false gem "parallel_tests", '= 3.12.1', require: false gem "pry", '~> 0.10', require: false gem "simplecov-console", '~> 0.9', require: false - gem "puppet-debugger", '~> 1.0', require: false + gem "puppet-debugger", '~> 1.6', require: false gem "rubocop", '~> 1.50.0', require: false gem "rubocop-performance", '= 1.16.0', require: false gem "rubocop-rspec", '= 2.19.0', require: false gem "rb-readline", '= 0.5.5', require: false, platforms: [:mswin, :mingw, :x64_mingw] - gem "rexml", '>= 3.3.9', require: false + gem "bigdecimal", '< 3.2.2', require: false, platforms: [:mswin, :mingw, :x64_mingw] end group :development, :release_prep do gem "puppet-strings", '~> 4.0', require: false - gem "puppetlabs_spec_helper", '~> 7.0', require: false + gem "puppetlabs_spec_helper", '~> 8.0', require: false + gem "puppet-blacksmith", '~> 7.0', require: false end group :system_tests do - gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] + gem "puppet_litmus", '~> 2.0', require: false, platforms: [:ruby, :x64_mingw] if !ENV['PUPPET_FORGE_TOKEN'].to_s.empty? + gem "puppet_litmus", '~> 1.0', require: false, platforms: [:ruby, :x64_mingw] if ENV['PUPPET_FORGE_TOKEN'].to_s.empty? gem "CFPropertyList", '< 3.0.7', require: false, platforms: [:mswin, :mingw, :x64_mingw] gem "serverspec", '~> 2.41', require: false end -puppet_version = ENV['PUPPET_GEM_VERSION'] -facter_version = ENV['FACTER_GEM_VERSION'] -hiera_version = ENV['HIERA_GEM_VERSION'] - gems = {} +puppet_version = ENV.fetch('PUPPET_GEM_VERSION', nil) +facter_version = ENV.fetch('FACTER_GEM_VERSION', nil) +hiera_version = ENV.fetch('HIERA_GEM_VERSION', nil) -gems['puppet'] = location_for(puppet_version) - -# If facter or hiera versions have been specified via the environment -# variables - -gems['facter'] = location_for(facter_version) if facter_version -gems['hiera'] = location_for(hiera_version) if hiera_version +gems['puppet'] = location_for(puppet_version, nil, { source: gemsource_puppetcore }) +gems['facter'] = location_for(facter_version, nil, { source: gemsource_puppetcore }) +gems['hiera'] = location_for(hiera_version, nil, {}) if hiera_version +# Generate the gem definitions +print_gem_statement_for(gems) if ENV['DEBUG'] gems.each do |gem_name, gem_params| gem gem_name, *gem_params end @@ -67,12 +88,14 @@ end # Evaluate Gemfile.local and ~/.gemfile if they exist extra_gemfiles = [ "#{__FILE__}.local", - File.join(Dir.home, '.gemfile'), + File.join(Dir.home, '.gemfile') ] extra_gemfiles.each do |gemfile| - if File.file?(gemfile) && File.readable?(gemfile) - eval(File.read(gemfile), binding) - end + next unless File.file?(gemfile) && File.readable?(gemfile) + + # rubocop:disable Security/Eval + eval(File.read(gemfile), binding) + # rubocop:enable Security/Eval end # vim: syntax=ruby diff --git a/Rakefile b/Rakefile index 77590fe6..31b59305 100644 --- a/Rakefile +++ b/Rakefile @@ -7,3 +7,12 @@ require 'puppet-syntax/tasks/puppet-syntax' require 'puppet-strings/tasks' if Gem.loaded_specs.key? 'puppet-strings' PuppetLint.configuration.send('disable_relative') +PuppetLint.configuration.send('disable_80chars') +PuppetLint.configuration.send('disable_140chars') +PuppetLint.configuration.send('disable_class_inherits_from_params_class') +PuppetLint.configuration.send('disable_autoloader_layout') +PuppetLint.configuration.send('disable_documentation') +PuppetLint.configuration.send('disable_single_quote_string_with_variables') +PuppetLint.configuration.fail_on_warnings = true +PuppetLint.configuration.ignore_paths = [".vendor/**/*.pp", ".bundle/**/*.pp", "pkg/**/*.pp", "spec/**/*.pp", "tests/**/*.pp", "types/**/*.pp", "vendor/**/*.pp"] + diff --git a/metadata.json b/metadata.json index 77631c6c..075338b3 100644 --- a/metadata.json +++ b/metadata.json @@ -83,6 +83,6 @@ } ], "template-url": "https://github.com/puppetlabs/pdk-templates.git#main", - "template-ref": "tags/3.2.0.4-0-g5d17ec1", - "pdk-version": "3.2.0" + "template-ref": "tags/3.5.1-0-g9d5b193", + "pdk-version": "3.5.0" } From 100a54bb653e2fa3fe223c6959a8bf557fee10ae Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 11 Sep 2025 14:18:48 +0100 Subject: [PATCH 253/259] Rubocop safe autocorrections --- spec/defines/download_spec.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/defines/download_spec.rb b/spec/defines/download_spec.rb index c6b8e7a6..b7b288bd 100644 --- a/spec/defines/download_spec.rb +++ b/spec/defines/download_spec.rb @@ -15,7 +15,7 @@ version_major: '8u201', version_minor: 'b09', java_se: 'jdk', - url: url + url: } end let(:title) { 'jdk8' } @@ -50,7 +50,7 @@ basedir: '/usr/java', manage_symlink: true, symlink_name: 'java_home', - url: url + url: } end let(:title) { 'jdk6' } @@ -65,7 +65,7 @@ version: '6', java_se: 'jdk', basedir: '/usr/java', - url: url + url: } end let(:title) { 'jdk6_nosymlink' } @@ -78,7 +78,7 @@ let(:facts) { { kernel: 'Linux', os: { family: 'Debian', architecture: 'amd64', name: 'Ubuntu', release: { full: '18.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: } } let(:title) { 'jdk8' } it { is_expected.to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.tar.gz') } @@ -89,7 +89,7 @@ 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(:params) { { ensure: 'present', version_major: '8u201', version_minor: 'b09', java_se: 'jdk', url: } } let(:title) { 'jdk8' } it { is_expected.to contain_archive('/tmp/jdk-8-8u201-b09-linux-x64.tar.gz') } From 6b4d182a2f9d84cb0bc4ffc9c930a711e4ebede9 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Thu, 11 Sep 2025 14:19:43 +0100 Subject: [PATCH 254/259] Test against nightlies --- .github/workflows/ci.yml | 2 ++ .github/workflows/nightly.yml | 2 ++ 2 files changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5738adb..2cdfc30f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,4 +14,6 @@ jobs: Acceptance: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" + with: + flags: "--nightly" secrets: "inherit" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 1b06c471..5a39a47c 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -13,4 +13,6 @@ jobs: Acceptance: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" + with: + flags: "--nightly" secrets: "inherit" From 3b851b66280852b8788dc4c7c3a7b67dd0548b1f Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Wed, 21 Jan 2026 10:48:00 +0000 Subject: [PATCH 255/259] (CAT-2511) Address sles box misconfigurations Addressing misconfigurations in the SLES box to ensure proper setup for CI. --- manifests/init.pp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index 31750303..ce5dcb9a 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -110,13 +110,17 @@ default => '--jre' } - # If the OS is SLES >= 15.3, enable the legacy repo to install net-tools-deprecated package - if ($facts['os']['family'] in ['SLES', 'SUSE']) and (versioncmp($facts['os']['release']['full'], '15.3') >= 0) { - exec { 'Enable legacy repos': - path => '/bin:/usr/bin/:/sbin:/usr/sbin', - command => "SUSEConnect --product sle-module-legacy/${facts['os']['release']['full']}/x86_64", - unless => "SUSEConnect --status-text | grep sle-module-legacy/${facts['os']['release']['full']}/x86_64", + # TEMPORARY FIX: If no repos are configured on SLES, add openSUSE Leap as fallback + # This workaround is needed because GCP-provisioned SLES images are unregistered BYOS + # without any package repositories configured. Remove this once proper PAYG images are used. + if ($facts['os']['family'] in ['SLES', 'SUSE']) { + exec { 'Configure zypper repo for SLES': + path => '/bin:/usr/bin:/sbin:/usr/sbin', + command => 'zypper --non-interactive --gpg-auto-import-keys ar http://download.opensuse.org/distribution/leap/15.6/repo/oss/ opensuse-leap-fallback && zypper --non-interactive --gpg-auto-import-keys refresh', + unless => "zypper lr 2>/dev/null | grep -q 'opensuse-leap-fallback\\|http'", + logoutput => true, } + -> Package['java'] } if $facts['os']['family'] == 'Debian' { From bf9d853fabec6c6f00b3798b7cbe0637c87f6081 Mon Sep 17 00:00:00 2001 From: Lukas Audzevicius Date: Tue, 3 Feb 2026 12:02:41 +0000 Subject: [PATCH 256/259] Re-implementing mistakenly removed ARM exclusion --- .github/workflows/ci.yml | 2 +- .github/workflows/nightly.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2cdfc30f..c236bbc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,5 +15,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - flags: "--nightly" + flags: "--nightly --arch-exclude arm" secrets: "inherit" diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 5a39a47c..9f20eccd 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -14,5 +14,5 @@ jobs: needs: Spec uses: "puppetlabs/cat-github-actions/.github/workflows/module_acceptance.yml@main" with: - flags: "--nightly" + flags: "--nightly --arch-exclude arm" secrets: "inherit" From 44e649c1ebf6df36bfa1f53df58f5e42a1dc8d29 Mon Sep 17 00:00:00 2001 From: Jason St-Cyr Date: Wed, 25 Feb 2026 19:37:27 -0500 Subject: [PATCH 257/259] Update link to Puppet modules contributing documentation --- CONTRIBUTING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7a3a7c3..25bf5ebc 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,3 +1,3 @@ # Contributing to Puppet modules -Check out our [Contributing to Supported Modules Blog Post](https://puppetlabs.github.io/iac/docs/contributing_to_a_module.html) to find all the information that you will need. +Check out our [Contributing to Puppet modules docs](https://help.puppet.com/core//current/Content/PuppetCore/contributing.htm) to find all the information that you will need. From d7d5ee43c93bd5cf69f568181ab443e0d2e86e33 Mon Sep 17 00:00:00 2001 From: skyamgarp <130442619+skyamgarp@users.noreply.github.com> Date: Tue, 19 Nov 2024 18:11:40 +0530 Subject: [PATCH 258/259] (CAT-2152) Add support for Centos9 --- metadata.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadata.json b/metadata.json index 075338b3..81a4315e 100644 --- a/metadata.json +++ b/metadata.json @@ -30,7 +30,8 @@ "operatingsystem": "CentOS", "operatingsystemrelease": [ "7", - "8" + "8", + "9" ] }, { From 2ab45cedf3f64993d6fe1ef1a84a03d8fce2143c Mon Sep 17 00:00:00 2001 From: "mend-for-github-com[bot]" <50673670+mend-for-github-com[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 02:03:30 +0000 Subject: [PATCH 259/259] Add .whitesource configuration file --- .whitesource | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .whitesource diff --git a/.whitesource b/.whitesource new file mode 100644 index 00000000..04109aad --- /dev/null +++ b/.whitesource @@ -0,0 +1,45 @@ +{ + "scanSettings": { + "configMode": "AUTO", + "configExternalURL": "", + "projectToken": "", + "baseBranches": [] + }, + "scanSettingsSAST": { + "enableScan": true, + "scanPullRequests": true, + "incrementalScan": true, + "baseBranches": [], + "snippetSize": 10 + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff", + "useMendCheckNames": true + }, + "checkRunSettingsSAST": { + "checkRunConclusionLevel": "failure", + "severityThreshold": "high" + }, + "issueSettings": { + "minSeverityLevel": "LOW", + "issueType": "DEPENDENCY" + }, + "issueSettingsSAST": { + "minSeverityLevel": "high", + "issueType": "repo" + }, + "remediateSettings": { + "workflowRules": { + "enabled": true + } + }, + "imageSettings":{ + "imageTracing":{ + "enableImageTracingPR": false, + "addRepositoryCoordinate": false, + "addDockerfilePath": false, + "addMendIdentifier": false + } + } +} \ No newline at end of file