Skip to content

Commit

Permalink
Add manifest for the pgbouncer integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mcasper authored and truthbk committed Apr 11, 2016
1 parent c060a02 commit d19fc1c
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
46 changes: 46 additions & 0 deletions manifests/integrations/pgbouncer.pp
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Class: datadog_agent::integrations::pgbouncer
#
# This class will install the necessary configuration for the pgbouncer integration
#
# Parameters:
# $host:
# The host pgbouncer is listening on
# $port
# The pgbouncer port number
# $username
# The username for the datadog user
# $password
# The password for the datadog user
# $tags
# Optional array of tags
#
# Sample Usage:
#
# class { 'datadog_agent::integrations::pgbouncer' :
# host => 'localhost',
# username => 'datadog',
# port => '6432',
# password => 'some_pass',
# }
#
#
class datadog_agent::integrations::pgbouncer(
$host = 'localhost',
$port = '6432',
$username = 'datadog',
$password,
$tags = [],
) inherits datadog_agent::params {

validate_array($tags)

file { "${datadog_agent::params::conf_dir}/pgbouncer.yaml":
ensure => file,
owner => $datadog_agent::params::dd_user,
group => $datadog_agent::params::dd_group,
mode => '0600',
content => template('datadog_agent/agent-conf.d/pgbouncer.yaml.erb'),
require => Package[$datadog_agent::params::package_name],
notify => Service[$datadog_agent::params::service_name],
}
}
23 changes: 23 additions & 0 deletions templates/agent-conf.d/pgbouncer.yaml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
init_config:

instances:
# - host: localhost
# port: 6432
# username: my_username
# password: my_password
# tags:
# - optional_tag1
# - optional_tag2
#
- host: <%= @host %>
port: <%= @port %>
username: <%= @username %>
password: <%= @password %>
<% if @tags and ! @tags.empty? -%>
tags:
<%- Array(@tags).each do |tag| -%>
<%- if tag != '' -%>
- <%= tag %>
<%- end -%>
<%- end -%>
<% end -%>

0 comments on commit d19fc1c

Please sign in to comment.