You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Document the new features added in this PR:
- Stream switching (automatic upgrades/downgrades)
- Generic DNF options support
- Audit trail attributes (handle, comment)
Add usage examples for stream switching and DNF options.
Copy file name to clipboardExpand all lines: promise-types/appstreams/README.md
+46-2Lines changed: 46 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,3 @@
1
-
# AppStreams Promise Type
2
-
3
1
A CFEngine custom promise type for managing AppStream modules on compatible systems.
4
2
5
3
## Overview
@@ -10,6 +8,9 @@ The `appstreams` promise type allows you to manage AppStream modules, which are
10
8
11
9
- Enable, disable, install, and remove AppStream modules
12
10
- Support for specifying streams and profiles
11
+
- Automatic stream switching (upgrades and downgrades)
12
+
- Generic DNF configuration options support
13
+
- Audit trail support via handle and comment attributes
13
14
14
15
## Installation
15
16
@@ -83,13 +84,56 @@ bundle agent main
83
84
}
84
85
```
85
86
87
+
### Stream switching (upgrade or downgrade)
88
+
89
+
When a module is already installed with a different stream, the promise type automatically switches to the requested stream:
90
+
91
+
```
92
+
bundle agent main
93
+
{
94
+
appstreams:
95
+
"php"
96
+
handle => "main_php_stream_82",
97
+
comment => "Upgrade PHP from 8.1 to 8.2 for new features",
98
+
state => "installed",
99
+
stream => "8.2",
100
+
profile => "minimal";
101
+
}
102
+
```
103
+
104
+
This will automatically switch from any currently installed stream (e.g., 8.1) to stream 8.2.
105
+
106
+
### Using DNF options
107
+
108
+
You can pass generic DNF configuration options to control package installation behavior:
109
+
110
+
```
111
+
bundle agent main
112
+
{
113
+
appstreams:
114
+
"php"
115
+
state => "installed",
116
+
stream => "8.2",
117
+
profile => "minimal",
118
+
options => {
119
+
"install_weak_deps=false",
120
+
"best=true"
121
+
};
122
+
}
123
+
```
124
+
125
+
This installs PHP 8.2 minimal profile without weak dependencies (like httpd).
126
+
86
127
## Attributes
87
128
88
129
The promise type supports the following attributes:
89
130
90
131
-`state` (optional) - Desired state of the module: `enabled`, `disabled`, `installed`, `removed`, `default`, or `reset` (default: `enabled`)
91
132
-`stream` (optional) - Specific stream of the module to use. Set to `default` to use the module's default stream.
92
133
-`profile` (optional) - Specific profile of the module to install. Set to `default` to use the module stream's default profile.
134
+
-`options` (optional) - List of DNF configuration options as "key=value" strings (e.g., `{ "install_weak_deps=false", "best=true" }`). Invalid options will cause the promise to fail.
135
+
-`handle` (optional) - CFEngine handle for the promise, recorded in DNF history for audit traceability.
136
+
-`comment` (optional) - CFEngine comment for the promise, recorded in DNF history for audit traceability.
0 commit comments