Skip to content

Commit 9cc66c9

Browse files
CentOS 8: proper selinux package naming
there is a difference between rhel 8 and before Signed-off-by: Artem Sidorenko <[email protected]>
1 parent 5e56a20 commit 9cc66c9

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ script:
3232
- bundle exec rake kitchen KITCHEN_LOCAL_YAML=.kitchen.dokken.yml
3333

3434
matrix:
35-
allow_failures:
36-
# temporaray disable failing tests until all problems are fixed
37-
- env: INSTANCE=centos-8
3835
include:
3936
- env: UNIT_AND_LINT=1
4037
script:

attributes/default.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@
3131
default['ssh-hardening']['sshclient']['package'] = 'openssh-client'
3232
end
3333

34+
# Define the package name for selinux utils
35+
if node['platform_family'] == 'fedora' || # rubocop:disable Style/ConditionalAssignment
36+
node['platform_family'] == 'rhel' && node['platform_version'].to_f >= 8
37+
default['ssh-hardening']['selinux']['package'] = 'policycoreutils-python-utils'
38+
else
39+
default['ssh-hardening']['selinux']['package'] = 'policycoreutils-python'
40+
end
41+
3442
# Define the server package name
3543
case node['platform']
3644
when 'suse', 'opensuse', 'opensuseleap'

recipes/server.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,7 @@
5656
module_file = ::File.join(cache_dir, 'ssh_password.mod')
5757
package_file = ::File.join(cache_dir, 'ssh_password.pp')
5858

59-
package 'policycoreutils-python'
60-
# on fedora we need an addtional package for semodule_package
61-
package 'policycoreutils-python-utils' if node['platform_family'] == 'fedora'
59+
package node['ssh-hardening']['selinux']['package']
6260

6361
if node['ssh-hardening']['ssh']['server']['use_pam']
6462
# UsePAM yes: disable and remove the additional SELinux policy

0 commit comments

Comments
 (0)