salt.modules.yumpkg

New in version 0.9.4: This module replaces the "yum" module in previous releases. It is backward compatibile and uses the native yum Python interface instead of the CLI interface.

Support for YUM

Required python modules: yum, rpm, rpmUtils

salt.modules.yumpkg.available_version(name)

The available version of the package in the repository

CLI Example:

salt '*' pkg.available_version <package name>
salt.modules.yumpkg.clean_metadata()

Cleans local yum metadata.

CLI Example:

salt '*' pkg.clean_metadata
salt.modules.yumpkg.install(pkgs, refresh=False, repo='', skip_verify=False, sources=None, **kwargs)

Install the passed package(s)

pkgs
The name of the package(s) to be installed. Can be comma separated, or space separated if the parameter is encased in quotes.
refresh
Clean out the yum database before executing. Defaults to False.
repo
Specify a package repository to install from. (e.g., yum --enablerepo=somerepo)
skip_verify
Skip the GPG verification check. (e.g., --nogpgcheck)
sources
A list of rpm sources to use for installing the package(s).

Return a dict containing the new package names and versions:

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

CLI Example:

salt '*' pkg.install 'package package package'
salt.modules.yumpkg.list_pkgs(*args)

List the packages currently installed in a dict:

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

CLI Example:

salt '*' pkg.list_pkgs
salt.modules.yumpkg.list_upgrades(*args)

Check whether or not an upgrade is available for all packages

CLI Example:

salt '*' pkg.list_upgrades
salt.modules.yumpkg.purge(pkgs)

Yum does not have a purge, this function calls remove

Return a list containing the removed packages:

CLI Example:

salt '*' pkg.purge <package name>
salt.modules.yumpkg.refresh_db()

Since yum refreshes the database automatically, this runs a yum clean, so that the next yum operation will have a clean database

CLI Example:

salt '*' pkg.refresh_db
salt.modules.yumpkg.remove(pkgs)

Removes packages with yum remove

Return a list containing the removed packages:

CLI Example:

salt '*' pkg.remove <package,package,package>
salt.modules.yumpkg.upgrade()

Run a full system upgrade, a yum upgrade

Return a dict containing the new package names and versions:

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

CLI Example:

salt '*' pkg.upgrade
salt.modules.yumpkg.upgrade_available(name)

Check whether or not an upgrade is available for a given package

CLI Example:

salt '*' pkg.upgrade_available <package name>
salt.modules.yumpkg.version(name)

Returns a version if the package is installed, else returns an empty string

CLI Example:

salt '*' pkg.version <package name>

Comments

comments powered by Disqus

Parent topic

Previous topic

salt.modules.yumpkg5

Next topic

salt.modules.zpool