salt.resources.ssh.modules.pkg#

Execution module override for the ssh resource type — pkg.* surface.

Implements package management against SSH resources by running the appropriate package-manager commands on the remote host via the SSH Shell transport. Mirrors the interface of salt.modules.aptpkg / salt.modules.yumpkg for the functions most commonly called by state modules (pkg.installed, pkg.removed, etc.).

The managing minion detects the remote OS family from the resource grains and dispatches to the correct package-manager command set at call time.

salt.resources.ssh.modules.pkg.install(name=None, pkgs=None, sources=None, **kwargs)#

Install one or more packages on the SSH resource.

CLI Example:

salt -C 'T@ssh:node1' pkg.install curl
salt -C 'T@ssh:node1' pkg.install pkgs='[curl, git]'
salt.resources.ssh.modules.pkg.list_pkgs(**kwargs)#

List all installed packages on the SSH resource.

Returns a dict of {name: version}.

CLI Example:

salt -C 'T@ssh:node1' pkg.list_pkgs
salt.resources.ssh.modules.pkg.remove(name=None, pkgs=None, **kwargs)#

Remove one or more packages from the SSH resource.

CLI Example:

salt -C 'T@ssh:node1' pkg.remove curl
salt.resources.ssh.modules.pkg.version(*names, **kwargs)#

Return the installed version of the given package(s).

Returns a string for a single package or a dict for multiple packages.

CLI Example:

salt -C 'T@ssh:node1' pkg.version curl