Support for rpm
salt.modules.rpm.
bin_pkg_info
(path, saltenv='base')¶New in version 2015.8.0.
Parses RPM metadata and returns a dictionary of information about the package (name, version, etc.).
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.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
salt.modules.rpm.
checksum
(*paths)¶Return if the signature of a RPM file is valid.
CLI Example:
salt '*' lowpkg.checksum /path/to/package1.rpm
salt '*' lowpkg.checksum /path/to/package1.rpm /path/to/package2.rpm
salt.modules.rpm.
diff
(package, path)¶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.
Parameters: |
|
---|---|
Returns: | Difference or empty string. For binary files only a notification. |
CLI example:
salt '*' lowpkg.diff apache2 /etc/apache2/httpd.conf
salt.modules.rpm.
file_dict
(*packages)¶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).
CLI Examples:
salt '*' lowpkg.file_dict httpd
salt '*' lowpkg.file_dict httpd postfix
salt '*' lowpkg.file_dict
salt.modules.rpm.
file_list
(*packages)¶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).
CLI Examples:
salt '*' lowpkg.file_list httpd
salt '*' lowpkg.file_list httpd postfix
salt '*' lowpkg.file_list
salt.modules.rpm.
info
(*packages, **attr)¶Return a detailed package(s) summary information. If no packages specified, all packages will be returned.
Parameters: |
|
---|---|
Returns: |
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.modules.rpm.
list_pkgs
(*packages)¶List the packages currently installed in a dict:
{'<package_name>': '<version>'}
CLI Example:
salt '*' lowpkg.list_pkgs
salt.modules.rpm.
modified
(*packages, **flags)¶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.
CLI examples:
salt '*' lowpkg.modified httpd
salt '*' lowpkg.modified httpd postfix
salt '*' lowpkg.modified
salt.modules.rpm.
owner
(*paths)¶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.
CLI Examples:
salt '*' lowpkg.owner /usr/bin/apachectl
salt '*' lowpkg.owner /usr/bin/apachectl /etc/httpd/conf/httpd.conf
salt.modules.rpm.
verify
(*packages, **kwargs)¶Runs an rpm -Va on a system, and returns the results in a dict
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']
salt.modules.rpm.
version_cmp
(ver1, ver2, ignore_epoch=False)¶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'