Puppet Class: mq_install::internal::mq_stop

Defined in:
manifests/internal/mq_stop.pp

Summary

This is an internal API.

Overview

mq_install::internal::mq_stop

Please do not use this.

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

Parameters:

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


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
# File 'manifests/internal/mq_stop.pp', line 20

class mq_install::internal::mq_stop (
  Variant[Enum['on_failure'], Boolean] $logoutput = 'on_failure',    # Output of the execs
) {
  easy_type::debug_evaluation() # Show local variable on extended debug

  if defined($caller_module_name) and $caller_module_name != $module_name {
    fail("Use of private class ${name} by ${caller_module_name} not supported.")
  }

  case $facts['kernel'] {
    'Linux', 'SunOS': { $path = '/opt/mqm/bin' }
    'AIX': { $path = '/usr/mqm/bin' }
    default: { fail "Internal error. Unsupported kernel ${facts['kernel']}" }
  }

  #
  # Stop all running MQ managers
  #
  $running_managers = mq_install::running_managers()
  $running_managers.each |$manager| {
    if $facts['os']['family'] == 'RedHat' and Integer($facts['os']['release']['major']) >= 7 {
      $command = "/bin/systemctl stop mq@${manager}"
      $user    = 'root'
    } else {
      $command = "${path}/endmqm -p ${manager}"
      $user    = 'mqm'
    }
    exec { "Stop MQ manager ${manager}":
      user      => $user,
      command   => $command,
      schedule  => 'MQ_SOFTWARE_SERVICE_WINDOW',
      logoutput => $logoutput,
    }
  }
}