Links
🎁

Package Managers

The package management modules wrap package manager commands for easier, more declarative use. Any package manager for a popular OS or programming language is completely appropriate for inclusion in Jet core as a contribution. These modules are also some of the easiest to write. Currently implemented modules are listed below:

Package Manager Module Index

Module
Description
apt
Package management for Debian and derivatives like Ubuntu
dnf
Package management for current "Enterprise Linux" OSes and Fedora
yum
Package management for "Enterprise Linux" 7 and before. Actually an alias, this is the same underlying Jet module as 'dnf'.

apt

Installs packages on Debian and Ubuntu systems with the apt package manager.
Apt-Cache Information
the apt-module does not run "apt-cache update" for you, if this is important (and it should be), use the shell module to do it.
tasks:
- !apt
package: redis
- !apt
package: redis
version: 5:6.0.16-1ubuntu1
- !apt
package: redis
update: true
- !apt
package: redis
remove: true
Parameter
Description
package
Required. Name of the package to install or remove
version
Optional version of the package to install or upgrade to. Must be matched exactly.
update
Boolean, default false. If true, will attempt to update an already installed package to the latest version in the repo or the given version, if version is specified.
remove
Boolean, default false. If true, will remove the package if installed rather than attempting installation if not installed.

dnf

Installs packages for "Enterprise Linux" flavor operating systems using the dnf package manager. Specific versions can be specified, or not.
"remove" will remove the package if currently installed.
tasks:
- !dnf
package: tree
- !dnf
package: tree
version: 1.8.0
- !dnf
package: tree
update: true
- !dnf
package: tree
remove: true
Parameter
Description
package
Required. Name of the package to install or remove
version
Optional version of the package to install or upgrade to. Must be matched exactly.
update
Boolean, default false. If true, will attempt to update an already installed package to the latest version in the repo or the given version, if version is specified.
remove
Boolean, default false. If true, will remove the package if installed rather than attempting installation if not installed.

yum

At some point at time "Enterprise Linux" distros and Fedora changed their package manager while keeping the commands and interface the same. Since they mostly work the same, internally in Jet, we can run mostly the same code to support both modules. Internally the Jet module will see if the /usr/bin/yum or /usr/bin/dnf command is available and run the correct command as appropriate. This means the module may be referenced as "!dnf" or "!yum" in Jet playbooks and it makes no difference, it will run the correct command either way.
There is no need to write playbook logic to figure out whether to use !dnf or !yum when configuring a server, nor to use the facts module prior to using either module. Take care though - various configuration files for the package manager still do have different locations.
tasks:
- !yum
package: tree
# .. and so on, see examples for the dnf module
Parameters
Description
See dnf
See dnf