Skip to content

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

StateMeaning
installedThe package is installed, at any version or — if version is set — at that exact version.
absentThe package is not installed; an installed package is removed.

Parameters

ParameterTypeRequiredDescription
versionstringExact 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: installed

Pin 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: absent

Notes

  • 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).
  • version is invalid with state absent.
  • Out of scope for v0.1: a latest state, explicit cache refresh, package holds/pinning, purge (vs remove), repository/source management, and macOS (Homebrew) / Windows (Chocolatey, winget).