Skip to content

core.pkg

← Module catalog

soul-sidesoulstack.systemsystemroot required

Manage OS packages via the native package manager.

core.pkg brings OS packages to the required state via the host's native package manager. The backend is chosen automatically from host facts, and the states are idempotent: if a package is already at the required version, the step does nothing and reports changed=false. Install and remove run with the soul agent process's privileges and require root.

Requirements

  • Rootrequired
  • Sidesoul-side
  • Collectionsoulstack.system
  • Categorysystem
Capabilitiesrun_as_rootexec_subprocess
Backend detection

Auto from host facts (os.pkg_mgr); when absent, runtime detection: apt (Debian/Ubuntu), dnf (RHEL ≥ 8), yum (RHEL ≤ 7), apk (Alpine). If none is found, the step fails.

States

core.pkg.installed — The package is installed (optionally an exact version).

Changes when

The package was missing or the installed version ≠ the requested one.

Stays unchanged when

The required version is already installed.

Parameters

ParamTypeRequired / defaultDescription
namestringrequiredPackage name.
versionstringoptionalExact package version (if omitted — any).

Example — Installing redis-server with a pinned version and retry

- name: Install redis-server
module: core.pkg.installed
retry: { count: 3, delay: 10s }
params:
name: redis-server
version: "7.0.15"

Output

FieldTypeDescription
namestring
installedtrue
versionstring

Reference

Supported backends

ManagerDistributionsHow it is chosen
aptDebian, Ubuntufrom the os.pkg_mgr fact, otherwise runtime detection
dnfRHEL ≥ 8, Fedorasame
yumRHEL ≤ 7same
apkAlpinesame

Notes

  • On apt/apk the repository index is refreshed once per process lifetime before installed/latest — important for fresh VMs and containers. dnf/yum pull metadata on their own.
  • Requires root: install and remove go through the package manager.

Security & defaults

  • The package manager verifies package signatures, not the module: the trust source is the apt/dnf/yum/apk repository keys on the host.
  • The module does not add repository keys and does not set --allow-unauthenticated / --nogpgcheck.
  • name and version must come from the Destiny author, not from untrusted input: installation runs the package's maintainer scripts (postinst and so on) with the soul agent's privileges.

See also