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.

Parameters:

  • source_location (String[1])

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

    class { '::mq_install::...':
      ...
      source_location => '/software',
      ...
    }
    
  • service_window (String[1]) (defaults to: 'INSTALL_ONLY')

    The service_window Puppet will use to execute a specified upgrade. When Puppet detects a mismatch between the current version and the version in your manifest, it will start to execute an upgrade. But in general, you want some control over when that happens. You don’t want Puppet to stop your queue managers during regular production hours to do the upgrade. The ‘service_window` parameter allows this control. The parameter can have the following values:

    • DIRECT

    • INSTALL_ONLY

    • WHEN_NOT_RUNNING

    • A time range

    ## DIRECT ‘DIRECT` is the normal behavior of Puppet (e.g., not the default of the parameter). When a manifest change is detected, Puppet will immediately execute the upgrade and, in this process, stop the MQ queue managers. ## INSTALL_ONLY This is the default value for this class. In this case, Puppet will use the specified manifest values ONLY on an initial install. When Puppet detects MQ is already running, it will leave it like it is and NOT do the upgrade. You can use, for example, a bolt plan or task to execute the upgrade at a moment that suits your requirements. ## WHEN_NOT_RUNNING Only apply this class when there is no queue manager running. ## time range When you have a specific service window wherein Puppet is allowed to do the MQ shutdown and execute the upgrade procedure, you can specify a time range. An example of a time range would be: ’01:00 - 02:00`

  • version (Pattern[/\d+\.\d+\.\d+\.\d/])

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

    class { '::mq_install::software':
      ...
      version => '9.0.0.0',
      ...
    }
    
  • file_name (Optional[String[1]]) (defaults to: undef)

    The file containing the install kit for the MQ software.

  • tmp_dir (String[1]) (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 { '::mq_install::...':
      ...
      tmp_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.

  • install_ams (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_ams => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed.

  • install_ft (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_ft => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed.

  • install_client (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_client => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed.

  • install_explorer (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_explorer => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed.

  • install_xrserver (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_xserver => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed.

  • install_samples (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_samples => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed. This component can only be installed on Linux systems.

  • install_sdk (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_sdk => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed. This component can only be installed on Linux systems.

  • install_man (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_man => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed. This component can only be installed on Linux systems.

  • install_gskit (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_gskit => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed. This component can only be installed on Linux systems.

  • install_amqp (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_amqp => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed.

  • install_web (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_web => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed.

  • install_salesforce (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install the Bridge to Salesforce component. Here is an example:

    class { '::mq_install::software':
      ...
      install_salesforce => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed. Install this component to configure the connections to Salesforce and IBM MQ, then run the runmqsfb command to subscribe to events from Salesforce and publish them to an IBM MQ network. This component can only be installed on Linux systems.

  • install_blockchain (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install the IBM MQ Bridge to blockchain component. Here is an example:

    class { '::mq_install::software':
      ...
      install_blockchain => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed. Install this component to configure the connections to your blockchain network and IBM MQ. You can then run the runmqbcb command to start the bridge and send queries and updates to, and receive responses from your blockchain network. The queue manager that the bridge connects to must be an IBM MQ Advanced queue manager. This component is available only on Linux for System x (64 bit), on RHEL 7.3 or later and is only supported for MQ 9.1 and higher. This component can only be installed on Linux systems.

  • install_rdqm (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install the replicated data queue manager component. Here is an example:

    class { '::mq_install::software':
      ...
      install_rqdm => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed. Install this component to make the replicated data queue manager high availability configuration available. See Installing RDQM (replicated data queue managers) for more information. This component is available only on Linux for System x (64 bit), on RHEL 7.3 or later and is only supported for MQ 9.1 and higher. This component can only be installed on Linux systems.

  • install_toolkit (Boolean) (defaults to: false)

    Specify a value of ‘true` when you want to install this component. Here is an example:

    class { '::mq_install::software':
      ...
      install_toolkit => true,
      ...
    }
    

    The default is ‘false’. Meaning this component is not installed. This component can only be installed on Windows systems.

  • supported_components (Hash)
  • supported_major_versions (Array[String[1]])

    The major versions of MQ supported by this class.

  • logoutput (Variant[Enum['on_failure'], Boolean]) (defaults to: '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 { '::mq_install::...':
      ...
      logoutput => true,
      ...
    }
    


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