[%CFEngine_function_prototype(package_regex, version_regex, arch_regex, method_regex)%]
Description: Return a data container with the list of available packages matching the parameters.
This function searches for the [anchored][anchored] regular expressions in the list of currently available packages.
The return is a data container with a list of package descriptions, looking like this:
[
{
"arch":"default",
"method":"dpkg",
"name":"syncthing",
"version":"0.12.8"
}
]
[%CFEngine_function_attributes(package_regex, version_regex, arch_regex, method_regex)%]
Argument Descriptions:
package_regex
- Regular expression matching packge nameversion_regex
- Regular expression matching package versionarch_regex
- Regular expression matching package architecutremethod_regex
- Regular expression matching package method (apt-get, rpm, etc …)IMPORTANT: Please note that you need to provide package_inventory
attribute in body common control
in order to be able to use this function. Also depending on the value(s) of package_inventory
only packages from selected package modules will be returned. For more information about package_inventory
please read [package_inventory
][Components and Common Control#package_inventory] section.
Example:
"all_package_updates" data => packageupdatesmatching(".*", ".*", ".*", ".*");
Refresh rules:
repo
type package is installed or removed $(sys.statedir)/packages_updates_<package_module>.lmdb*
History: Introduced in CFEngine 3.6
See also: packagesmatching()
.