Skip to content

deb Facts

deb.DebArch

host.get_fact(DebArch)

Returns the architecture string used in apt repository sources, eg amd64.

deb.DebPackage

host.get_fact(DebPackage, package)

Returns information on a .deb archive or installed package.

Package resolution depends on the remote current working directory and is therefore not idempotent:

  • Names that do not match the shell pattern *.deb query the installed package database.
  • Names that match *.deb inspect the archive only when that file exists in the current working directory. Otherwise they query the installed package database.

Consequently, archive names such as package.deb.old and package.deb~ cannot be queried as files. Older pyinfra versions tried to inspect any existing path as an archive instead.

deb.DebPackages

host.get_fact(DebPackages)

Returns a dict of installed dpkg packages:

{
    "package_name": ["version"],
}