Allow Sensu to connect to RabbitMQ cluster

This patch adds possibility to connect sensu-clients to RabbitMQ cluster
instead of a single RabbitMQ node.

Closes-Bug: #1714910
Change-Id: I291a9ddb888aa2291181715c198f7ba5ca1a6ad4
This commit is contained in:
Martin Mágr 2017-08-18 12:02:03 +02:00
parent 97161236cf
commit 3fd76806e1

View File

@ -29,6 +29,10 @@ parameters:
default: {}
description: Parameters specific to the role
type: json
MonitoringRabbitCluster:
description: RabbitMQ cluster configuration Sensu has to connect to.
type: json
default: []
MonitoringRabbitHost:
description: RabbitMQ host Sensu has to connect to.
type: string
@ -58,6 +62,7 @@ parameters:
description: The RabbitMQ password used for monitoring purposes.
type: string
hidden: true
default: sensu
MonitoringRabbitUserName:
description: The RabbitMQ username used for monitoring purposes.
type: string
@ -80,25 +85,33 @@ parameters:
- private_key
- secret
conditions:
not_cluster_connection:
equals: [{get_param: MonitoringRabbitCluster}, []]
outputs:
role_data:
description: Role data for the Sensu role.
value:
service_name: sensu_base
config_settings:
sensu::enterprise: false
sensu::enterprise_dashboard: false
sensu::install_repo: false
sensu::manage_user: false
sensu::rabbitmq_host: {get_param: MonitoringRabbitHost}
sensu::rabbitmq_password: {get_param: MonitoringRabbitPassword}
sensu::rabbitmq_port: {get_param: MonitoringRabbitPort}
sensu::rabbitmq_ssl: {get_param: MonitoringRabbitUseSSL}
sensu::rabbitmq_ssl_private_key: {get_param: MonitoringRabbitSSLPrivateKey}
sensu::rabbitmq_ssl_cert_chain: {get_param: MonitoringRabbitSSLCertChain}
sensu::rabbitmq_user: {get_param: MonitoringRabbitUserName}
sensu::rabbitmq_vhost: {get_param: MonitoringRabbitVhost}
sensu::redact: {get_param: SensuRedactVariables}
sensu::sensu_plugin_provider: 'yum'
sensu::sensu_plugin_name: 'rubygem-sensu-plugin'
sensu::version: 'present'
map_merge:
- sensu::enterprise: false
sensu::enterprise_dashboard: false
sensu::install_repo: false
sensu::manage_user: false
sensu::redact: {get_param: SensuRedactVariables}
sensu::sensu_plugin_provider: 'yum'
sensu::sensu_plugin_name: 'rubygem-sensu-plugin'
sensu::version: 'present'
- if:
- not_cluster_connection
- sensu::rabbitmq_host: {get_param: MonitoringRabbitHost}
sensu::rabbitmq_port: {get_param: MonitoringRabbitPort}
sensu::rabbitmq_user: {get_param: MonitoringRabbitUserName}
sensu::rabbitmq_password: {get_param: MonitoringRabbitPassword}
sensu::rabbitmq_vhost: {get_param: MonitoringRabbitVhost}
sensu::rabbitmq_ssl: {get_param: MonitoringRabbitUseSSL}
sensu::rabbitmq_ssl_private_key: {get_param: MonitoringRabbitSSLPrivateKey}
sensu::rabbitmq_ssl_cert_chain: {get_param: MonitoringRabbitSSLCertChain}
- sensu::rabbitmq_cluster: {get_param: MonitoringRabbitCluster}