camptocamp / puppet-selinux

http://www.camptocamp.com
1 stars 8 forks source link

"selinux::fcontext" and "selinux::seport" do not install semodule #30

Open traylenator opened 9 years ago

traylenator commented 9 years ago

The "selinux::fcontext" and "selinux::seport" classes from the puppet "selinux" module will try to run even when the "semanage" binary is not installed. This presumably is pulled in via "selinux::base", but there is no dependency between that class and the two other ones.. perhaps you could device a suitable way to pull in the "policycoreutils-python" (which provides "semanage") ?

Errors look like

Error: /Stage[main]/Eos::Http_gateway/Selinux::Fcontext[/usr/share/nginx]/Exec[semanage fcontext httpd_tmp_t /usr/share/nginx(/.*)?]: Could not evaluate: Could not find command 'semanage'
[..]
Error: /Stage[main]/Eos::Http_gateway/Selinux::Fcontext[/var/spool/nginx]/Exec[semanage fcontext httpd_tmp_t /var/spool/nginx(/.*)?]: Could not evaluate: Could not find command 'semanage'
Notice: /Stage[main]/Eos::Http_gateway/Selinux::Fcontext[/var/spool/nginx]/Exec[restorecon -R /var/spool/nginx]: Dependency Exec[semanage fcontext httpd_tmp_t /var/spool/nginx(/.*)?] has failures: true
Warning: /Stage[main]/Eos::Http_gateway/Selinux::Fcontext[/var/spool/nginx]/Exec[restorecon -R /var/spool/nginx]: Skipping because of failed dependencies
Error: /Stage[main]/Eos::Http_gateway/Selinux::Seport[nginx_4443]/Exec[semanage port 4443, proto tcp, type nginx_4443]: Could not evaluate: Could not find command 'semanage'
laurent-indermuehle commented 4 years ago

Agreed that there is something wrong. But I can't figured out how to fix it for good.

Workaround: Add include ::selinux::base before using _selinuxfcontext or _selinuxport types.