Skip to content

Commit a79b58b

Browse files
committed
Added dnf_group package module documentation
1 parent 900c148 commit a79b58b

1 file changed

Lines changed: 73 additions & 0 deletions

File tree

content/reference/promise-types/packages.markdown

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,79 @@ bundle agent example
514514

515515
- Added in CFEngine 3.28.0, 3.27.1, 3.24.4
516516

517+
### dnf_group
518+
519+
Manage DNF/YUM package groups using `dnf group`. Package groups are collections
520+
of related packages (e.g., "Development Tools", "System Tools") commonly used on
521+
RHEL, Rocky Linux, AlmaLinux, and Fedora systems.
522+
523+
**Examples:**
524+
525+
Install a package group:
526+
527+
```cf3
528+
packages:
529+
redhat::
530+
"system-tools"
531+
policy => "present",
532+
package_module => dnf_group;
533+
```
534+
535+
Install a package group with optional packages included:
536+
537+
```cf3
538+
packages:
539+
redhat::
540+
"development"
541+
policy => "present",
542+
package_module => dnf_group,
543+
options => { "group_package_types=optional" };
544+
```
545+
546+
Upgrade all packages in an installed group:
547+
548+
```cf3
549+
packages:
550+
redhat::
551+
"development"
552+
policy => "present",
553+
package_module => dnf_group,
554+
version => "latest";
555+
```
556+
557+
Remove a package group:
558+
559+
```cf3
560+
packages:
561+
redhat::
562+
"system-tools"
563+
policy => "absent",
564+
package_module => dnf_group;
565+
```
566+
567+
**Options:**
568+
569+
The `options` attribute supports DNF setopt-style configuration:
570+
571+
- `group_package_types=TYPE` - Specify which package types to install from the group:
572+
- `mandatory` - Only mandatory packages (default)
573+
- `default` - Mandatory and default packages
574+
- `optional` - Mandatory, default, and optional packages
575+
576+
- Repository configuration: `<repo>.enabled=1|0` or `enablerepo=<repo>`, `disablerepo=<repo>`
577+
- Any DNF configuration option: `install_weak_deps=false`, `allow_downgrade=true`, etc.
578+
579+
**Notes:**
580+
- Requires Python 3 and python3-dnf to be installed on the host
581+
- The promiser must be the group ID (e.g., "development-tools"), not the display name ("Development Tools")
582+
- To find group IDs, use: `dnf group list --ids`
583+
- Use `version => "latest"` to upgrade all packages within the group
584+
- Package downgrades follow system configuration (typically disabled)
585+
586+
**History:**
587+
588+
- Added in CFEngine 3.28.0
589+
517590
### apt_get
518591

519592
Manage packages using `apt-get`.

0 commit comments

Comments
 (0)