Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions modules/enableit/profile/manifests/logging.pp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@
) {

if $manage {
# Ensure the configured logging group exists before it is used by file resources.
ensure_resource('group', $log_dir_group, {
ensure => present,
system => true,
})
Comment on lines +9 to +13
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$log_dir_group is typed as Eit_types::Group, which aliases Eit_types::User (i.e., it may be an integer ID as well as a name). If an integer GID is provided, ensure_resource('group', $log_dir_group, ...) will try to create a group with a numeric name (e.g. "4"), and the subsequent require => Group[$log_dir_group] will enforce an ordering on a resource that can’t be sensibly created. Consider either (a) narrowing the parameter type here to a group name type (e.g. Eit_types::UserName / String) or (b) guarding the ensure_resource + require logic so it only runs when $log_dir_group is a valid group name, leaving numeric IDs to be handled only via the file { group => ... } attribute.

Copilot uses AI. Check for mistakes.

# On Debian/Ubuntu the rsyslog daemon runs as the `syslog` user/group, but
# this user doesn't have write access to /var/log by default.
file { '/var/log':
ensure => directory,
group => $log_dir_group,
mode => $log_dir_mode,
require => Group[$log_dir_group],
}

# RHEL systems needs to have /var/log/rhsm, otherwise logs are output on
Expand Down
Loading