I'm seeing an issue with the `sce_mass_mount_opts`...
# compliance
m
I'm seeing an issue with the
sce_mass_mount_opts
type fail when trying to update any entry in /etc/fstab (RHEL9, stig). The error I'm getting for all of these controls is basically:
Copy code
Error: Could not set 'present' on ensure: comparison of NilClass with 14 failed (file: /etc/puppetlabs/puppetserver/code/environments/production/modules/sce_linux/manifests/utils/partitions/non_root_local_options.pp, line: 40)
fstab entries look like the below for all mounts:
Copy code
UUID=0979b5f9-8ca7-49c4-98de-2058d6cd76c1  /tmp  xfs  defaults  0  0
/dev/mapper/rootvg-auditlv /var/log/audit xfs defaults 0 0
All of these failures are pointing at code that are variations of this block:
Copy code
if $nosuid {
    sce_mass_mount_opts { 'sce_non_root_local_mount_options_nosuid':
      ensure       => present,
      mount_point  => '/',
      option       => 'nosuid',
      inversematch => true,
      local_only   => true,
    }
  }
The file originally had tabs for whitespace, but I'm getting the same errors when replacing those tabs with whitespace.
j
Hey Mike, starting with a caveat that I'm not an expert here, just happened to see your message and decided to drop it into the Perforce search bot to see what it thought in the hopes it might be helpful. You probably already checked this, but just in case, thought I'd share! The message it gave back about the error was this:
The error "Could not set 'present' on ensure: comparison of NilClass" can occur if the resource being managed has some attribute or value undefined or
nil
when Puppet tries to execute operations on it.
This can happen for example when:
• A required parameter is missing in the resource definition.
• There is an issue or bug in the provider/implementation for the resource, especially if it fails to handle undefined or empty data scenarios correctly.
Here are a few actions to resolve or debug the problem:
1. Check the resource definitions in your Puppet manifests to ensure all required attributes are provided and valid.
2. If custom types or provider code is being used, verify the
ensure
property implementation. The property should correctly handle
nil
,
absent
, and other expected states1.
3. Use debug or verbose mode to gather additional logs for the Puppet run, which might give more context about what operation failed. You can do this by running the
puppet agent
command with the
--debug
and/or
--verbose
flags.
m
Thanks, good info for sure. I've opened a case with support and have started working through some questions with them too.