diff --git a/acceptance/lib/puppet/acceptance/rpm_util.rb b/acceptance/lib/puppet/acceptance/rpm_util.rb index eae1f49186c..d34e63555b8 100644 --- a/acceptance/lib/puppet/acceptance/rpm_util.rb +++ b/acceptance/lib/puppet/acceptance/rpm_util.rb @@ -7,19 +7,18 @@ module RpmUtils def rpm_provider(agent) has_dnf = on(agent, 'which dnf', :acceptable_exit_codes => [0,1]).exit_code - if has_dnf == 0 - 'dnf' - else - 'yum' - end + has_dnf == 0 ? 'dnf' : 'yum' end def setup(agent) @@setup_packages[agent] ||= {} cmd = rpm_provider(agent) - required_packages = ['createrepo', 'curl', 'rpm-build'] + required_packages = %w[createrepo curl rpm-build] required_packages.each do |pkg| pkg_installed = (on agent, "#{cmd} list installed #{pkg}", :acceptable_exit_codes => (0..255)).exit_code == 0 + # We need a newer OpenSSH for the newer OpenSSL that curl installs + # RE-16677 + on(agent, 'dnf upgrade -y openssh') if (agent.platform.start_with?('el-9') && pkg == 'curl') # package not present, so perform a new install if !pkg_installed on agent, "#{cmd} install -y #{pkg}"