salt.modules.yumpkg

Support for YUM

Required python modules: yum, rpm, rpmUtils

Members

available_version

salt.modules.yumpkg.available_version(name)

The available version of the package in the repository

CLI Example:

salt '*' pkg.available_version <package name>

clean_metadata

salt.modules.yumpkg.clean_metadata()

Cleans local yum metadata.

CLI Example:

salt '*' pkg.clean_metadata

install

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

Install the passed package(s)

pkg
The name of the package to be installed
refresh : False
Clean out the yum database before executing
repo : (default)
Specify a package repository to install from (e.g., yum --enablerepo=somerepo)
skip_verify : False
Skip the GPG verification check (e.g., --nogpgcheck)

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'

list_pkgs

salt.modules.yumpkg.list_pkgs(*args)

List the packages currently installed in a dict:

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

CLI Example:

salt '*' pkg.list_pkgs

list_upgrades

salt.modules.yumpkg.list_upgrades(*args)

Check whether or not an upgrade is available for all packages

CLI Example:

salt '*' pkg.list_upgrades

purge

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>

refresh_db

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

remove

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>

upgrade

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

upgrade_available

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>

version

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>

Parent topic

Table Of Contents

Previous topic

salt.modules.win_useradd

Next topic

salt.modules.yumpkg5