Skip to content

Commit

Permalink
Merge pull request #675 from voxpupuli/blackbox
Browse files Browse the repository at this point in the history
blackbox_exporter: Move hiera data to class
  • Loading branch information
bastelfreak authored Jun 26, 2023
2 parents 6d523cb + 05a3e83 commit 2106bc3
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 58 deletions.
56 changes: 56 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2515,12 +2515,16 @@ Data type: `Stdlib::Absolutepath`

Absolute path to configuration file (blackbox module definitions)

Default value: `'/etc/blackbox-exporter.yaml'`

##### <a name="-prometheus--blackbox_exporter--download_extension"></a>`download_extension`

Data type: `String`

Extension for the release binary archive

Default value: `'tar.gz'`

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

Data type: `Optional[Prometheus::Uri]`
Expand All @@ -2535,12 +2539,16 @@ Data type: `Prometheus::Uri`

Base URL for the binary archive

Default value: `'https://github.com/prometheus/blackbox_exporter/releases'`

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

Data type: `Array[String]`

Extra groups to add the binary user to

Default value: `[]`

##### <a name="-prometheus--blackbox_exporter--extra_options"></a>`extra_options`

Data type: `Optional[String[1]]`
Expand All @@ -2555,6 +2563,8 @@ Data type: `String[1]`

Group under which the binary is running

Default value: `'blackbox-exporter'`

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

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

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

Default value: `'latest'`

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

Data type: `String[1]`

The binary package name - not available yet

Default value: `'blackbox_exporter'`

##### <a name="-prometheus--blackbox_exporter--restart_on_change"></a>`restart_on_change`

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

User which runs the service

Default value: `'blackbox-exporter'`

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

Data type: `String[1]`

The binary release version

Default value: `'0.17.0'`

##### <a name="-prometheus--blackbox_exporter--config_mode"></a>`config_mode`

Data type: `String[1]`
Expand Down Expand Up @@ -9029,6 +9047,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 +9063,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 +9135,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 +9191,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 +9225,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 Expand Up @@ -10944,12 +10982,16 @@ Data type: `Array[String]`

Array of address of one or more redis nodes. Defaults to redis://localhost:6379

Default value: `['redis://localhost:6379']`

##### <a name="-prometheus--redis_exporter--download_extension"></a>`download_extension`

Data type: `String`

Extension for the release binary archive

Default value: `'tar.gz'`

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

Data type: `Optional[Prometheus::Uri]`
Expand All @@ -10964,12 +11006,16 @@ Data type: `Prometheus::Uri`

Base URL for the binary archive

Default value: `'https://github.com/oliver006/redis_exporter/releases'`

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

Data type: `Array[String]`

Extra groups to add the binary user to

Default value: `[]`

##### <a name="-prometheus--redis_exporter--extra_options"></a>`extra_options`

Data type: `Optional[String[1]]`
Expand All @@ -10986,6 +11032,8 @@ Data type: `String[1]`

Group under which the binary is running

Default value: `'redis-exporter'`

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

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

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

Default value: `'latest'`

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

Data type: `String[1]`

The binary package name - not available yet

Default value: `'redis_exporter'`

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

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

User which runs the service

Default value: `'redis-exporter'`

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

Data type: `String[1]`

The binary release version

Default value: `'1.9.0'`

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

Data type: `Optional[String[1]]`
Expand Down
30 changes: 0 additions & 30 deletions data/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -229,34 +229,4 @@ prometheus::statsd_exporter::service_name: 'statsd_exporter'
prometheus::statsd_exporter::user: 'statsd-exporter'
prometheus::statsd_exporter::version: '0.17.0'
prometheus::storage_retention: '360h' # 15d; "d" suffix is only supported with prom >= 2.*
prometheus::blackbox_exporter::user: 'blackbox-exporter'
prometheus::blackbox_exporter::group: 'blackbox-exporter'
prometheus::blackbox_exporter::download_extension: 'tar.gz'
prometheus::blackbox_exporter::download_url_base: 'https://github.com/prometheus/blackbox_exporter/releases'
prometheus::blackbox_exporter::extra_groups: []
prometheus::blackbox_exporter::package_ensure: 'latest'
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::redis_exporter::addr:
- 'redis://localhost:6379'
prometheus::redis_exporter::download_extension: 'tar.gz'
prometheus::redis_exporter::download_url_base: 'https://github.com/oliver006/redis_exporter/releases'
prometheus::redis_exporter::extra_groups: []
prometheus::redis_exporter::group: 'redis-exporter'
prometheus::redis_exporter::package_ensure: 'latest'
prometheus::redis_exporter::package_name: 'redis_exporter'
prometheus::redis_exporter::user: 'redis-exporter'
prometheus::redis_exporter::version: '1.9.0'
prometheus::user: 'prometheus'
18 changes: 9 additions & 9 deletions manifests/blackbox_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@
# tcp:
# preferred_ip_protocol: ip4
class prometheus::blackbox_exporter (
Stdlib::Absolutepath $config_file,
String $download_extension,
Prometheus::Uri $download_url_base,
Array[String] $extra_groups,
String[1] $group,
String[1] $package_ensure,
String[1] $package_name,
String[1] $user,
String[1] $version,
Stdlib::Absolutepath $config_file = '/etc/blackbox-exporter.yaml',
String $download_extension = 'tar.gz',
Prometheus::Uri $download_url_base = 'https://github.com/prometheus/blackbox_exporter/releases',
Array[String] $extra_groups = [],
String[1] $group = 'blackbox-exporter',
String[1] $package_ensure = 'latest',
String[1] $package_name = 'blackbox_exporter',
String[1] $user = 'blackbox-exporter',
String[1] $version = '0.17.0',
Boolean $restart_on_change = true,
Boolean $service_enable = true,
Stdlib::Ensure::Service $service_ensure = 'running',
Expand Down
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
18 changes: 9 additions & 9 deletions manifests/redis_exporter.pp
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,15 @@
# @param proxy_type
# Optional proxy server type (none|http|https|ftp)
class prometheus::redis_exporter (
Array[String] $addr,
String $download_extension,
Prometheus::Uri $download_url_base,
Array[String] $extra_groups,
String[1] $group,
String[1] $package_ensure,
String[1] $package_name,
String[1] $user,
String[1] $version,
Array[String] $addr = ['redis://localhost:6379'],
String $download_extension = 'tar.gz',
Prometheus::Uri $download_url_base = 'https://github.com/oliver006/redis_exporter/releases',
Array[String] $extra_groups = [],
String[1] $group = 'redis-exporter',
String[1] $package_ensure = 'latest',
String[1] $package_name = 'redis_exporter',
String[1] $user = 'redis-exporter',
String[1] $version = '1.9.0',
Boolean $purge_config_dir = true,
Boolean $restart_on_change = true,
Boolean $service_enable = true,
Expand Down

0 comments on commit 2106bc3

Please sign in to comment.