From 700cd4d3bbf2a37fb86ccaf6cb4a125d3fb7b678 Mon Sep 17 00:00:00 2001 From: Casey Williams Date: Thu, 11 Oct 2018 12:03:25 -0700 Subject: [PATCH 1/7] (MODULES-7791) Remove deprecated source_permissions `source_permissions` is deprecated in puppet6; remove it and use the defaults to quiet warnings (The default permissions behavior in puppet 4, 5, and 6 is to use the puppet agent user and that user's default umask or DACL). --- manifests/prepare.pp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/manifests/prepare.pp b/manifests/prepare.pp index d5e4ac423..183fdd51c 100644 --- a/manifests/prepare.pp +++ b/manifests/prepare.pp @@ -17,17 +17,6 @@ ){ include puppet_agent::params $_windows_client = downcase($::osfamily) == 'windows' - if $_windows_client { - - File{ - source_permissions => ignore, - } - } - else { - File { - source_permissions => use, - } - } # Manage /opt/puppetlabs for platforms. This is done before both config and prepare because, # on Windows, both can be in C:/ProgramData/Puppet Labs; doing it later creates a dependency From f0aa10172408d546a3764c0305455f32a23b078d Mon Sep 17 00:00:00 2001 From: Enis Inan Date: Sun, 14 Oct 2018 18:39:42 -0700 Subject: [PATCH 2/7] (maint) Remove incorrect references to PUP-5802/PUP-5025 These tickets do not affect the apt provider. --- manifests/install.pp | 1 - spec/classes/puppet_agent_spec.rb | 1 - 2 files changed, 2 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index aae814e1a..a10a214b8 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -201,7 +201,6 @@ install_options => $install_options, } } elsif ($::osfamily == 'Debian') and ($package_version != 'present') { - # Workaround PUP-5802/PUP-5025 package { $::puppet_agent::package_name: ensure => "${package_version}-1${::lsbdistcodename}", install_options => $install_options, diff --git a/spec/classes/puppet_agent_spec.rb b/spec/classes/puppet_agent_spec.rb index 9b91a7290..997d071ef 100644 --- a/spec/classes/puppet_agent_spec.rb +++ b/spec/classes/puppet_agent_spec.rb @@ -170,7 +170,6 @@ def global_facts(facts, os) it { is_expected.to contain_package('puppet-agent').with_ensure(yum_package_version) } end elsif facts[:osfamily] == 'Debian' - # Workaround PUP-5802/PUP-5025 deb_package_version = package_version + '-1' + facts[:lsbdistcodename] it { is_expected.to contain_package('puppet-agent').with_ensure(deb_package_version) } elsif facts[:osfamily] == 'Solaris' && (facts[:operatingsystemmajrelease] == '10' || Puppet.version < '4.0.0') From a11902ace98d03cca34a1dfe6915994e35521449 Mon Sep 17 00:00:00 2001 From: Enis Inan Date: Mon, 15 Oct 2018 02:32:55 -0700 Subject: [PATCH 3/7] (MODULES-7760) Remove dist_tag in install.pp for RHEL platforms The dist_tag variable was introduced as a workaround for PUP-5802/PUP-5025. These tickets were resolved two years ago, so the workaround is no longer necessary. --- manifests/install.pp | 39 --------- .../puppet_agent_osfamily_redhat_spec.rb | 83 +------------------ spec/classes/puppet_agent_spec.rb | 11 +-- 3 files changed, 2 insertions(+), 131 deletions(-) diff --git a/manifests/install.pp b/manifests/install.pp index a10a214b8..3879398ab 100644 --- a/manifests/install.pp +++ b/manifests/install.pp @@ -161,45 +161,6 @@ } } } - } elsif ($::osfamily == 'RedHat') and ($package_version != 'present') { - # Workaround PUP-5802/PUP-5025 - if ($::operatingsystem == 'Fedora') { - if $pa_collection == 'PC1' or $pa_collection == 'puppet5' { - # There's three cases here due to some mistakes with how we - # set-up our distro tags for Fedora platforms: - # * For newer Fedora platforms (e.g. Fedora 28), we want - # to use the fc tag - # - # * For older Fedora platforms (e.g. Fedora 26 and 27), we - # have two separate cases: - # * If the package version's > 5.5.3, then we use the fedora - # tag, b/c in those versions we removed the 'f' prefix. - # - # * If the package version's <= 5.5.3, then we use the fedoraf - # tag b/c the 'f' prefix is still there. - # - if (versioncmp("${::operatingsystemmajrelease}", '27') > 0) { - $dist_tag = "fc${::operatingsystemmajrelease}" - } elsif (versioncmp("${package_version}", '5.5.3') > 0) { - $dist_tag = "fedora${::operatingsystemmajrelease}" - } else { - $dist_tag = "fedoraf${::operatingsystemmajrelease}" - } - } else { - $dist_tag = "fc${::operatingsystemmajrelease}" - } - } elsif ($::platform_tag != undef and $::platform_tag =~ /redhatfips.*/) { - # The undef check here is for unit tests that don't supply this fact. - $dist_tag = 'redhatfips7' - } elsif $::operatingsystem == 'Amazon' { - $dist_tag = 'el6' - } else { - $dist_tag = "el${::operatingsystemmajrelease}" - } - package { $::puppet_agent::package_name: - ensure => "${package_version}-1.${dist_tag}", - install_options => $install_options, - } } elsif ($::osfamily == 'Debian') and ($package_version != 'present') { package { $::puppet_agent::package_name: ensure => "${package_version}-1${::lsbdistcodename}", diff --git a/spec/classes/puppet_agent_osfamily_redhat_spec.rb b/spec/classes/puppet_agent_osfamily_redhat_spec.rb index e8733daca..e21c3a70d 100644 --- a/spec/classes/puppet_agent_osfamily_redhat_spec.rb +++ b/spec/classes/puppet_agent_osfamily_redhat_spec.rb @@ -120,87 +120,6 @@ end end - # There are a lot of special cases here, so it is best to have a separate - # unit test context for them. - context 'distro tag on Fedora platforms' do - def sets_distro_tag_to(expected_distro_tag) - is_expected.to contain_package('puppet-agent').with_ensure( - "#{params[:package_version]}-1.#{expected_distro_tag}" - ) - end - - let(:facts) do - super().merge(:operatingsystem => 'Fedora') - end - - context 'when the collection is PC1' do - let(:params) do - # Older agents use the PC1 collection, so set the package_version - # to 1.10.9 to simulate this. - super().merge(:collection => 'PC1', :package_version => '1.10.9') - end - - let(:facts) do - # Older agents do not support anything past Fedora 27 - super().merge(:operatingsystemmajrelease => 27) - end - - it { sets_distro_tag_to('fedoraf27') } - end - - context 'when the collection is puppet5' do - let(:params) do - super().merge(:collection => 'puppet5') - end - - context 'on newer Fedora versions' do - let(:facts) do - super().merge(:operatingsystemmajrelease => 28) - end - - it { sets_distro_tag_to('fc28') } - end - - context 'on older Fedora versions' do - let(:facts) do - super().merge(:operatingsystemmajrelease => 27) - end - - shared_examples 'a package version' do |package_version, distro_tag| - let(:params) do - super().merge(:package_version => package_version) - end - - it { sets_distro_tag_to(distro_tag) } - end - - context 'when package_version > 5.5.3' do - include_examples 'a package version', '5.5.4', 'fedora27' - end - - context 'when package_version == 5.5.3' do - include_examples 'a package version', '5.5.3', 'fedoraf27' - end - - context 'when package_version < 5.5.3' do - include_examples 'a package version', '5.5.1', 'fedoraf27' - end - end - end - - context 'when the collection is newer than PC1 and puppet5' do - let(:params) do - super().merge(:collection => 'puppet6', :package_version => '6.0.0') - end - - let(:facts) do - super().merge(:operatingsystemmajrelease => 27) - end - - it { sets_distro_tag_to('fc27') } - end - end - [['RedHat', 'el-7-x86_64', 'el-7-x86_64', 7], ['Amazon', '', 'el-6-x64', 6]].each do |os, tag, repodir, osmajor| context "when PE on #{os}" do before(:each) do @@ -290,7 +209,7 @@ def sets_distro_tag_to(expected_distro_tag) :package_version => package_version } } - it { is_expected.to contain_package('puppet-agent').with_ensure("#{params[:package_version]}-1.el#{osmajor}") } + it { is_expected.to contain_package('puppet-agent').with_ensure("#{params[:package_version]}") } end diff --git a/spec/classes/puppet_agent_spec.rb b/spec/classes/puppet_agent_spec.rb index 997d071ef..7d8aed5c9 100644 --- a/spec/classes/puppet_agent_spec.rb +++ b/spec/classes/puppet_agent_spec.rb @@ -160,16 +160,7 @@ def global_facts(facts, os) it { is_expected.to contain_class('puppet_agent::prepare') } it { is_expected.to contain_class('puppet_agent::install').that_requires('Class[puppet_agent::prepare]') } - if facts[:osfamily] == 'RedHat' - if facts[:operatingsystem] == 'Fedora' - # Workaround PUP-5802/PUP-5025 - yum_package_version = package_version + '-1.fedoraf' + facts[:operatingsystemmajrelease] - it { is_expected.to contain_package('puppet-agent').with_ensure(yum_package_version) } - else - yum_package_version = package_version + '-1.el' + facts[:operatingsystemmajrelease] - it { is_expected.to contain_package('puppet-agent').with_ensure(yum_package_version) } - end - elsif facts[:osfamily] == 'Debian' + if facts[:osfamily] == 'Debian' deb_package_version = package_version + '-1' + facts[:lsbdistcodename] it { is_expected.to contain_package('puppet-agent').with_ensure(deb_package_version) } elsif facts[:osfamily] == 'Solaris' && (facts[:operatingsystemmajrelease] == '10' || Puppet.version < '4.0.0') From 7d10dd2542edb8b186309745a9d169f22dbab1cd Mon Sep 17 00:00:00 2001 From: Geoff Nichols Date: Wed, 31 Oct 2018 16:43:29 -0700 Subject: [PATCH 4/7] (maint) Use legacy dependencies repo for activemq Since activemq packages are currently only available in our legacy dependencies repo, install the legacy puppetlabs-release package. --- spec/spec_helper_acceptance.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper_acceptance.rb b/spec/spec_helper_acceptance.rb index 9cf43fce7..981b938eb 100644 --- a/spec/spec_helper_acceptance.rb +++ b/spec/spec_helper_acceptance.rb @@ -49,7 +49,7 @@ def install_modules_on(host) install_modules_on master # Install activemq on master - install_puppetlabs_release_repo master + install_puppetlabs_release_repo(master, '') install_package master, 'activemq' ['truststore', 'keystore'].each do |ext| From 64e2299011d1393904cee291031571a7e5a75746 Mon Sep 17 00:00:00 2001 From: Casey Williams Date: Thu, 1 Nov 2018 16:38:54 -0700 Subject: [PATCH 5/7] (MODULES-8198) Use beaker ~> 3 Acceptance tests are not yet compatible with beaker 4; specify beaker ~> 3 in the Gemfile instead of >= 3. --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index d5ede79f8..3e14c6fc0 100644 --- a/Gemfile +++ b/Gemfile @@ -55,7 +55,7 @@ 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"] - gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '>= 3') + gem "beaker", *location_for(ENV['BEAKER_VERSION'] || '~> 3') gem "beaker-pe", :require => false gem "beaker-rspec", *location_for(ENV['BEAKER_RSPEC_VERSION']) gem "beaker-hostgenerator", *location_for(ENV['BEAKER_HOSTGENERATOR_VERSION']) From bb860a7eba01f5d8b0df530383beff1b8f529de6 Mon Sep 17 00:00:00 2001 From: Casey Williams Date: Tue, 4 Dec 2018 17:15:28 -0800 Subject: [PATCH 6/7] (maint) Update rspec-puppet to 2.7.2 --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 3e14c6fc0..0a12750d4 100644 --- a/Gemfile +++ b/Gemfile @@ -49,7 +49,7 @@ group :development do gem "json_pure", '<= 2.0.1', :require => false if Gem::Version.new(RUBY_VERSION.dup) < Gem::Version.new('2.0.0') 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 "rspec-puppet", "2.6.9", :require => false + gem "rspec-puppet", "2.7.2", :require => false end group :system_tests do From d1859e486c17460568ae5809180180740f96e00f Mon Sep 17 00:00:00 2001 From: Casey Williams Date: Tue, 4 Dec 2018 17:16:57 -0800 Subject: [PATCH 7/7] (maint) Add yumrepo_core fixture for spec tests yumrepo was removed from puppet 6 and is now bundled with AIO puppet-agents as the yumrepo_core module. The puppet 6 gem, however, cannot manage yumrepo resources out of the box; Adding yumrepo_core as a fixture allows spec tests to pass with the puppet gem at version 6+. --- .fixtures.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.fixtures.yml b/.fixtures.yml index 1b21f3bfb..694104e61 100644 --- a/.fixtures.yml +++ b/.fixtures.yml @@ -11,5 +11,7 @@ fixtures: apt: repo: "puppetlabs/apt" ref: "2.3.0" + yumrepo_core: + repo: "puppetlabs/yumrepo_core" symlinks: puppet_agent: "#{source_dir}"