CFE-2852: dnf_group package module#3070
Conversation
|
Thanks for submitting a PR! Maybe @craigcomstock can review this? |
eb0f478 to
ccc4a74
Compare
a6ff376 to
350572c
Compare
350572c to
7ea92df
Compare
10592c4 to
5cea8d5
Compare
|
I think that recursion failure is unrelated to this package module and instead related to that other file-separator change is that right @craigcomstock ? |
4aa392f to
5cea8d5
Compare
Try to rebase with upstream/master @nickanderson |
I have tried to rebase but it's still failing with the maximum recursion. notice: Q: ".../cf-agent" -f /": error: Maximum recursion level reached at '/var/lib/cfengine/inputs/cfe_internal/update/../../modules/packages/vendored' |
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
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
597571f to
ac3d657
Compare
Ticket: CFE-2852