Version information
This version is compatible with:
- Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x
- Puppet >= 6.0.0 < 8.0.0
- , , ,
Start using this module
Add this module to your Puppetfile:
mod 'fraenki-activemq', '1.2.0'
Learn more about managing modules with a PuppetfileDocumentation
puppet-activemq
Table of Contents
Overview
A puppet module to install and configure ActiveMQ Artemis.
PLEASE NOTE: Legacy ActiveMQ is NOT supported by this module.
Requirements
A working Java installation is required (puppetlabs-java is highly recommended). The module is designed for Hiera, so there may be some rough edges when used without Hiera.
Usage
Basic usage
The minimum configuration should at least specify the admin password, the desired version and the checksum of the distribution archive. The checksum is available from ActiveMQ's download page.
class { 'java': }
class { 'activemq':
admin_password => 'seCReT'
admin_user => 'admin'
checksum => '84b5a65d8eb2fc8cf3f17df524d586b0c6a2acfa9a09089d5ffdfc1323ff99dfdc775b2e95eec264cfeddc4742839ba9b0f3269351a5c955dd4bbf6d5ec5dfa9',
version => '2.14.0',
}
This will install and configure a standalone instance of ActiveMQ Artemis.
Multiple instances
Multiple instances can be setup like this:
$instances = {
'instance1' => {
bind => '127.0.0.1',
port => 61616,
web_port => 8161,
acceptors => {
artemis => { port => 61616 },
amqp => { port => 5672 },
},
},
'instance2' => {
bind => '127.0.0.1',
port => 62616,
web_port => 8261,
acceptors => {
artemis => { port => 62616 },
amqp => { port => 5772 },
},
},
'instance3' => {
bind => '127.0.0.1',
port => 63616,
web_port => 8361,
acceptors => {
artemis => { port => 63616 },
amqp => { port => 5872 },
},
}
}
class { 'java': }
class { 'activemq':
checksum => '84b5a65d8eb2fc8cf3f17df524d586b0c6a2acfa9a09089d5ffdfc1323ff99dfdc775b2e95eec264cfeddc4742839ba9b0f3269351a5c955dd4bbf6d5ec5dfa9',
instances => $instances,
version => '2.14.0',
}
Note that you need to modify the port numbers for each instance when running on the same host (as demonstrated in this example), so that they do not try to bind on the same IP:PORT combination.
Instead of using the $instances
parameter, the defined type can also be used directly:
activemq::instance { 'test1':
bind => $facts['networking']['ip'],
port => 61616,
}
Clusters
Complex cluster configurations are also supported. You should provide a complete $cluster_topology
on every node. Use target_host
to let the module automatically setup the instances on the correct servers. For example:
$cluster_topology = {
'node1' => {
target_host => 'server1.example.com',
bind => '10.0.0.1',
group => 'green'
},
'node2' => {
target_host => 'server3.example.com',
bind => '10.0.0.2',
group => 'green',
role => 'slave'
},
'node3' => {
target_host => 'server2.example.com',
bind => '10.0.0.3',
group => 'yellow'
},
'node4' => {
target_host => 'server1.example.com',
bind => '10.0.0.4',
group => 'yellow',
role => 'slave'
},
'node5' => {
target_host => 'server3.example.com',
bind => '10.0.0.5',
group => 'white'
},
'node6' => {
target_host => 'server2.example.com',
bind => '10.0.0.6',
group => 'white',
role => 'slave'
},
}
class { 'java': }
class { 'activemq':
checksum => '84b5a65d8eb2fc8cf3f17df524d586b0c6a2acfa9a09089d5ffdfc1323ff99dfdc775b2e95eec264cfeddc4742839ba9b0f3269351a5c955dd4bbf6d5ec5dfa9',
cluster => true,
cluster_name => 'cluster001',
cluster_password => 'seCReT'
cluster_user => 'clusteradmin'
cluster_topology => $cluster_topology,
instances => $cluster_topology,
server_discovery => 'static',
version => '2.14.0',
}
Note that the parameters $cluster_topology
and $instances
both use the same values. If this configuration is used on host server1.example.com
, then the module ensures that only instances node1
and node4
are installed, all other instances are ignored and will be installed only on the specified target host.
Also note that this examples assumes that each instance is running on it's own IP address. If multiple instances share the same IP address you need to change the port numbers to avoid conflicts (see "Multiple instances").
The $cluster_topology
parameter is also used by the module to setup communication between cluster nodes (depending on your configuration).
Security, Roles, Users and Queues
The instance configuration can be changed by using the required parameter or by modifying $activemq::instance_defaults
(which will apply to all instances). The module data contains pretty verbose examples on how to configure queues, roles and users. Please open a GitHub issue if these examples require further explanation.
Custom configuration
The module should provide a sane default configuration for many use-cases, but overriding these values for all instances is pretty easy:
class { 'activemq':
instance_defaults => {
acceptors => {
artemis => {
enable => false,
},
stomp => {
enable => true,
},
},
acceptor_settings => [
'tcpSendBufferSize=1048576',
],
allow_failback => false,
check_for_live_server => false,
max_hops => 2,
},
}
Please have a look at the examples in the module data to find all supported settings.
The module is designed for Hiera so it is highly recommended if you need to change the default configuration.
Reference
Classes and parameters are documented in REFERENCE.md.
Limitations
Upgrades of ActiveMQ Artemis are currently not supported, but this feature is planned for a later release of this module.
Development
Contributing
Please use the GitHub issues functionality to report any bugs or requests for new features. Feel free to fork and submit pull requests for potential contributions.
All contributions must pass all existing tests, new features should provide additional unit/acceptance tests.
Reference
Table of Contents
Classes
Public Classes
activemq
: Install and configure ActiveMQ Artemis
Private Classes
activemq::install
: Install ActiveMQ distribution archiveactivemq::service
: Setup ActiveMQ multi-instance system service
Defined types
activemq::instance
: Create an instance of ActiveMQ Artemis broker
Classes
activemq
Install and configure ActiveMQ Artemis
Parameters
The following parameters are available in the activemq
class.
admin_password
Data type: String
Specifies the password to use for standalone instances.
admin_user
Data type: String
Specifies the name of the user to use for standalone instances.
checksum
Data type: Optional[String]
Specifies the checksum for the distribution archive, which will be verified after downloading the file and before starting the installation.
Default value: undef
checksum_type
Data type: Optional[String]
Specifies the type of the checksum. Defaults to sha512
.
Default value: undef
cluster
Data type: Boolean
Whether to setup a cluster or a standalone instance.
cluster_name
Data type: Optional[String]
Specifies the name to use for the cluster.
Default value: undef
cluster_password
Data type: String
Specifies the password to use for clustered instances.
cluster_user
Data type: String
Specifies the name of the user to use for clustered instances.
cluster_topology
Data type: Hash[String[1], Hash]
The topology of the cluster, which should contain ALL instances across the whole cluster (not only local instances), their settings and relationships.
distribution_name
Data type: String
Specifies the name of the distribution, which is usually used to build the actual download URL.
download_url
Data type: String
Specifies the download location. It should contain a %s
string which
is automatically replaced with the actual filename during installation.
The latter makes it easier to use mirror redirection URLs.
gid
Data type: Optional[Integer]
Specifies an optional GID that should be used when creating the group.
Default value: undef
group
Data type: String
Specifies the name of the group to use for the service/instance.
install_base
Data type: Stdlib::Compat::Absolute_path
Specifies the installation directory. This directory must already exist. A subdirectory for every version is automatically created.
instance_defaults
Data type: Hash
The default parameters for all instances. They are merged with all instance-specific parameters. This makes it obsolete to specify ALL required parameters for every instance, but only parameters that differ from these defaults.
instances
Data type: Hash[String[1], Hash]
A list of instances that should be created.
instances_base
Data type: Stdlib::Compat::Absolute_path
Specifies the directory where broker instances should be installed. This directory must already exist. A subdirectory for every instance is automatically created.
manage_account
Data type: Boolean
Whether or not to create the user and group.
manage_instances_base
Data type: Boolean
Whether or not to create the directory specified in $instances_base
.
manage_roles
Data type: Boolean
Whether or not to manage ActiveMQ roles.
manage_users
Data type: Boolean
Whether or not to manage ActiveMQ users.
port
Data type: Integer
Specifies the port to use for the artemis connector and will also be used as default port for the acceptor.
server_discovery
Data type: Enum['dynamic','static']
Controls how servers can propagate their connection details.
service_enable
Data type: Boolean
Specifies whether the service should be enabled.
service_ensure
Data type: Enum['running','stopped']
Specifies the desired state for the service.
service_file
Data type: Stdlib::Compat::Absolute_path
Specifies the filename of the service file.
service_name
Data type: String
Controls the name of the system service. Must NOT be changed while instances are running.
symlink_name
Data type: String
Controls the name of a version-independent symlink. It will always point
to the release specified by $version
.
uid
Data type: Optional[Integer]
Specifies an optional UID that should be used when creating the user.
Default value: undef
user
Data type: String
Specifies the name of the user to use for the service/instance.
version
Data type: String
Specifies the version of ActiveMQ (Artemis) to install and use. No default value is provided on purpose, to avoid prevent new users from using a outdated version and to avoid unexpected updates by later changing the default value.
bootstrap_template
Data type: String
broker_template
Data type: String
logging_template
Data type: String
login_template
Data type: String
roles_properties_template
Data type: String
service_template
Data type: String
users_properties_template
Data type: String
Defined types
activemq::instance
Create an instance of ActiveMQ Artemis broker
Parameters
The following parameters are available in the activemq::instance
defined type.
address_settings
Data type: Hash[String[1], Hash]
A hash containing global address settings. This is especially useful for wildcard/catch all matches.
addresses
Data type: Hash[String[1], Hash]
A hash containing configuration for addresses (messaging endpoints), queues and routing types.
bind
Data type: String
Configure which IP address to listen on. Should be either a FQDN or an IP address.
broker_plugins
Data type: Hash[String[1], Hash]
A hash containing a list of broker plugins and their configuration.
Each plugin can be enabled by setting enable
to true
.
log_level
Data type: Hash
The log levels to use for the various configured loggers.
security
Data type: Hash
A hash containing the security configuration, includes users and roles.
service_enable
Data type: Optional[Boolean]
Specifies whether the service should be enabled for this instance.
Default value: undef
service_ensure
Data type: Optional[Enum['running','stopped']]
Specifies the desired service state for this instance.
Default value: undef
target_host
Data type: Optional[String]
Specifies the target host where this instance should be installed.
The value will be matched against $facts['networking']['fqdn']
.
This is especially useful for cluster configurations.
Default value: undef
web_bind
Data type: String
The host name to use for embedded web server.
web_port
Data type: Integer
The port to use for embedded web server.
acceptors
Data type: Hash[String[1], Hash]
acceptor_settings
Data type: Array
allow_failback
Data type: Boolean
broadcast_groups
Data type: Array
check_for_live_server
Data type: Boolean
connectors
Data type: Hash[String[1], Hash]
discovery_groups
Data type: Array
failover_on_shutdown
Data type: Boolean
ha_policy
Data type: Enum['live-only','replication','shared-storage']
initial_replication_sync_timeout
Data type: Integer
journal_buffer_timeout
Data type: Integer
journal_datasync
Data type: Boolean
journal_max_io
Data type: Integer
journal_type
Data type: Enum['asyncio','mapped','nio']
max_disk_usage
Data type: Integer
max_hops
Data type: Integer
message_load_balancing
Data type: Enum['off','strict','on_demand']
persistence
Data type: Boolean
port
Data type: Integer
role
Data type: Enum['master','slave']
vote_on_replication_failure
Data type: Boolean
global_max_size_mb
Data type: Optional[Integer]
Default value: undef
group
Data type: Optional[String]
Default value: undef
Changelog
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
[v1.2.0] - 2021-09-02
Added
- Add possibility to setup connectors for the Artemis Management API
v1.1.0 - 2021-08-31
Added
- Let Puppet maintain
management.xml
(existing config will be overwritten) - Add new parameter
$hawtio_role
to manage HAWTIO_ROLE in artemis.profile
Changed
- Update to PDK 2.2.0
- Update dependency and Puppet version requirements
v1.0.0 - 2020-10-06
Initial release
Dependencies
- puppetlabs-stdlib (>= 4.25.0 <9.0.0)
- puppet/archive (>= 4.0.0 < 7.0.0)
Copyright (C) 2020 Frank Wall All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.