Support for rpm
New in version 2015.8.0.
Parses RPM metadata and returns a dictionary of information about the package (name, version, etc.).
Path to the file. Can either be an absolute path to a file on the
minion, or a salt fileserver URL (e.g. salt://path/to/file.rpm
).
If a salt fileserver URL is passed, the file will be cached to the
minion so that it can be examined.
Salt fileserver environment from which to retrieve the package. Ignored
if path
is a local file path on the minion.
CLI Example:
salt '*' lowpkg.bin_pkg_info /root/salt-2015.5.1-2.el7.noarch.rpm
salt '*' lowpkg.bin_pkg_info salt://salt-2015.5.1-2.el7.noarch.rpm
Return if the signature of a RPM file is valid.
use root as top level directory (default: "/")
CLI Example:
salt '*' lowpkg.checksum /path/to/package1.rpm
salt '*' lowpkg.checksum /path/to/package1.rpm /path/to/package2.rpm
Return a formatted diff between current file and original in a package. NOTE: this function includes all files (configuration and not), but does not work on binary content.
package -- Full pack of the RPM file
path -- Full path to the installed file
Difference or empty string. For binary files only a notification.
CLI Example:
salt '*' lowpkg.diff /path/to/apache2.rpm /etc/apache2/httpd.conf
List the files that belong to a package, sorted by group. Not specifying any packages will return a list of _every_ file on the system's rpm database (not generally recommended).
use root as top level directory (default: "/")
CLI Examples:
salt '*' lowpkg.file_dict httpd
salt '*' lowpkg.file_dict httpd postfix
salt '*' lowpkg.file_dict
List the files that belong to a package. Not specifying any packages will return a list of _every_ file on the system's rpm database (not generally recommended).
use root as top level directory (default: "/")
CLI Examples:
salt '*' lowpkg.file_list httpd
salt '*' lowpkg.file_list httpd postfix
salt '*' lowpkg.file_list
Return a detailed package(s) summary information. If no packages specified, all packages will be returned.
packages --
attr --
Comma-separated package attributes. If no 'attr' is specified, all available attributes returned.
version, vendor, release, build_date, build_date_time_t, install_date, install_date_time_t, build_host, group, source_rpm, arch, epoch, size, license, signature, packager, url, summary, description.
all_versions -- Return information for all installed versions of the packages
root -- use root as top level directory (default: "/")
CLI Example:
salt '*' lowpkg.info apache2 bash
salt '*' lowpkg.info apache2 bash attr=version
salt '*' lowpkg.info apache2 bash attr=version,build_date_iso,size
salt '*' lowpkg.info apache2 bash attr=version,build_date_iso,size all_versions=True
List the packages currently installed in a dict:
{'<package_name>': '<version>'}
use root as top level directory (default: "/")
CLI Example:
salt '*' lowpkg.list_pkgs
List the modified files that belong to a package. Not specifying any packages will return a list of _all_ modified files on the system's RPM database.
New in version 2015.5.0.
use root as top level directory (default: "/")
CLI Examples:
salt '*' lowpkg.modified httpd
salt '*' lowpkg.modified httpd postfix
salt '*' lowpkg.modified
Return the name of the package that owns the file. Multiple file paths can be passed. If a single path is passed, a string will be returned, and if multiple paths are passed, a dictionary of file/package name pairs will be returned.
If the file is not owned by a package, or is not present on the minion, then an empty string will be returned for that path.
use root as top level directory (default: "/")
CLI Examples:
salt '*' lowpkg.owner /usr/bin/apachectl
salt '*' lowpkg.owner /usr/bin/apachectl /etc/httpd/conf/httpd.conf
Runs an rpm -Va on a system, and returns the results in a dict
use root as top level directory (default: "/")
Files with an attribute of config, doc, ghost, license or readme in the
package header can be ignored using the ignore_types
keyword argument
CLI Example:
salt '*' lowpkg.verify
salt '*' lowpkg.verify httpd
salt '*' lowpkg.verify httpd postfix
salt '*' lowpkg.verify httpd postfix ignore_types=['config','doc']
New in version 2015.8.9.
Do a cmp-style comparison on two packages. Return -1 if ver1 < ver2, 0 if ver1 == ver2, and 1 if ver1 > ver2. Return None if there was a problem making the comparison.
Set to True
to ignore the epoch when comparing versions
New in version 2015.8.10,2016.3.2.
CLI Example:
salt '*' pkg.version_cmp '0.2-001' '0.2.0.1-002'