community.general.svr4pkg module – Manage Solaris SVR4 packages

Note

This module is part of the community.general collection (version 9.5.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.svr4pkg.

Synopsis

  • Manages SVR4 packages on Solaris 10 and 11.

  • These were the native packages on Solaris <= 10 and are available as a legacy feature in Solaris 11.

  • Note that this is a very basic packaging system. It will not enforce dependencies on install or remove.

Parameters

Parameter

Comments

category

boolean

Install/Remove category instead of a single package.

Choices:

  • false ← (default)

  • true

name

string / required

Package name, for example SUNWcsr.

proxy

string

HTTP[s] proxy to be used if src is a URL.

response_file

string

Specifies the location of a response file to be used if package expects input on install.

src

string

Specifies the location to install the package from. Required when state=present.

Can be any path acceptable to the pkgadd command’s -d option. For example: somefile.pkg, /dir/with/pkgs, http:/server/mypkgs.pkg.

If using a file or directory, they must already be accessible by the host. See the ansible.builtin.copy module for a way to get them there.

state

string / required

Whether to install (present), or remove (absent) a package.

If the package is to be installed, then src is required.

The SVR4 package system doesn’t provide an upgrade operation. You need to uninstall the old, then install the new package.

Choices:

  • "present"

  • "absent"

zone

string

Whether to install the package only in the current zone, or install it into all zones.

The installation into all zones works only if you are working with the global zone.

Choices:

  • "current"

  • "all" ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: full

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: Install a package from an already copied file
  community.general.svr4pkg:
    name: CSWcommon
    src: /tmp/cswpkgs.pkg
    state: present

- name: Install a package directly from an http site
  community.general.svr4pkg:
    name: CSWpkgutil
    src: 'http://get.opencsw.org/now'
    state: present
    zone: current

- name: Install a package with a response file
  community.general.svr4pkg:
    name: CSWggrep
    src: /tmp/third-party.pkg
    response_file: /tmp/ggrep.response
    state: present

- name: Ensure that a package is not installed
  community.general.svr4pkg:
    name: SUNWgnome-sound-recorder
    state: absent

- name: Ensure that a category is not installed
  community.general.svr4pkg:
    name: FIREFOX
    state: absent
    category: true

Authors

  • Boyd Adamson (@brontitall)