package
Manages a Linux system package via the host’s native package manager — present at any version or pinned to an exact one, or removed. Idempotent: re-applying an unchanged declaration reports no change.
Category: System & core
States
| State | Meaning |
|---|---|
installed | The package is installed, at any version or — if version is set — at that exact version. |
absent | The package is not installed; an installed package is removed. |
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
version | string | Exact version pin (state installed only); install/upgrade/downgrade to it. Omit for any version. Invalid with state absent. |
Examples
Ensure a package is installed
package:
nginx:
state: installedPin to an exact version
The resource name is the package name; version pins it.
package:
nginx:
state: installed
version: "1.20.1"Remove a package
package:
telnet:
state: absentNotes
- Backend is auto-detected. apt, dnf, and apk are stable (verified on the live Debian/Ubuntu, Rocky, and Alpine matrix); zypper and pacman are experimental (implemented and unit-tested, but no SUSE/Arch distro is in the live matrix yet).
versionis invalid with stateabsent.- Out of scope for v0.1: a
lateststate, explicit cache refresh, package holds/pinning, purge (vs remove), repository/source management, and macOS (Homebrew) / Windows (Chocolatey, winget).