Skip to content

Commit

Permalink
Add CentOS Stream 9 support
Browse files Browse the repository at this point in the history
* SSG doesn't have a profile for EL9
* No SIMP repos for EL9 so those tests won't work
* Manually verified
* Bump to ruby 2.6 for net-ssh updates
  • Loading branch information
trevor-vaughan committed Jun 17, 2022
1 parent 42f6aa4 commit 65ae62b
Show file tree
Hide file tree
Showing 8 changed files with 101 additions and 31 deletions.
10 changes: 3 additions & 7 deletions .github/workflows/pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# The testing matrix considers ruby/puppet versions supported by SIMP and PE:
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# SIMP 6.4 5.5 2.40 TBD
# PE 2018.1 5.5 2.40 2021-01 (LTS overlap)
# PE 2019.8 6.18 2.5 2022-12 (LTS)
#
# https://puppet.com/docs/pe/2018.1/component_versions_in_recent_pe_releases.html
Expand Down Expand Up @@ -46,7 +44,7 @@ jobs:
- name: "Install Ruby ${{matrix.puppet.ruby_version}}"
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
ruby-version: 2.6
bundler-cache: true
- run: |
bundle show
Expand All @@ -60,10 +58,8 @@ jobs:
puppet:
- label: 'Puppet 6.18 [SIMP 6.5/PE 2019.8]'
puppet_version: '~> 6.18.0'
ruby_version: '2.5'
- label: 'Puppet 5.5 [SIMP 6.4/PE 2018.1]'
puppet_version: '~> 5.5.22'
ruby_version: '2.4'
# Needed for net-ssh updates and EL9
ruby_version: '2.6'
- label: 'Puppet 7.x'
puppet_version: '~> 7.0'
ruby_version: '2.7'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tag_deploy_rubygem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
echo "::set-output name=release_command::${GEM_RELEASE_COMMAND}"
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
ruby-version: 2.6
bundler-cache: true
- name: Test build the package
run: "${{ steps.commands.outputs.build_command }}"
Expand Down Expand Up @@ -183,7 +183,7 @@ jobs:
clean: true
- uses: ruby/setup-ruby@v1
with:
ruby-version: 2.5
ruby-version: 2.6
bundler-cache: true
- name: Build RubyGem
run: |
Expand Down
16 changes: 10 additions & 6 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
# https://puppet.com/docs/pe/2018.1/overview/getting_support_for_pe.html
# ------------------------------------------------------------------------------
# Release Puppet Ruby EOL
# SIMP 6.4 5.5 2.4.10 TBD
# PE 2018.1 5.5 2.4.10 2021-01 (LTS overlap)
# PE 2019.8 6.18 2.5.7 2022-12 (LTS)
---

Expand Down Expand Up @@ -210,18 +208,18 @@ variables:
#-----------------------------------------------------------------------

.pup_6_x: &pup_6_x
image: 'ruby:2.5'
image: 'ruby:2.6'
variables:
PUPPET_VERSION: '~> 6.0'
BEAKER_PUPPET_COLLECTION: 'puppet6'
MATRIX_RUBY_VERSION: '2.5'
MATRIX_RUBY_VERSION: '2.6'

.pup_6_pe: &pup_6_pe
image: 'ruby:2.5'
image: 'ruby:2.6'
variables:
PUPPET_VERSION: '6.18.0'
BEAKER_PUPPET_COLLECTION: 'puppet6'
MATRIX_RUBY_VERSION: '2.5'
MATRIX_RUBY_VERSION: '2.6'

.pup_7_x: &pup_7_x
image: 'ruby:2.7'
Expand Down Expand Up @@ -319,6 +317,12 @@ default-amzn2:
script:
- bundle exec rake beaker:suites[default,amzn2]

default-el9:
<<: *pup_6_x
<<: *acceptance_base
script:
- bundle exec rake beaker:suites[default,el9]

default-fips:
<<: *pup_6_x
<<: *acceptance_base
Expand Down
8 changes: 5 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gem 'bundler'
gem 'rake'

group :system_tests do
beaker_gem_options = ENV.fetch('BEAKER_GEM_OPTIONS', ['>= 4.28.1', '< 5.0.0'])
beaker_gem_options = ENV.fetch('BEAKER_GEM_OPTIONS', ['>= 4.33.0', '< 5.0.0'])

if "#{beaker_gem_options}".include?(':')
# Just pass in BEAKER_GEM_OPTIONS as a string that would represent the usual
Expand Down Expand Up @@ -43,9 +43,11 @@ group :system_tests do

gem 'beaker-rspec'
gem 'beaker-windows'
gem 'net-ssh'
# Need at least 85ebe31 for EL9 support
gem 'net-ssh', :git => "https://github.com/net-ssh/net-ssh", :ref => 'v7.0.0.beta1'
gem 'bcrypt_pbkdf' unless RUBY_PLATFORM == 'java'
gem 'puppet', ENV.fetch('PUPPET_VERSION', '~> 7.0')
gem 'puppetlabs_spec_helper', '~> 3.0'
gem 'rubocop'
gem 'rubocop-rspec'
gem 'puppetlabs_spec_helper', '~> 4.0'
end
42 changes: 30 additions & 12 deletions lib/simp/beaker_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -637,36 +637,50 @@ def enable_epel_on(suts)
# This is based on the official EPEL docs https://fedoraproject.org/wiki/EPEL
case os_info['name']
when 'RedHat','CentOS'
install_latest_package_on(
sut,
'epel-release',
"https://dl.fedoraproject.org/pub/epel/epel-release-latest-#{os_maj_rel}.noarch.rpm",
)

if os_info['name'] == 'RedHat'
if os_maj_rel == '7'
on sut, %{subscription-manager repos --enable "rhel-*-optional-rpms"}
on sut, %{subscription-manager repos --enable "rhel-*-extras-rpms"}
on sut, %{subscription-manager repos --enable "rhel-ha-for-rhel-*-server-rpms"}
end

if os_maj_rel == '8'
on sut, %{subscription-manager repos --enable "codeready-builder-for-rhel-8-#{os_info['architecture']}-rpms"}
if os_maj_rel > '7'
on sut, %{subscription-manager repos --enable "codeready-builder-for-rhel-#{os_maj_rel}-#{os_info['architecture']}-rpms"}
end
end

if os_info['name'] == 'CentOS'
if os_maj_rel == '8'
# 8.0 fallback
if os_maj_rel > '7'
install_latest_package_on(sut, 'dnf-plugins-core')
end
if os_maj_rel == '8'
on sut, %{dnf config-manager --set-enabled powertools || dnf config-manager --set-enabled PowerTools}
end
if os_maj_rel == '9'
on sut, %{dnf config-manager --set-enabled crb}
end
end

if os_maj_rel < '8'
install_latest_package_on(
sut,
'epel-release',
"https://dl.fedoraproject.org/pub/epel/epel-release-latest-#{os_maj_rel}.noarch.rpm",
)
else
# Workaround because of :shrug:
on(sut, "cd /etc/pki/rpm-gpg; curl -L -O https://www.centos.org/keys/RPM-GPG-KEY-CentOS-SIG-Extras")

install_latest_package_on(sut, 'epel-release')

if os_info['id'] == 'CentOSStream'
install_latest_package_on(sut, 'epel-next-release')
end
end
when 'OracleLinux'
package_name = "oracle-epel-release-el#{os_maj_rel}"
install_latest_package_on(sut,package_name)
end

end
end
end
Expand Down Expand Up @@ -815,6 +829,10 @@ def rhel_rhsm_subscribe(suts, *opts)
'8' => [
'rhel-8-for-x86_64-baseos-rpms',
'rhel-8-for-x86_64-supplementary-rpms'
],
'9' => [
'rhel-9-for-x86_64-baseos-rpms',
'rhel-9-for-x86_64-supplementary-rpms'
]
}
}
Expand Down Expand Up @@ -1541,7 +1559,7 @@ def install_simp_repos(suts, disable = [])
# from YUM. This does not actually "enable" the repos, that would require
# the "--enable" option (from yum-config-manager) :-D.
#
# Note: Certain versions of EL8 do not dump by default and EL7 does not
# Note: Certain versions of EL8+ do not dump by default and EL7 does not
# have the '--dump' option.
available_repos = on(sut, %{yum-config-manager --enablerepo="*" || yum-config-manager --enablerepo="*" --dump}).stdout.lines.grep(/\A\[(.+)\]\Z/){|x| $1}

Expand Down
18 changes: 18 additions & 0 deletions lib/simp/beaker_helpers/ssg.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class SSG
'libarchive'
]

EL9_PACKAGES = EL8_PACKAGES

OS_INFO = {
'RedHat' => {
'6' => {
Expand All @@ -71,6 +73,14 @@ class SSG
'build_target' => 'rhel8',
'datastream' => 'ssg-rhel8-ds.xml'
}
},
'9' => {
'required_packages' => EL9_PACKAGES,
'ssg' => {
'profile_target' => 'rhel9',
'build_target' => 'rhel9',
'datastream' => 'ssg-rhel9-ds.xml'
}
}
},
'CentOS' => {
Expand All @@ -97,6 +107,14 @@ class SSG
'build_target' => 'centos8',
'datastream' => 'ssg-centos8-ds.xml'
}
},
'9' => {
'required_packages' => EL9_PACKAGES,
'ssg' => {
'profile_target' => 'centos9',
'build_target' => 'centos9',
'datastream' => 'ssg-centos9-ds.xml'
}
}
},
'Rocky' => {
Expand Down
2 changes: 1 addition & 1 deletion simp-beaker-helpers.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |s|

s.required_ruby_version = '>= 2.3.0'

s.add_runtime_dependency 'beaker' , ['>= 4.17.0', '< 5.0.0']
s.add_runtime_dependency 'beaker' , ['>= 4.33.0', '< 5.0.0']
s.add_runtime_dependency 'beaker-rspec' , '~> 7.1'
s.add_runtime_dependency 'beaker-puppet' , ['>= 1.18.14', '< 2.0.0']
s.add_runtime_dependency 'beaker-docker' , ['>= 0.8.3', '< 2.0.0']
Expand Down
32 changes: 32 additions & 0 deletions spec/acceptance/nodesets/el9.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<%
hypervisor = ENV.fetch('BEAKER_HYPERVISOR', 'vagrant')
-%>
HOSTS:
el9:
roles:
- el9
- master
- default
platform: el-9-x86_64
box: centos/9
box_url: https://cloud.centos.org/centos/9-stream/x86_64/images/CentOS-Stream-Vagrant-9-20220509.0.x86_64.vagrant-virtualbox.box
hypervisor: <%= hypervisor %>

CONFIG:
log_level: verbose
type: aio
vagrant_cpus: 2
<% if ENV['BEAKER_PUPPET_COLLECTION'] -%>
puppet_collection: <%= ENV['BEAKER_PUPPET_COLLECTION'] %>
<% end -%>
ssh:
keepalive: true
keepalive_interval: 10
host_key:
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:host_key].join("\n#{' '*6}- ") %>
kex:
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:kex].join("\n#{' '*6}- ") %>
encryption:
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:encryption].join("\n#{' '*6}- ") %>
hmac:
- <%= Net::SSH::Transport::Algorithms::ALGORITHMS[:hmac].join("\n#{' '*6}- ") %>

0 comments on commit 65ae62b

Please sign in to comment.