Defined Type: db2_install::fixpack

Defined in:
manifests/fixpack.pp

Summary

The defined type `db2_install::fixoack` allows you to install specified fixpacks on your system.

Overview

db2_install::fixpack

The fixpacks will be added on top of your software installation managed by [‘db2_install::software`](./software).

The simples way to use it is:

“‘ puppet db2_install::fixpack Fixpack 11.5.7 on /opt/ibm/db2/V11.5’:

version   => '11.5.7',
location  => '/opt/ibm/db2/V11.5',
file_name => 'v11.5.7_linuxx64_universal_fixpack.tar.gz',

“‘

Based on this puppet code, Puppet will install DB2 fixpack 11.5.7. In the lcation ‘/opt/ibm/db2/V11.5`.

See the file “LICENSE” for the full license governing this code.

Parameters:

  • temp_dir (Stdlib::Absolutepath) (defaults to: '/tmp')

    This defined type uses a temporary directory. By default this is ‘tmp`. If you want to use an other directory for this, you must specify this parameter. Here is an example on how to use this:

    class { '::db2_install::...':
      ...
      temp_dir => '/my_tmp_dir',
      ...
    }
    

    On systems with a secured ‘/tmp` direcory, you MUST specify the `tmp_dir` parameter and specify a directory that puppet is allowed to execute scripts from. It must also have enough space to receive the extracted MQ installation kit.

  • version (String[1])

    The version to be installed. Here is an example on how to use this:

    class { '::db2_install::software':
      ...
      version => '11.0.0.0',
      ...
    }
    
  • source (String[1])

    The location of the DB2 software. Here is an example on how to use this:

    class { '::db2_install::...':
      ...
      source => '/software',
      ...
    }
    
  • file_name (String[1])

    The file containing the install kit for the DB2 software.

  • location (Stdlib::Absolutepath)

    The locatin where the DB2 sofware is or will be installed.

  • logoutput (Variant[Boolean, Enum['on_failure']]) (defaults to: lookup( { name => 'logoutput', default_value => 'on_failure' }))

    If you want to see the output of the ‘exec` resources in the type, you can set this value to `true`. The default is `on_failure`. Here is an example on how to use this:

    class { '::db2_install::...':
      ...
      logoutput => true,
      ...
    }
    
  • allow_insecure (Boolean) (defaults to: lookup( { name => 'allow_insecure', default_value => false }))

    When set to ‘true` Ignore HTTPS certificate errors (default: false)



71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
# File 'manifests/fixpack.pp', line 71

define db2_install::fixpack (
  String[1]                            $version,
  String[1]                            $source,
  String[1]                            $file_name,
  Stdlib::Absolutepath                 $location,
  Stdlib::Absolutepath                 $temp_dir = '/tmp',
  Variant[Boolean, Enum['on_failure']] $logoutput      = lookup( { name => 'logoutput', default_value => 'on_failure' }),
  Boolean                              $allow_insecure = lookup( { name => 'allow_insecure', default_value => false }),
) {
  db2_install { "fixpack::${title}": ensure => 'present' }

  $version_parts = $version.split('\.')
  $short_version = "${version_parts[0]}.${version_parts[1]}"
  $requested_fixpack = $version_parts[2]

  $installed_short_version = $facts.dig('db2_install_locations','product_version', $location, 'short_version')
  $installed_fixpack = $facts.dig('db2_install_locations','product_version', $location, 'fixpack')

  easy_type::debug_evaluation() # Show local variable on extended debug

  if $installed_short_version != undef and $installed_short_version != $short_version {
    fail "A fixpack for version ${version}, can not be applied on version ${installed_short_version}"
  }

  if $requested_fixpack != String($installed_fixpack) {
    db2_install::private::install_fixpack { $title:
      temp_dir  => $temp_dir,
      version   => $version,
      source    => $source,
      location  => $location,
      file_name => $file_name,
    }
  }
}