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.
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,
}
}
}
|