-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add manifest for the pgbouncer integration
- Loading branch information
Showing
2 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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], | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 -%> |