salt.modules.openbsdpkg

Package support for OpenBSD

salt.modules.openbsdpkg.install(name=None, pkgs=None, sources=None, **kwargs)

Install the passed package

Return a dict containing the new package names and versions:

{'<package>': {'old': '<old-version>',
               'new': '<new-version>'}}

CLI Example, Install one package:

salt '*' pkg.install <package name>

CLI Example, Install more than one package:

salt '*' pkg.install pkgs='["<package name>", "<package name>"]'

CLI Example, Install more than one package from a alternate source (e.g. salt file-server, HTTP, FTP, local filesystem):

salt '*' pkg.install sources='[{"<pkg name>": "salt://pkgs/<pkg filename>"}]'
salt.modules.openbsdpkg.latest_version(*names, **kwargs)

The available version of the package in the repository

CLI 范例:

salt '*' pkg.latest_version <package name>
salt.modules.openbsdpkg.list_pkgs(versions_as_list=False, **kwargs)

List the packages currently installed as a dict:

{'<package_name>': '<version>'}

CLI 范例:

salt '*' pkg.list_pkgs
salt.modules.openbsdpkg.purge(name=None, pkgs=None, **kwargs)

Package purges are not supported, this function is identical to remove().

name
The name of the package to be deleted.

Multiple Package Options:

pkgs
A list of packages to delete. Must be passed as a python list. The name parameter will be ignored if this option is passed.

0.16.0 新版功能.

Returns a dict containing the changes.

CLI 范例:

salt '*' pkg.purge <package name>
salt '*' pkg.purge <package1>,<package2>,<package3>
salt '*' pkg.purge pkgs='["foo", "bar"]'
salt.modules.openbsdpkg.remove(name=None, pkgs=None, **kwargs)

Remove a single package with pkg_delete

Multiple Package Options:

pkgs
A list of packages to delete. Must be passed as a python list. The name parameter will be ignored if this option is passed.

0.16.0 新版功能.

Returns a dict containing the changes.

CLI 范例:

salt '*' pkg.remove <package name>
salt '*' pkg.remove <package1>,<package2>,<package3>
salt '*' pkg.remove pkgs='["foo", "bar"]'
salt.modules.openbsdpkg.version(*names, **kwargs)

Returns a string representing the package version or an empty string if not installed. If more than one package name is specified, a dict of name/version pairs is returned.

CLI 范例:

salt '*' pkg.version <package name>
salt '*' pkg.version <package1> <package2> <package3> ...