Skip to content

Commit 10bcd44

Browse files
committed
docs: update appstreams README with new features
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.
1 parent b3364f5 commit 10bcd44

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

promise-types/appstreams/README.md

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# AppStreams Promise Type
2-
31
A CFEngine custom promise type for managing AppStream modules on compatible systems.
42

53
## Overview
@@ -10,6 +8,9 @@ The `appstreams` promise type allows you to manage AppStream modules, which are
108

119
- Enable, disable, install, and remove AppStream modules
1210
- 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
1314

1415
## Installation
1516

@@ -83,13 +84,56 @@ bundle agent main
8384
}
8485
```
8586

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+
86127
## Attributes
87128

88129
The promise type supports the following attributes:
89130

90131
- `state` (optional) - Desired state of the module: `enabled`, `disabled`, `installed`, `removed`, `default`, or `reset` (default: `enabled`)
91132
- `stream` (optional) - Specific stream of the module to use. Set to `default` to use the module's default stream.
92133
- `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.
93137

94138
## Requirements
95139

0 commit comments

Comments
 (0)