Comments (7)
I've determined that this is probably an issue with Facter on RHEL7/CentOS7. The module class is using the fact ::selinux_config_policy
in the path to check if the module exists or not, but in RHEL7/CentOS 7, that fact returns unknown
:
[root@host ~]# facter selinux_config_policy
unknown
I see there's already a bug report in the Facter issues here: https://tickets.puppetlabs.com/browse/FACT-756
..so I'm assuming this may be an issue with Facter, not your module, but perhaps some workaround could be implemented? Maybe a way to override that variable as a parameter?
from puppet-selinux.
i fixed this on my own system by editing module.pp
and changing the class definition to:
define selinux::module(
$source,
$ensure = 'present',
$use_makefile = false,
$makefile = '/usr/share/selinux/devel/Makefile',
$policy = $::selinux_config_policy
) {
and changed the checkloaded
exec to:
exec { "${name}-checkloaded":
refreshonly => false,
creates => "/etc/selinux/${policy}/modules/active/modules/${name}.pp",
command => 'true',
notify => Exec["${name}-buildmod"],
}
and then changed my selinux rules to specify the policy:
selinux::module { 'varnish_ownership':
source => 'puppet:///modules/varnish/selinux/varnish_ownership.te',
policy => 'targeted'
}
from puppet-selinux.
Actually the lib/facter code for us had several issues:
- Missing require 'facter'
- Confine ... selinux => true missing single quotes, i.e. selinux => 'true'
- Facter::Core::Execution.exec didn't work
So our facter selinux_custom_policy.rb now looks like this:
require 'facter'
Facter.add(:selinux_custom_policy) do
confine :kernel => 'Linux', :osfamily => 'RedHat', :operatingsystemmajrelease => '7', :selinux => 'true'
setcode {Facter::Util::Resolution.exec('sestatus | grep "Loaded policy name" | awk '{print $4}'') }
end
from puppet-selinux.
@batman1007 confirmed issue on my servers as well. Submitted PR #45.
from puppet-selinux.
Resubmitted after noticing I missed the confine issue + escaping for awk. PR #46
from puppet-selinux.
As mentioned above, I think that we are seeing an issue with facter 'selinux' returning a string rather than a boolean, hence why we had to quote true in the facter code - it didn't confine correctly otherwise.
We're on facter version 1.7.5 and I notice this:
rodjek/puppet-lint#197
Thanks,
Dan.
from puppet-selinux.
@batman1007 agreed, that's why I added a quoted value in the confine.
from puppet-selinux.
Related Issues (20)
- RHEL8 HOT 4
- Just a heads-up - change in RHEL 7.7 HOT 12
- Missing CentOS 8 support HOT 8
- No autorelabel when enabling SELinux
- Error: Could not prefetch selinux_fcontext provider 'semanage': uninitialized constant Selinux HOT 8
- Unable to manage ports on RHEL/CentOS 8 HOT 2
- Facter 4 compatibilty HOT 11
- shouldn't selinux::fcontext do the necessary exec_restorecon ? HOT 2
- Selinux port ensure => absent do not work with port_range HOT 2
- Manage setroubleshootd/sealert? HOT 1
- missing semanage tools on el8 HOT 3
- The semanage_ports.py script needs to pick the correct version of python on a system with multiple installed HOT 7
- Error finding provider when using selinux_port HOT 1
- Add support for Puppet 7
- Add support for Fedora 33
- Resources that use 'semanage' should have an autorequires on the various packages
- Using selinux::fcontext::equivalence with hiera
- Drop Puppet 5 support; require 6.1. or newer HOT 1
- Drop EoL RHEL 6 support HOT 1
- Error: Could not prefetch selinux_fcontext provider 'semanage': uninitialized constant Selinux HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from puppet-selinux.