Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(#82) Added RHEL 9 Support #83

Merged
merged 1 commit into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Mon Jan 23 2023 Michael Riddle <[email protected]> - 2.8.1
- Added RHEL 9 support

* Fri Jun 03 2022 Chris Tessmer <[email protected]> - 2.8.0
- Update from camptocamp/systemd to puppet/systemd

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ group :system_tests do
gem 'beaker-rspec'
gem 'simp-beaker-helpers', ENV['SIMP_BEAKER_HELPERS_VERSION'] || ['>= 1.28.0', '< 2']
gem 'bcrypt_pbkdf'
gem 'net-ssh', '< 7.0' if Gem::Requirement.create('< 2.6').satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))
end

# Evaluate extra gemfiles if they exist
Expand Down
7 changes: 7 additions & 0 deletions data/os/RedHat-9.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
# mcstrans package not a default package in redhat 9
selinux::mcstrans_service_name: mcstransd

selinux::manage_restorecond_package: false
selinux::manage_restorecond_service: false
selinux::restorecond_package_name: policycoreutils-restorecond
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "simp-selinux",
"version": "2.8.0",
"version": "2.8.1",
"author": "SIMP Team",
"summary": "manages the SELinux system state",
"license": "Apache-2.0",
Expand Down
13 changes: 13 additions & 0 deletions spec/acceptance/nodesets/rhel.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
---
HOSTS:
rhel9:
roles:
- server
- default
- master
platform: el-9-x86_64
box: generic/rhel9
hypervisor: <%= hypervisor %>
yum_repos:
epel:
mirrorlist: 'https://mirrors.fedoraproject.org/metalink?repo=epel-9&arch=$basearch'
gpgkeys:
- https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-9
rhel8:
roles:
- server
Expand Down
26 changes: 17 additions & 9 deletions spec/acceptance/suites/default/05_kernel_enforce_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,23 @@

host.reboot

result = on(host, 'cat /proc/cmdline').output.strip
result = Hash[result.split(/\s+/).grep(/=/).map{|x|
# Some RHS entries can contain '='
y = x.split('=')
[y[0], y[1..-1].join('=')]
}]

expect(result['selinux']).to eq('1')
expect(result['enforcing']).to eq('1')
os_fact = fact_on(host, 'os')
# EL 9 machines don't appear to show selinux info on /proc/cmdline
# For those machines, check getenforce instead
if (os_fact['release']['major'].to_i > 8)
result = on(host, 'getenforce')
expect(result.stdout.strip).to eq('Enforcing')
else
result = on(host, 'cat /proc/cmdline').output.strip
result = Hash[result.split(/\s+/).grep(/=/).map{|x|
# Some RHS entries can contain '='
y = x.split('=')
[y[0], y[1..-1].join('=')]
}]

expect(result['selinux']).to eq('1')
expect(result['enforcing']).to eq('1')
end
end

it 'should be idempotent' do
Expand Down