Skip to content

Commit

Permalink
Merge pull request #46 from belminf/master
Browse files Browse the repository at this point in the history
Fixes workaround, fixes #27
  • Loading branch information
jfryman committed Aug 5, 2015
2 parents efc97b6 + cd14d02 commit 3e57a12
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/facter/selinux_custom_policy.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# selinux_custom_policy.rb
# As a workaround for Facter bug with EL7:
# https://tickets.puppetlabs.com/browse/FACT-756
#

Facter.add(:selinux_custom_policy) do
confine :kernel => 'Linux', :osfamily => 'RedHat', :operatingsystemmajrelease => '7', :selinux => true

selinux_custom_policy = Facter::Core::Execution.exec('sestatus | grep "Loaded policy name" | awk \'{print $4}\'')
require 'facter'

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

0 comments on commit 3e57a12

Please sign in to comment.