Skip to content

Commit

Permalink
postgres_exporter: Move hiera data to class
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 26, 2023
1 parent 95206e0 commit f2140f3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 20 deletions.
20 changes: 20 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9029,6 +9029,8 @@ Data type: `String`

Extension for the release binary archive

Default value: `'tar.gz'`

##### <a name="-prometheus--postgres_exporter--download_url"></a>`download_url`

Data type: `Optional[Prometheus::Uri]`
Expand All @@ -9043,18 +9045,24 @@ Data type: `Prometheus::Uri`

Base URL for the binary archive

Default value: `'https://github.com/prometheus-community/postgres_exporter/releases'`

##### <a name="-prometheus--postgres_exporter--extra_groups"></a>`extra_groups`

Data type: `Array[String[1]]`

Extra groups to add the binary user to

Default value: `[]`

##### <a name="-prometheus--postgres_exporter--group"></a>`group`

Data type: `String[1]`

Group under which the binary is running

Default value: `'postgres-exporter'`

##### <a name="-prometheus--postgres_exporter--init_style"></a>`init_style`

Data type: `Prometheus::Initstyle`
Expand Down Expand Up @@ -9109,12 +9117,16 @@ Data type: `String[1]`

If package, then use this for package ensure default 'latest'

Default value: `'latest'`

##### <a name="-prometheus--postgres_exporter--package_name"></a>`package_name`

Data type: `String[1]`

The binary package name - not available yet

Default value: `'postgres_exporter'`

##### <a name="-prometheus--postgres_exporter--purge_config_dir"></a>`purge_config_dir`

Data type: `Boolean`
Expand Down Expand Up @@ -9161,12 +9173,16 @@ Data type: `String[1]`

User which runs the service

Default value: `'postgres-exporter'`

##### <a name="-prometheus--postgres_exporter--version"></a>`version`

Data type: `String[1]`

The binary release version

Default value: `'0.5.1'`

##### <a name="-prometheus--postgres_exporter--postgres_user"></a>`postgres_user`

Data type: `Optional[String]`
Expand All @@ -9191,12 +9207,16 @@ method for presenting username and password to the exporter
This can be file, or env (default 'env')
Using 'custom' requires 'data_source_custom' values

Default value: `'env'`

##### <a name="-prometheus--postgres_exporter--data_source_uri"></a>`data_source_uri`

Data type: `String[1]`

Uri on howto connect to the database

Default value: `'host=/var/run/postgresql/ sslmode=disable'`

##### <a name="-prometheus--postgres_exporter--proxy_server"></a>`proxy_server`

Data type: `Optional[String[1]]`
Expand Down
10 changes: 0 additions & 10 deletions data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,4 @@ prometheus::blackbox_exporter::package_name: 'blackbox_exporter'
prometheus::blackbox_exporter::modules: {}
prometheus::blackbox_exporter::config_file: '/etc/blackbox-exporter.yaml'
prometheus::blackbox_exporter::version: '0.17.0'
prometheus::postgres_exporter::data_source_uri: 'host=/var/run/postgresql/ sslmode=disable'
prometheus::postgres_exporter::download_extension: 'tar.gz'
prometheus::postgres_exporter::download_url_base: 'https://github.com/prometheus-community/postgres_exporter/releases'
prometheus::postgres_exporter::extra_groups: []
prometheus::postgres_exporter::group: 'postgres-exporter'
prometheus::postgres_exporter::package_ensure: 'latest'
prometheus::postgres_exporter::package_name: 'postgres_exporter'
prometheus::postgres_exporter::postgres_auth_method: 'env'
prometheus::postgres_exporter::user: 'postgres-exporter'
prometheus::postgres_exporter::version: '0.5.1'
prometheus::user: 'prometheus'
20 changes: 10 additions & 10 deletions manifests/postgres_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,16 @@
# @param proxy_type
# Optional proxy server type (none|http|https|ftp)
class prometheus::postgres_exporter (
String $download_extension,
Prometheus::Uri $download_url_base,
Array[String[1]] $extra_groups,
String[1] $group,
String[1] $package_ensure,
String[1] $package_name,
String[1] $user,
String[1] $version,
String[1] $data_source_uri,
Enum['custom', 'env', 'file'] $postgres_auth_method,
String $download_extension = 'tar.gz',
Prometheus::Uri $download_url_base = 'https://github.com/prometheus-community/postgres_exporter/releases',
Array[String[1]] $extra_groups = [],
String[1] $group = 'postgres-exporter',
String[1] $package_ensure = 'latest',
String[1] $package_name = 'postgres_exporter',
String[1] $user = 'postgres-exporter',
String[1] $version = '0.5.1',
String[1] $data_source_uri = 'host=/var/run/postgresql/ sslmode=disable',
Enum['custom', 'env', 'file'] $postgres_auth_method = 'env',
Hash[String[1],String[1]] $data_source_custom = {},
Boolean $purge_config_dir = true,
Boolean $restart_on_change = true,
Expand Down

0 comments on commit f2140f3

Please sign in to comment.