Add external listener, connector and address configuration

Change-Id: Iffdda83411ff508dc07540ea437e2ccb1f06e8c6
This commit is contained in:
John Eckersberg 2017-03-16 14:40:26 -04:00 committed by Andrew Smith
parent 92604b8c2b
commit 359729340b
3 changed files with 48 additions and 1 deletions

View File

@ -4,6 +4,10 @@
#
# === Parameters
#
# [*connectors*]
# (optional) An array of hashes containing connector configuration
# Defaults to []
#
# [*ensure_package*]
# (optional) The state of the qdr packages
# Defaults to 'installed'
@ -16,6 +20,10 @@
# (optional) The administrative status of the qdr service
# Defaults to 'true'
#
# [*extra_listeners*]
# (optional) An array of hashes containing extra listener configuration
# Defaults to []
#
# [*listener_addr*]
# (optional) Service host name
# Defaults to '127.0.0.1'
@ -73,6 +81,10 @@
# (optional) Path to file containing trusted certificates
# Defaults to 'UNSET'
#
# [*extra_addresses*]
# (optional) An array of hashes containing extra address configuration
# Defaults to []
#
# [*log_module*]
# (optional) The log module to configure
# Defaults to 'DEFAULT'
@ -130,9 +142,11 @@
# Defaults to $::processorcount
#
class qdr(
$connectors = [],
$ensure_package = 'installed',
$ensure_service = 'running',
$enable_service = true,
$extra_listeners = [],
$listener_addr = '127.0.0.1',
$listener_auth_peer = 'no',
$listener_idle_timeout = '16',
@ -147,6 +161,7 @@ class qdr(
$listener_ssl_pw_file = undef,
$listener_ssl_password = undef,
$listener_trusted_certs = 'UNSET',
$extra_addresses = [],
$log_enable = 'debug+',
$log_module = 'DEFAULT',
$log_output = '/var/log/qdrouterd.log',

View File

@ -69,6 +69,7 @@ describe 'qdr' do
should contain_file('qdrouterd.conf').with_content(/authenticatePeer: no/)
should contain_file('qdrouterd.conf').with_content(/saslMechanisms: ANONYMOUS/)
should contain_file('qdrouterd.conf').without_content(/sslProfile {/)
should contain_file('qdrouterd.conf').without_content(/connector {/)
end
end
@ -81,7 +82,10 @@ describe 'qdr' do
:listener_addr => '10.1.1.1',
:listener_port => '5671',
:listener_auth_peer => 'yes',
:listener_sasl_mech => 'ANONYMOUS DIGEST-MD5 EXTERNAL PLAIN'
:listener_sasl_mech => 'ANONYMOUS DIGEST-MD5 EXTERNAL PLAIN',
:connectors => [{'role' => 'inter-router'}],
:extra_listeners => [{'mode' => 'interior'}],
:extra_addresses => [{'prefix' => 'exclusive'}]
}
end
@ -91,6 +95,9 @@ describe 'qdr' do
should contain_file('qdrouterd.conf').with_content(/port: 5671/)
should contain_file('qdrouterd.conf').with_content(/authenticatePeer: yes/)
should contain_file('qdrouterd.conf').with_content(/saslMechanisms: ANONYMOUS DIGEST-MD5 EXTERNAL PLAIN/)
should contain_file('qdrouterd.conf').with_content(/role: inter-router/)
should contain_file('qdrouterd.conf').with_content(/mode: interior/)
should contain_file('qdrouterd.conf').with_content(/prefix: exclusive/)
end
end

View File

@ -48,6 +48,22 @@ listener {
saslMechanisms: <%= @listener_sasl_mech %>
}
<%- @extra_listeners.each do |listener| -%>
listener {
<%- listener.each do |k,v| -%>
<%= k %>: <%= v %>
<%- end -%>
}
<%- end -%>
<%- @connectors.each do |connector| -%>
connector {
<%- connector.each do |k,v| -%>
<%= k %>: <%= v %>
<%- end -%>
}
<%- end -%>
address {
prefix: unicast
distribution: closest
@ -63,6 +79,15 @@ address {
distribution: multicast
}
<%- @extra_addresses.each do |address| -%>
address {
<%- address.each do |k,v| -%>
<%= k %>: <%= v %>
<%- end -%>
}
<%- end -%>
log {
module: <%= @log_module %>
enable: <%= @log_enable %>