Skip to content

CFE-2852: dnf_group package module#3070

Merged
nickanderson merged 2 commits intocfengine:masterfrom
nickanderson:CFE-2852/master
Apr 10, 2026
Merged

CFE-2852: dnf_group package module#3070
nickanderson merged 2 commits intocfengine:masterfrom
nickanderson:CFE-2852/master

Conversation

@nickanderson
Copy link
Copy Markdown
Member

Ticket: CFE-2852

@nickanderson nickanderson marked this pull request as draft November 12, 2025 19:45
@cf-bottom
Copy link
Copy Markdown

Thanks for submitting a PR! Maybe @craigcomstock can review this?

@nickanderson nickanderson force-pushed the CFE-2852/master branch 2 times, most recently from eb0f478 to ccc4a74 Compare November 13, 2025 14:24
@nickanderson nickanderson changed the title CFE-2852: Prototyped dnf_group package module CFE-2852: dnf_group package module Nov 13, 2025
@nickanderson nickanderson force-pushed the CFE-2852/master branch 3 times, most recently from a6ff376 to 350572c Compare November 13, 2025 17:44
@nickanderson nickanderson marked this pull request as ready for review November 14, 2025 15:44
@nickanderson nickanderson removed the request for review from craigcomstock April 8, 2026 19:00
@nickanderson nickanderson force-pushed the CFE-2852/master branch 3 times, most recently from 10592c4 to 5cea8d5 Compare April 8, 2026 22:59
@nickanderson
Copy link
Copy Markdown
Member Author

I think that recursion failure is unrelated to this package module and instead related to that other file-separator change is that right @craigcomstock ?

@larsewi
Copy link
Copy Markdown
Contributor

larsewi commented Apr 10, 2026

I think that recursion failure is unrelated to this package module and instead related to that other file-separator change is that right @craigcomstock ?

Try to rebase with upstream/master @nickanderson

@nickanderson
Copy link
Copy Markdown
Member Author

I think that recursion failure is unrelated to this package module and instead related to that other file-separator change is that right @craigcomstock ?

Try to rebase with upstream/master @nickanderson

I have tried to rebase but it's still failing with the maximum recursion.

info: Executing 'no timeout' ... '"/usr/bin/cf-agent" -f /var/lib/cfengine/inputs/update.cf --define bootstrap_mode '

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
@nickanderson nickanderson merged commit 01d6b79 into cfengine:master Apr 10, 2026
3 of 4 checks passed
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.

4 participants