CFE-2852: dnf_group package module (3.24)#3143
Merged
nickanderson merged 2 commits intocfengine:3.24.xfrom Apr 23, 2026
Merged
Conversation
This module enables CFEngine to manage DNF/YUM package groups (e.g.,
"Development Tools", "System Tools") on RHEL/Rocky/AlmaLinux systems.
Key features:
- Install, upgrade, and remove package groups
- List installed groups and check for updates
- Configure group installation types (mandatory/default/optional packages)
- Supports DNF setopt-style configuration options
Example usage:
packages:
"system-tools"
policy => "present",
package_module => dnf_group;
"development"
policy => "present",
package_module => dnf_group,
options => { "group_package_types=optional", "install_weak_deps=false" }
version => "latest"; # Upgrade group packages
Ticket: CFE-2852
(cherry picked from commit ac3171a)
The filter() call in modules_presence needs to account for CFE-4623 behavior changes where findfiles() stopped suffixing directories with trailing slashes in CFEngine 3.24.0+. Prior to 3.24.0, findfiles() returned directory paths with trailing slashes (e.g., "/path/vendored/"). Starting in 3.24.0, the trailing slash was removed (e.g., "/path/vendored"). This broke the filter pattern that was designed to exclude the vendored subdirectory. The original fix (commit 3842469) unconditionally added $(const.dirsep) to the filter pattern. However, this breaks on versions where findfiles() still returns the trailing slash, causing maximum recursion errors during policy updates. This commit uses cf_version_between() and cf_version_at() to conditionally add the directory separator only for versions affected by CFE-4623: - 3.24.0 through 3.24.3 - 3.26.0 - 3.27.0 Versions outside this range use the original filter pattern without the additional separator. Related: - CFE-4623: findfiles() should suffix directories with a slash - Blog post: https://cfengine.com/blog/2025/change-in-behavior-findfiles/ - Original fix: commit 3842469 Ticket: CFE-2852 Changelog: Fixed maximum recursion errors in modules_presence for CFEngine versions unaffected by CFE-4623 (cherry picked from commit ac3d657)
olehermanse
approved these changes
Apr 23, 2026
olehermanse
pushed a commit
that referenced
this pull request
Apr 24, 2026
with changes from #3143 Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ticket: CFE-2852