Skip to content
This repository was archived by the owner on Feb 11, 2022. It is now read-only.

Commit 3e57a12

Browse files
committed
Merge pull request voxpupuli#46 from belminf/master
Fixes workaround, fixes spiette#27
2 parents efc97b6 + cd14d02 commit 3e57a12

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed
Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# selinux_custom_policy.rb
1+
# As a workaround for Facter bug with EL7:
2+
# https://tickets.puppetlabs.com/browse/FACT-756
3+
#
24

3-
Facter.add(:selinux_custom_policy) do
4-
confine :kernel => 'Linux', :osfamily => 'RedHat', :operatingsystemmajrelease => '7', :selinux => true
5-
6-
selinux_custom_policy = Facter::Core::Execution.exec('sestatus | grep "Loaded policy name" | awk \'{print $4}\'')
5+
require 'facter'
76

7+
Facter.add(:selinux_custom_policy) do
8+
confine :kernel => 'Linux', :osfamily => 'RedHat', :operatingsystemmajrelease => '7', :selinux => ['true', true]
89
setcode do
9-
selinux_custom_policy
10+
Facter::Util::Resolution.exec("sestatus | grep 'Loaded policy name' | awk '{ print \$4 }'")
1011
end
1112
end

0 commit comments

Comments
 (0)