sous-chefs / selinux

Development repository for the selinux cookbook
https://supermarket.chef.io/cookbooks/selinux
Apache License 2.0
58 stars 70 forks source link

SELinux v6.0.6 Recipe Compile Error in ../selinux/resources/boolean.rb - uninitialized constant Chef::SELinux::Cookbook #87

Closed mrhilly closed 1 year ago

mrhilly commented 1 year ago

:speaking_head: Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

:ghost: Brief Description

SELinux v6.0.6 Recipe Compile Error in ../selinux/resources/boolean.rb - uninitialized constant Chef::SELinux::Cookbook

:pancakes: Cookbook version

selinux (6.0.6)

:woman_cook: Chef-Infra Version

Version of chef-client in your environment.

chef_version=18.0.161

:tophat: Platform details

RHEL 9

Steps To Reproduce

Steps to reproduce the behavior:

chef-client

================================================================================ Recipe Compile Error in /var/chef/cache/cookbooks/selinux/resources/boolean.rb

NameError

uninitialized constant Chef::SELinux::Cookbook

Cookbook Trace: (most recent call first)

/var/chef/cache/cookbooks/selinux/resources/boolean.rb:40:in block in class_from_file' /var/chef/cache/cookbooks/selinux/resources/boolean.rb:39:inclass_from_file'

Relevant File Content:

/var/chef/cache/cookbooks/selinux/resources/boolean.rb:

33: description: 'Set to true for value setting to survive reboot' 34:
35: load_current_value do |new_resource| 36: value shell_out!("getsebool #{new_resource.boolean}").stdout.split('-->').map(&:strip).last 37: end 38:
39: action_class do 40>> include SELinux::Cookbook::StateHelpers 41: end 42:
43: action :set do 44: if selinux_disabled? 45: Chef::Log.warn("Unable to set SELinux boolean #{new_resource.name} as SELinux is disabled") 46: return 47: end 48:
49: converge_if_changed do

System Info:

chef_version=18.0.161 platform=redhat platform_version=9.0 ruby=ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux] program_name=/usr/bin/chef-client executable=/opt/chef/bin/chef-client

:police_car: Expected behavior

For it to Run a bought one.

:heavy_plus_sign: Additional context

Add any other context about the problem here. e.g. related issues or existing pull requests.

Stromweld commented 1 year ago

Can you verify if this is an issue with chef-client 17 as chef-client 18 introduces it's own native selinux resources and I'd suggest using them over the cookbook?

ianl678 commented 1 year ago

Hi,

The issue does not exist using CHEF v17 on RHEL9, we'll check out the new native resources though, thanks!

Stromweld commented 1 year ago

Closing since Chef-client 18 has resources built in and supersedes the need for this cookbook.