11# DNF AppStream Promise Type
22
3- A CFEngine custom promise type for managing DNF AppStream modules on RHEL 8+ and compatible systems.
3+ A CFEngine custom promise type for managing DNF AppStream modules on compatible systems.
44
55## Overview
66
@@ -10,10 +10,6 @@ The `dnf_appstream` promise type allows you to manage DNF AppStream modules, whi
1010
1111- Enable, disable, install, and remove DNF AppStream modules
1212- Support for specifying streams and profiles
13- - Input validation and sanitization for security
14- - Proper error handling and logging
15- - Module state checking to avoid unnecessary operations
16- - Uses DNF Python API for efficient and secure operations
1713
1814## Installation
1915
@@ -23,7 +19,7 @@ To install this promise type, copy the `dnf_appstream.py` file to your CFEngine
2319promise agent dnf_appstream
2420{
2521 interpreter => "/usr/bin/python3";
26- path => "$(sys.inputdir) /dnf_appstream.py";
22+ path => "$(sys.workdir)/modules/promises /dnf_appstream.py";
2723}
2824```
2925
@@ -59,20 +55,20 @@ bundle agent main
5955{
6056 dnf_appstream:
6157 "python36"
62- state => "present ",
58+ state => "installed ",
6359 stream => "3.6",
6460 profile => "minimal";
6561}
6662```
6763
68- ### Ensure a module is absent
64+ ### Ensure a module is removed
6965
7066```
7167bundle agent main
7268{
7369 dnf_appstream:
7470 "postgresql"
75- state => "absent ";
71+ state => "removed ";
7672}
7773```
7874
@@ -91,19 +87,9 @@ bundle agent main
9187
9288The promise type supports the following attributes:
9389
94- - ` state ` (required) - Desired state of the module: ` present ` , ` absent ` , ` enabled ` , ` disabled ` , or ` default ` (default: ` present ` )
95- - ` stream ` (optional) - Specific stream of the module to use. Set to ` "default" ` to use the module's default stream.
96- - ` profile ` (optional) - Specific profile of the module to install. Set to ` "default" ` to use the module stream's default profile.
97-
98- ## Module States
99-
100- - ` present ` - The module and its packages (profile) are present on the system (implies enabled). Alias: ` install ` .
101- - ` absent ` - The module is not present or is disabled. Alias: ` remove ` .
102- - ` enabled ` - The module is enabled and available for installation.
103- - ` disabled ` - The module is explicitly disabled.
104- - ` default ` - The module is in its default state (neither enabled nor disabled, no profiles installed). Alias: ` reset ` .
105-
106- Note: The ` present ` state implies ` enabled ` because in DNF's module system, installing a module automatically enables it first.
90+ - ` state ` (optional) - Desired state of the module: ` enabled ` , ` disabled ` , ` installed ` , ` removed ` , ` default ` , or ` reset ` (default: ` enabled ` )
91+ - ` stream ` (optional) - Specific stream of the module to use. Set to ` default ` to use the module's default stream.
92+ - ` profile ` (optional) - Specific profile of the module to install. Set to ` default ` to use the module stream's default profile.
10793
10894## Requirements
10995
0 commit comments