Defined Type: websphere::package

Defined in:
manifests/package.pp

Overview

Defined type to manage IBM packages and ownership

Parameters:

  • version (Any) (defaults to: undef)
  • repository (Any) (defaults to: undef)
  • target (Any) (defaults to: undef)
  • response (Any) (defaults to: undef)
  • ensure (Any) (defaults to: 'present')
  • package (Any) (defaults to: $title)
  • imcl_path (Any) (defaults to: undef)
  • options (Any) (defaults to: undef)
  • chown (Any) (defaults to: true)
  • user (Any) (defaults to: $::websphere::user)
  • group (Any) (defaults to: $::websphere::group)


2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'manifests/package.pp', line 2

define websphere::package (
  $version    = undef,
  $repository = undef,
  $target     = undef,
  $response   = undef,
  $ensure     = 'present',
  $package    = $title,
  $imcl_path  = undef,
  $options    = undef,
  $chown      = true,
  $user       = $::websphere::user,
  $group      = $::websphere::group,
) {

  # If no response file is provided, we need a package version, name,
  # repository, and target.  Otherwise, a response file can potentially include
  # those values.
  if ! $response {

    if !$package or !$version or !$repository or !$target {
      fail('package_name, package_version, target and repository are required
      when a response file is not provided.')
    }

    validate_absolute_path($repository)

    # The imcl path is optional.  We do our best to autodiscover it, but
    # this can be used if all else fails (or if preferences vary).
    if $imcl_path {
      validate_absolute_path($imcl_path)
    }

  } else {
    validate_absolute_path($response)
  }

  ibm_pkg { $title:
    ensure     => $ensure,
    package    => $package,
    version    => $version,
    repository => $repository,
    target     => $target,
    response   => $response,
    imcl_path  => $imcl_path,
    options    => $options,
  }

  if $chown {
    websphere::ownership { "pkg_${title}":
      user      => $user,
      group     => $group,
      path      => $target,
      subscribe => Ibm_pkg[$title],
    }
  }
}