Package blocks
Table of contents
Blocks that install and remove software packages, with the host’s package manager.
Install Package
Ensures one or more packages are present.
Generates: a packages promise.
Settings
| Setting | Required | Description |
|---|---|---|
| Package name | Yes | One package per line. |
| Version | No | Empty: any installed version will do. A version (e.g. 1.24.0-1) installs exactly that one, latest keeps it at the newest available. Applies to every package listed. |
| Package manager | No | The package_module body that installs the packages. A custom one: its name (in default:) or namespace:name. One of: Platform default, apt_get (Debian, Ubuntu), yum (Red Hat, CentOS, Amazon Linux), dnf (Red Hat, Fedora), dnf_group (dnf package groups), zypper (SUSE), apk (Alpine), pkg (FreeBSD), freebsd_ports (FreeBSD ports), pkgsrc, slackpkg (Slackware), nimclient (AIX), snap, or Custom… and Custom body name. |
Example
The policy it generates, for example:
# Install nginx
packages:
"nginx" policy => "present";Remove Package
Ensures one or more packages are absent.
Generates: a packages promise.
Settings
| Setting | Required | Description |
|---|---|---|
| Package name | Yes | One package per line. |
| Package manager | No | The package_module body that removes the packages. A custom one: its name (in default:) or namespace:name. One of: Platform default, apt_get (Debian, Ubuntu), yum (Red Hat, CentOS, Amazon Linux), dnf (Red Hat, Fedora), dnf_group (dnf package groups), zypper (SUSE), apk (Alpine), pkg (FreeBSD), freebsd_ports (FreeBSD ports), pkgsrc, slackpkg (Slackware), nimclient (AIX), snap, or Custom… and Custom body name. |
Example
The policy it generates, for example:
# Remove telnet
packages:
"telnet" policy => "absent";