# salt.modules.aixpkg

Package support for AIX

Important

If you feel that Salt should be using this module to manage filesets or rpm packages on a minion, and it is using a different module (or gives an error similar to 'pkg.install' is not available), see here.

salt.modules.aixpkg.available_version(*names, **kwargs)

  This function is an alias of `latest_version`.

  > Return the latest available version of the named fileset/rpm package available for upgrade or installation. If more than one fileset/rpm package name is specified, a dict of name/version pairs is returned.

  > If the latest version of a given fileset/rpm package is already installed, an empty string will be returned for that package.

  > Changed in version 3005.

  > CLI Example:

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

  > Note: currently only functional for rpm packages due to filesets do not have a specific location to check

  >   Requires yum of dnf available in order to query a repository

  > This function will always return an empty string for unfound fileset/rpm package.

salt.modules.aixpkg.install(name=None, refresh=False, pkgs=None, version=None, test=False, **kwargs)

  Install the named fileset(s)/rpm package(s).

  Changed in version 3005:

  preference to install rpm packages are to use in the following order:

    /opt/freeware/bin/dnf /opt/freeware/bin/yum /usr/bin/yum /usr/bin/rpm

  name

    The name of the fileset or rpm package to be installed.

  refresh

    Whether or not to update the yum database before executing.

  pkgs

    A list of filesets and/or rpm packages to install. Must be passed as a python list. The `name` parameter will be ignored if this option is passed.

  version

    Install a specific version of a fileset/rpm package. (Unused at present).

  test

    Verify that command functions correctly.

  Returns a dict containing the new fileset(s)/rpm package(s) names and versions:

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

  >   'new': '<new-version>'}}

  CLI Example:

      salt '*' pkg.install /stage/middleware/AIX/bash-4.2-3.aix6.1.ppc.rpm
      salt '*' pkg.install /stage/middleware/AIX/bash-4.2-3.aix6.1.ppc.rpm refresh=True
      salt '*' pkg.install /stage/middleware/AIX/VIOS2211_update/tpc_4.1.1.85.bff
      salt '*' pkg.install /cecc/repos/aix72/TL3/BASE/installp/ppc/bos.rte.printers_7.2.2.0.bff
      salt '*' pkg.install /stage/middleware/AIX/Xlc/usr/sys/inst.images/xlC.rte
      salt '*' pkg.install /stage/middleware/AIX/Firefox/ppc-AIX53/Firefox.base
      salt '*' pkg.install /cecc/repos/aix72/TL3/BASE/installp/ppc/bos.net
      salt '*' pkg.install pkgs='["foo", "bar"]'
      salt '*' pkg.install libxml2

salt.modules.aixpkg.latest_version(*names, **kwargs)

  Return the latest available version of the named fileset/rpm package available for upgrade or installation. If more than one fileset/rpm package name is specified, a dict of name/version pairs is returned.

  If the latest version of a given fileset/rpm package is already installed, an empty string will be returned for that package.

  Changed in version 3005.

  CLI Example:

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

  Note: currently only functional for rpm packages due to filesets do not have a specific location to check

    Requires yum of dnf available in order to query a repository

  This function will always return an empty string for unfound fileset/rpm package.

salt.modules.aixpkg.list_pkgs(versions_as_list=False, **kwargs)

  List the filesets/rpm packages currently installed as a dict:

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

  CLI Example:

      salt '*' pkg.list_pkgs

salt.modules.aixpkg.remove(name=None, pkgs=None, **kwargs)

  Remove specified fileset(s)/rpm package(s).

  name

    The name of the fileset or rpm package to be deleted.

  Changed in version 3005:

  preference to install rpm packages are to use in the following order:

    /opt/freeware/bin/dnf /opt/freeware/bin/yum /usr/bin/yum /usr/bin/rpm

  pkgs

    A list of filesets and/or rpm packages to delete. Must be passed as a python list. The `name` parameter will be ignored if this option is passed.

  Returns a list containing the removed packages.

  CLI Example:

      salt '*' pkg.remove <fileset/rpm package name>
      salt '*' pkg.remove tcsh
      salt '*' pkg.remove xlC.rte
      salt '*' pkg.remove Firefox.base.adt
      salt '*' pkg.remove pkgs='["foo", "bar"]'

salt.modules.aixpkg.upgrade_available(name, **kwargs)

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

  Changed in version 3005.

  CLI Example:

      salt '*' pkg.upgrade_available <package name>

  Note: currently only functional for rpm packages due to filesets do not have a specific location to check

    Requires yum of dnf available in order to query a repository

salt.modules.aixpkg.version(*names, **kwargs)

  Return the current installed version of the named fileset/rpm package If more than one fileset/rpm package name is specified a dict of name/version pairs is returned.

  Changed in version 3005.

  CLI Example:

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