Puppet Class: activemq

Defined in:
manifests/init.pp

Overview

Class: activemq

This module manages the ActiveMQ messaging middleware.

Parameters:

Actions:

Requires:

Class['java']

Sample Usage:

node default {

class { 'activemq': }

}

To supply your own configuration file:

node default {

class { 'activemq':
  server_config => template('site/activemq.xml.erb'),
}

}

Parameters:

  • version (Any) (defaults to: 'present')
  • package (Any) (defaults to: 'activemq')
  • ensure (Any) (defaults to: 'running')
  • instance (Any) (defaults to: 'activemq')
  • webconsole (Any) (defaults to: true)
  • server_config (Any) (defaults to: 'UNSET')
  • mq_broker_name (Any) (defaults to: $::fqdn)
  • mq_admin_username (Any) (defaults to: 'admin')
  • mq_admin_password (Any) (defaults to: 'admin')
  • mq_cluster_username (Any) (defaults to: 'amq')
  • mq_cluster_password (Any) (defaults to: 'secret')
  • mq_cluster_brokers (Any) (defaults to: [])


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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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
105
106
107
# File 'manifests/init.pp', line 27

class activemq(
  $version                 = 'present',
  $package                 = 'activemq',
  $ensure                  = 'running',
  $instance                = 'activemq',
  $webconsole              = true,
  $server_config           = 'UNSET',
  $mq_broker_name          = $::fqdn,
  $mq_admin_username       = 'admin',
  $mq_admin_password       = 'admin',
  $mq_cluster_username     = 'amq',
  $mq_cluster_password     = 'secret',
  $mq_cluster_brokers      = [],
) {

  validate_re($ensure, '^running$|^stopped$')
  validate_re($version, '^present$|^latest$|^[~+._0-9a-zA-Z:-]+$')
  validate_bool($webconsole)

  $package_real = $package
  $version_real = $version
  $ensure_real  = $ensure
  $webconsole_real = $webconsole
  $mq_admin_username_real       = $mq_admin_username
  $mq_admin_password_real       = $mq_admin_password
  $mq_cluster_username_real     = $mq_cluster_username
  $mq_cluster_password_real     = $mq_cluster_password
  $mq_cluster_brokers_real      = $mq_cluster_brokers

  if $mq_admin_username_real == 'admin' {
    warning '$mq_admin_username is set to the default value.  This should be changed.'
  }

  if $mq_admin_password_real == 'admin' {
    warning '$mq_admin_password is set to the default value.  This should be changed.'
  }

  if size($mq_cluster_brokers_real) > 0 and $mq_cluster_username_real == 'amq' {
    warning '$mq_cluster_username is set to the default value.  This should be changed.'
  }

  if size($mq_cluster_brokers_real) > 0 and $mq_cluster_password_real == 'secret' {
    warning '$mq_cluster_password is set to the default value.  This should be changed.'
  }

  # Since this is a template, it should come _after_ all variables are set for
  # this class.
  $server_config_real = $server_config ? {
    'UNSET' => template("${module_name}/activemq.xml.erb"),
    default => $server_config,
  }

  # Anchors for containing the implementation class
  anchor { 'activemq::begin':
    before => Class['activemq::packages'],
    notify => Class['activemq::service'],
  }

  class { 'activemq::packages':
    version => $version_real,
    package => $package_real,
    notify  => Class['activemq::service'],
  }

  class { 'activemq::config':
    instance      => $instance,
    package       => $package_real,
    server_config => $server_config_real,
    require       => Class['activemq::packages'],
    notify        => Class['activemq::service'],
  }

  class { 'activemq::service':
    ensure => $ensure_real,
  }

  anchor { 'activemq::end':
    require => Class['activemq::service'],
  }

}