salt.modules.yumpkg5

Support for YUM

Members

available_version

salt.modules.yumpkg5.available_version(name)

The available version of the package in the repository

CLI Example:

salt '*' pkg.available_version <package name>

install

salt.modules.yumpkg5.install(pkg, refresh=False, repo='', skip_verify=False, **kwargs)

Install the passed package

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 name>

list_pkgs

salt.modules.yumpkg5.list_pkgs()

List the packages currently installed in a dict:

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

CLI Example:

salt '*' pkg.list_pkgs

list_upgrades

salt.modules.yumpkg5.list_upgrades()

Check whether or not an upgrade is available for all packages

CLI Example:

salt '*' pkg.list_upgrades

namedtuple

salt.modules.yumpkg5.namedtuple(typename, field_names, verbose=False, rename=False)

Returns a new subclass of tuple with named fields.

>>> Point = namedtuple('Point', ['x', 'y'])
>>> Point.__doc__                   # docstring for the new class
'Point(x, y)'
>>> p = Point(11, y=22)             # instantiate with positional args or keywords
>>> p[0] + p[1]                     # indexable like a plain tuple
33
>>> x, y = p                        # unpack like a regular tuple
>>> x, y
(11, 22)
>>> p.x + p.y                       # fields also accessable by name
33
>>> d = p._asdict()                 # convert to a dictionary
>>> d['x']
11
>>> Point(**d)                      # convert from a dictionary
Point(x=11, y=22)
>>> p._replace(x=100)               # _replace() is like str.replace() but targets named fields
Point(x=100, y=22)

purge

salt.modules.yumpkg5.purge(pkg)

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.yumpkg5.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.yumpkg5.remove(pkg)

Remove a single package with yum remove

Return a list containing the removed packages:

CLI Example:

salt '*' pkg.remove <package name>

upgrade

salt.modules.yumpkg5.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.yumpkg5.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.yumpkg5.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.yumpkg

Next topic

salt.modules.zypper