salt.modules.solarispkg

Package support for Solaris

salt.modules.solarispkg.available_version(name)

The available version of the package in the repository On Solaris with the pkg module this always returns the version that is installed since pkgadd does not have the concept of a repository.

CLI Example:

salt '*' pkg.available_version <package name>
salt.modules.solarispkg.install(name, refresh=False, **kwargs)

Install the passed package. Can install packages from the following sources:

* Locally (package already exists on the minion
* HTTP/HTTPS server
* FTP server
* Salt master

Returns a dict containing the new package names and versions:

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

CLI Example, installing a datastream pkg that already exists on the minion:

salt '*' pkg.install <package name once installed> source=/dir/on/minion/<package filename>
salt '*' pkg.install SMClgcc346 source=/var/spool/pkg/gcc-3.4.6-sol10-sparc-local.pkg

CLI Example, installing a datastream pkg that exists on the salt master:

salt '*' pkg.install <package name once installed> source='salt://srv/salt/pkgs/<package filename>'
salt '*' pkg.install SMClgcc346 source='salt://srv/salt/pkgs/gcc-3.4.6-sol10-sparc-local.pkg'

CLI Example, installing a datastream pkg that exists on a HTTP server:

salt '*' pkg.install <package name once installed> source='http://packages.server.com/<package filename>'
salt '*' pkg.install SMClgcc346 source='http://packages.server.com/gcc-3.4.6-sol10-sparc-local.pkg'

If working with solaris zones and you want to install a package only in the global zone you can pass 'current_zone_only=True' to salt to have the package only installed in the global zone. (Behind the scenes this is passing '-G' to the pkgadd command.) Solaris default when installing a package in the global zone is to install it in all zones. This overrides that and installs the package only in the global.

CLI Example, installing a datastream package only in the global zone:

salt 'global_zone' pkg.install SMClgcc346 source=/var/spool/pkg/gcc-3.4.6-sol10-sparc-local.pkg current_zone_only=True

By default salt automatically provides an adminfile, to automate package installation, with these options set:

email= instance=quit partial=nocheck runlevel=nocheck idepend=nocheck rdepend=nocheck space=nocheck setuid=nocheck conflict=nocheck action=nocheck basedir=default

You can override any of these options in two ways. First you can optionally pass any of the options as a kwarg to the module/state to override the default value or you can optionally pass the 'admin_source' option providing your own adminfile to the minions.

Note: You can find all of the possible options to provide to the adminfile by reading the admin man page:

man -s 4 admin

CLI Example - Overriding the 'instance' adminfile option when calling the module directly:

salt '*' pkg.install <package name once installed> source='salt://srv/salt/pkgs/<package filename>' instance="overwrite"

CLI Example - Overriding the 'instance' adminfile option when used in a state:

SMClgcc346:
  pkg.installed:
    - source: salt://srv/salt/pkgs/gcc-3.4.6-sol10-sparc-local.pkg
    - instance: overwrite

CLI Example - Providing your own adminfile when calling the module directly:

salt '*' pkg.install <package name once installed> source='salt://srv/salt/pkgs/<package filename>' admin_source='salt://srv/salt/pkgs/<adminfile filename>'

CLI Example - Providing your own adminfile when using states:

<package name once installed>:
  pkg.installed:
    - source: salt://srv/salt/pkgs/<package filename>
    - admin_source: salt://srv/salt/pkgs/<adminfile filename>
salt.modules.solarispkg.list_pkgs()

List the packages currently installed as a dict:

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

CLI Example:

salt '*' pkg.list_pkgs
salt.modules.solarispkg.purge(name, **kwargs)

Remove a single package with pkgrm

Returns a list containing the removed packages.

CLI Example:

salt '*' pkg.purge <package name>
salt.modules.solarispkg.remove(name, **kwargs)

Remove a single package with pkgrm

By default salt automatically provides an adminfile, to automate package removal, with these options set:

email=
instance=quit
partial=nocheck
runlevel=nocheck
idepend=nocheck
rdepend=nocheck
space=nocheck
setuid=nocheck
conflict=nocheck
action=nocheck
basedir=default

You can override any of these options in two ways. First you can optionally pass any of the options as a kwarg to the module/state to override the default value or you can optionally pass the 'admin_source' option providing your own adminfile to the minions.

Note: You can find all of the possible options to provide to the adminfile by reading the admin man page:

man -s 4 admin

CLI Example:

salt '*' pkg.remove <package name>
salt '*' pkg.remove SUNWgit
salt.modules.solarispkg.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.solaris_group

Next topic

salt.modules.solaris_shadow