Puppet Class: mq_install::software
- Defined in:
- manifests/software.pp
Summary
This class install's specified version of the the MQ software on the system.Overview
mq_install::software
The source zip file from IBM is found at the location specified at ‘source_location`. By default it will install only the minimal required set. By using the `install_…` parameters, you can install optional components.
Here is an example on how to use it:
“‘ puppet class { ’::mq_install::software’:
source_location => '/software',
version => '9.0.0.0'
tmp_dir => '/tmp'
install_ams => true,
install_ft => false,
install_client => false,
install_explorer => true,
install_xrserver => false,
install_samples => false,
install_sdk => false,
install_man => false,
install_gskit => false,
install_amqp => false,
logoutput => 'true,
} “‘
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.
## MQ Upgrade
When you specify a version where either the major or the minor version is higher than the currently installed version, Puppet will detect this and start the upgrade scenario. The upgrade scenario consists of:
1) Shutting down all running queue managers 2) Uninstalling current MQ version packages, including any installed fixpacks 3) Installing the requested version
WARNING The ‘mq_install::software` class does not automaticaly restart the queue managers again. In general, this is taken care of by `mq_install::autostart`. If `mq_install::autostart` is not part of your manifest you must ensure your own steps to make sure the queue managers are restarted again. ## MQ Downgrade
When you specify a version where either the major or the minor version is lower then the currently installed version, Puppet will detect this. Unfortunately, MQ does not support this without manually restoring some files. Therefore Puppet will give you an error.
See the file “LICENSE” for the full license governing this code.
275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 |
# File 'manifests/software.pp', line 275
class mq_install::software (
Hash $supported_components, # List of supported components and package names
Array[String[1]] $supported_major_versions, # List of major versions supported
String[1] $source_location,
Pattern[/\d+\.\d+\.\d+\.\d/] $version, # Version of the MQ software to install
String[1] $service_window = 'INSTALL_ONLY', # If needed the service window to apply or maybe value 'INSTALL_ONLY' or 'DIRECT'
String[1] $tmp_dir = '/tmp', # Directory used for unpacking
Boolean $install_ams = false, # Install AMS packages
Boolean $install_ft = false, # Install FT packages
Boolean $install_client = false, # Install Client packages
Boolean $install_explorer = false, # Install Explorer packages
Boolean $install_xrserver = false, # Install XRServer packages
Boolean $install_samples = false, # Install Samples packages
Boolean $install_sdk = false, # Install SDK packages
Boolean $install_man = false, # Install man packages
Boolean $install_gskit = false, # Install GSKit packages
Boolean $install_amqp = false, # Install AMQP packages
Boolean $install_web = false, # REST API and Console
Boolean $install_salesforce = false, # IBM MQ Bridge to Salesforce
Boolean $install_blockchain = false, # IBM MQ Bridge to blockchain
Boolean $install_rdqm = false, # replicated data queue manage
Boolean $install_toolkit = false, # Install Development Toolkit packages
Variant[Enum['on_failure'], Boolean] $logoutput = 'on_failure', # Output of the execs
Optional[String[1]] $file_name = undef, # file name of sw kit
) {
#
# We support applying an update only in a specific service window. We also have two other options:
#
# 'INSTALL_ONLY' -> Only apply this class when the MQ software is not (yet) installed. This ensures
# an initial install always installes the latest specified version
#
# 'DIRECT' -> When puppet deteects an update is needed it applies it directly. This is handy
# when we apply this class from bolt or for test systems.
#
# When the value is none of the predefined values, we use it to create a schedule.
#
case $service_window {
'INSTALL_ONLY': {
# No need to create a schedule. We detect this while installing
}
'WHEN_NOT_RUNNING': {
# No need to create a schedule. We detect this while installing
}
'DIRECT': {
# This will always trigger except in 1 second before midnight. This is our best try for DIRECT.
schedule { 'MQ_SOFTWARE_SERVICE_WINDOW':
range => '00:00 - 23:59:59',
}
echo { 'When a software updates is detected, it will take place directly without any schedule': withpath => false }
}
default : {
schedule { 'MQ_SOFTWARE_SERVICE_WINDOW':
range => $service_window,
}
echo { "When a software update is detected, it will take place between ${service_window}": withpath => false }
}
}
mq_install::validate_selection($supported_components,
$install_ams,
$install_ft,
$install_client,
$install_explorer,
$install_xrserver,
$install_samples,
$install_sdk,
$install_man,
$install_gskit,
$install_amqp,
$install_web,
$install_salesforce,
$install_blockchain,
$install_rdqm,
$install_toolkit
)
$selected_components = mq_install::selected_components($version, $supported_components,
$install_ams,
$install_ft,
$install_client,
$install_explorer,
$install_xrserver,
$install_samples,
$install_sdk,
$install_man,
$install_gskit,
$install_amqp,
$install_web,
$install_salesforce,
$install_blockchain,
$install_rdqm,
$install_toolkit)
$version_components = $version.split('\.')
#
# On the package version the last number is separated by an dash
#
$major_version = $version_components[0]
$package_version = "${version_components[0]}.${version_components[1]}.${version_components[2]}-${version_components[3]}"
unless $major_version in $supported_major_versions {
fail "MQ major version ${major_version} not (yet) supported. Only versions ${supported_major_versions.join(',')} supported."
}
if $facts['kernel'] == 'Linux' and $file_name == undef {
case $major_version {
'8': { $actual_file_name = "WS_MQ_V${version}_LINUX_ON_X86_64_IM.tar.gz" }
'9': { $actual_file_name = "IBM_MQ_${version}_LINUX_X86-64.tar.gz" }
default: { fail 'internal error. Unknown major version found.' }
}
} else {
$actual_file_name = $file_name
}
if $facts['kernel'] == 'windows' {
$implementation = 'mq_install::software::windows'
} else { # For All unix like kernels
$implementation = 'mq_install::software::unix'
}
create_resources($implementation, {
"mq_installation_${version}" => {
source_location => $source_location,
file_name => $actual_file_name,
version => $version,
tmp_dir => $tmp_dir,
selected_components => $selected_components,
service_window => $service_window,
logoutput => $logoutput,
}
}
)
}
|