Skip to content

package

Purpose: ensure a package is installed (present) or removed (absent) using the target’s native package backend — apt on Ubuntu, dnf on RHEL-family targets.

- id: tree
type: package
with:
name: tree
state: present

An operation may provide environment variables explicitly. They are passed only to this package operation (including its privileged apt/dnf execution); they do not configure a persistent host-wide environment.

- id: install-tools
type: package
with:
name: curl
state: present
env:
HTTP_PROXY: "http://proxy.example.com:3128"
HTTPS_PROXY: "http://proxy.example.com:3128"
NO_PROXY: "localhost,127.0.0.1,.example.internal"
Parameter Required Type Default Description
name yes string — Package name (validated).
state yes string — present or absent. Required.
env no map of strings empty Environment variables for this package operation.
  • Backend is chosen automatically from the target’s /etc/os-release identity — recipes stay platform-neutral.
  • present on Ubuntu → apt; on RHEL-family targets (Rocky Linux, RHEL, AlmaLinux, Oracle Linux) → dnf.
  • No version pinning in v1.3.0.
  • On dnf targets, installs run through a private cache snapshot — see Execution Model and the Rocky guide.
  • Broken package states (half-configured etc.) fail rather than auto-repair.

Fully idempotent — already-installed present and already-absent absent produce no mutation and no package transaction.

  • Unsupported platform / missing backend → capability error.
  • Unresolvable package, repository errors, or ambiguous observation → failure or indeterminate, never a false change report.
  • Observation failure before mutation is never reported as a change.
Platform Backend
Ubuntu 24.04 / 26.04 LTS apt
Rocky Linux 9 / 10 dnf
RHEL 9 / 10 dnf
AlmaLinux 9 / 10 dnf
Oracle Linux dnf (expected compatible — not acceptance-tested)

service · Execution Model