Skip to content

CFE-2852: dnf_group package module (3.27)#3142

Merged
nickanderson merged 2 commits intocfengine:3.27.xfrom
nickanderson:CFE-2852/3.27.x
Apr 23, 2026
Merged

CFE-2852: dnf_group package module (3.27)#3142
nickanderson merged 2 commits intocfengine:3.27.xfrom
nickanderson:CFE-2852/3.27.x

Conversation

@nickanderson
Copy link
Copy Markdown
Member

Ticket: CFE-2852

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)
@nickanderson nickanderson merged commit 166edc5 into cfengine:3.27.x Apr 23, 2026
7 checks passed
@nickanderson
Copy link
Copy Markdown
Member Author

@larsewi can you regen changelog to include this one for 3.27.1

olehermanse pushed a commit that referenced this pull request Apr 24, 2026
with changes from #3142

Signed-off-by: Lars Erik Wik <lars.erik.wik@northern.tech>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants