Browse Source

Merge "Puppet config options for AMQP1 sensubility transport" into stable/train

changes/27/761227/2
Zuul 2 months ago
committed by Gerrit Code Review
parent
commit
1bc10cb03d
2 changed files with 38 additions and 12 deletions
  1. +21
    -2
      manifests/profile/base/metrics/collectd/sensubility.pp
  2. +17
    -10
      templates/metrics/collectd-sensubility.conf.epp

+ 21
- 2
manifests/profile/base/metrics/collectd/sensubility.pp View File

@@ -104,6 +104,19 @@
# (Optional) String. Rule which will be saved in /etc/sudoers.d for user specified
# by parameter exec_user.
# Defaults to undef
#
# [*results_format*]
# (Optional) String. Set message format compatability. Options are
# [smartgateway,sensu]
# Defaults to smartgateway
#
# [*results_channel*]
# String. Target AMQP1 channel address to which messages should be sent
# Defaults to undef
#
# [*transport*]
# String. Bus type for message transport. Options are 'sensu' (rabbitmq) or 'amqp1'
# Defaults to 'sensu'
class tripleo::profile::base::metrics::collectd::sensubility (
$ensure = 'present',
$config_path = '/etc/collectd-sensubility.conf',
@@ -124,7 +137,10 @@ class tripleo::profile::base::metrics::collectd::sensubility (
$amqp_password = undef,
$exec_user = 'collectd',
$exec_group = 'collectd',
$exec_sudo_rule = undef
$exec_sudo_rule = undef,
$results_format = 'smartgateway',
$results_channel = undef,
$transport = 'sensu'
) {
include ::collectd
include ::collectd::plugin::exec
@@ -151,7 +167,10 @@ class tripleo::profile::base::metrics::collectd::sensubility (
amqp_host => $amqp_host,
amqp_port => $amqp_port,
amqp_user => $amqp_user,
amqp_password => $amqp_password
amqp_password => $amqp_password,
results_format => $results_format,
results_channel => $results_channel,
transport => $transport
})
}



+ 17
- 10
templates/metrics/collectd-sensubility.conf.epp View File

@@ -10,9 +10,12 @@
Optional[Integer] $worker_count,
Optional[String] $checks,
Optional[String] $amqp_host,
Optional[String] $amqp_port,
Optional[Integer] $amqp_port,
Optional[String] $amqp_user,
Optional[String] $amqp_password
Optional[String] $amqp_password,
Optional[String] $results_format,
Optional[String] $results_channel,
Variant[Enum['sensu','amqp1']] $transport
| -%>

[default]
@@ -24,6 +27,7 @@ log_level=<%=$log_level%>
<%- } -%>

[sensu]
<% if $transport == 'sensu' { -%>
<% unless $connection =~ Undef { -%>
connection=<%=$connection%>
<%- } -%>
@@ -36,6 +40,7 @@ client_name=<%=$client_name%>
<% unless $client_address =~ Undef { -%>
client_address=<%=$client_address%>
<%- } -%>
<%- } -%>
<% unless $keepalive_interval =~ Undef { -%>
keepalive_interval=<%=$keepalive_interval%>
<%- } -%>
@@ -53,15 +58,17 @@ checks=<%=$checks%>
<%- } -%>

[amqp1]
<% unless $amqp_host =~ Undef { -%>
host=<%=$amqp_host%>
<% if $transport == 'amqp1' { -%>
<% unless $client_address =~ Undef and $amqp_port =~ Undef { -%>
connection=amqp://<%=$client_address%>:<%=$amqp_port%>
<%- } -%>
<% unless $results_channel =~ Undef { -%>
results_channel=<%=$results_channel%>
<%- } -%>
<% unless $amqp_port =~ Undef { -%>
port=<%=$amqp_port%>
<% unless $client_name =~ Undef { -%>
client_name=<%=$client_name%>
<%- } -%>
<% unless $amqp_user =~ Undef { -%>
user=<%=$amqp_user%>
<% unless $results_format =~ Undef { -%>
results_format=<%=$results_format%>
<%- } -%>
<% unless $amqp_password =~ Undef { -%>
password=<%=$amqp_password%>
<%- } -%>

Loading…
Cancel
Save