Skip to content

Commit

Permalink
fix #460 Rework param data types of icinga2::feature::influxdb
Browse files Browse the repository at this point in the history
  • Loading branch information
lbetz committed Sep 17, 2018
1 parent 36fb3ca commit 37c284c
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 52 deletions.
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1254,42 +1254,40 @@ Enables or disables the `influxdb` feature.
Either `present` or `absent`. Defines if the feature `influxdb` should be enabled. Defaults to `present`.

##### `host`
InfluxDB host address. Defaults to `127.0.0.1`
InfluxDB host address. Icinga defaults to `127.0.0.1`.

##### `port`
InfluxDB HTTP port. Defaults to `8086`
InfluxDB HTTP port. Icinga defaults to `8086`.

##### `database`
InfluxDB database name. Defaults to `icinga2`
InfluxDB database name. Icinga defaults to `icinga2`.

##### `username`
InfluxDB user name. Defaults to `undef`
InfluxDB user name.

##### `password`
InfluxDB user password. Defaults to `undef`
InfluxDB user password.

##### `enable_ssl`
Either enable or disable SSL. Other SSL parameters are only affected if this is set to `true`. Defaults to `false`.
Either enable or disable SSL. Other SSL parameters are only affected if this is set to `true`. Icinga defaults to `false`.

##### `pki`
SSL settings will be set depending on this parameter.

* `puppet` Use puppet certificates. This will copy the ca.pem, certificate and key generated by Puppet.
* `custom` Set custom paths for certificate, key and CA
* `false` Disable SSL (default)
* `none` Set custom paths for certificate, key and CA

##### `ssl_ca_cert`
CA certificate to validate the remote host. Only valid if ssl is set to `custom`. Defaults to `undef`
CA certificate to validate the remote host. Only valid if ssl is set to `none`.

##### `ssl_cert`
Host certificate to present to the remote host for mutual verification. Only valid if ssl is set to 'custom'.
Defaults to `undef`
Host certificate to present to the remote host for mutual verification. Only valid if ssl is set to 'none'.

##### `ssl_key`
Host key to accompany the ssl_cert. Only valid if ssl is set to `custom`. Defaults to `undef`
Host key to accompany the ssl_cert. Only valid if ssl is set to `none`.

##### `host_measurement`
The value of this is used for the measurement setting in host_template. Defaults to `$host.check_command$`
The value of this is used for the measurement setting in host_template. Icinga defaults to `$host.check_command$`.

##### `host_tags`
Tags defined in this hash will be set in the host_template.
Expand All @@ -1302,7 +1300,7 @@ class { '::icinga2::feature::influxdb':
```

##### `service_measurement`
The value of this is used for the measurement setting in host_template. Defaults to `$service.check_command$`
The value of this is used for the measurement setting in host_template. Icinga defaults to `$service.check_command$`.

##### `service_tags`
Tags defined in this hash will be set in the service_template.
Expand All @@ -1315,16 +1313,16 @@ class { '::icinga2::feature::influxdb':
```

##### `enable_send_thresholds`
Whether to send warn, crit, min & max tagged data. Defaults to `false`
Whether to send warn, crit, min & max tagged data. Icinga defaults to `false`.

##### `enable_send_metadata`
Whether to send check metadata e.g. states, execution time, latency etc. Defaults to `false`
Whether to send check metadata e.g. states, execution time, latency etc. Icinga defaults to `false`.

##### `flush_interval`
How long to buffer data points before transferring to InfluxDB. Defaults to `10s`
How long to buffer data points before transferring to InfluxDB. Icinga defaults to `10s`.

##### `flush_threshold`
How many data points to buffer before forcing a transfer to InfluxDB. Defaults to `1024`
How many data points to buffer before forcing a transfer to InfluxDB. Icinga defaults to `1024`.


#### Class: `icinga2::feature::api`
Expand Down
68 changes: 34 additions & 34 deletions manifests/feature/influxdb.pp
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@
# Set to present enables the feature influxdb, absent disables it. Defaults to present.
#
# [*host*]
# InfluxDB host address. Defaults to 127.0.0.1.
# InfluxDB host address. Icinga defaults to 127.0.0.1.
#
# [*port*]
# InfluxDB HTTP port. Defaults to 8086.
# InfluxDB HTTP port. Icinga defaults to 8086.
#
# [*database*]
# InfluxDB database name. Defaults to icinga2.
# InfluxDB database name. Icinga defaults to icinga2.
#
# [*username*]
# InfluxDB user name. Defaults to undef.
# InfluxDB user name.
#
# [*password*]
# InfluxDB user password. Defaults to undef.
# InfluxDB user password.
#
# [*enable_ssl*]
# Either enable or disable SSL. Other SSL parameters are only affected if this is set to 'true'.
# Defaults to 'false'.
# Icinga defaults to 'false'.
#
# [*pki*]
# Provides multiple sources for the certificate, key and ca. Valid parameters are 'puppet' or 'none'.
Expand Down Expand Up @@ -63,28 +63,28 @@
# to path spicified in ssl_cacert_path. This parameter requires pki to be set to 'none'.
#
# [*host_measurement*]
# The value of this is used for the measurement setting in host_template. Defaults to '$host.check_command$'
# The value of this is used for the measurement setting in host_template. Icinga defaults to '$host.check_command$'.
#
# [*host_tags*]
# Tags defined in this hash will be set in the host_template.
#
# [*service_measurement*]
# The value of this is used for the measurement setting in host_template. Defaults to '$service.check_command$'
# The value of this is used for the measurement setting in host_template. Icinga defaults to '$service.check_command$'.
#
# [*service_tags*]
# Tags defined in this hash will be set in the service_template.
#
# [*enable_send_thresholds*]
# Whether to send warn, crit, min & max tagged data. Defaults to false.
# Whether to send warn, crit, min & max tagged data. Icinga defaults to 'false'.
#
# [*enable_send_metadata*]
# Whether to send check metadata e.g. states, execution time, latency etc. Defaults to false.
# Whether to send check metadata e.g. states, execution time, latency etc. Icinga defaults to 'false'.
#
# [*flush_interval*]
# How long to buffer data points before transfering to InfluxDB. Defaults to 10s.
# How long to buffer data points before transfering to InfluxDB. Icinga defaults to '10s'.
#
# [*flush_threshold*]
# How many data points to buffer before forcing a transfer to InfluxDB. Defaults to 1024.
# How many data points to buffer before forcing a transfer to InfluxDB. Icinga defaults to '1024'.
#
# === Example
#
Expand All @@ -97,28 +97,28 @@
#
#
class icinga2::feature::influxdb(
Enum['absent', 'present'] $ensure = present,
String $host = '127.0.0.1',
Integer[1,65535] $port = 8086,
String $database = 'icinga2',
Optional[String] $username = undef,
Optional[String] $password = undef,
Boolean $enable_ssl = false,
Enum['none', 'puppet'] $pki = 'puppet',
Optional[Stdlib::Absolutepath] $ssl_key_path = undef,
Optional[Stdlib::Absolutepath] $ssl_cert_path = undef,
Optional[Stdlib::Absolutepath] $ssl_cacert_path = undef,
Optional[String] $ssl_key = undef,
Optional[String] $ssl_cert = undef,
Optional[String] $ssl_cacert = undef,
String $host_measurement = '$host.check_command$',
Hash $host_tags = { hostname => '$host.name$' },
String $service_measurement = '$service.check_command$',
Hash $service_tags = { hostname => '$host.name$', service => '$service.name$' },
Boolean $enable_send_thresholds = false,
Boolean $enable_send_metadata = false,
Pattern[/^\d+[ms]*$/] $flush_interval = '10s',
Integer[1] $flush_threshold = 1024
Enum['absent', 'present'] $ensure = present,
Optional[String] $host = undef,
Optional[Integer[1,65535] $port = undef,
Optional[String] $database = undef,
Optional[String] $username = undef,
Optional[String] $password = undef,
Optional[Boolean] $enable_ssl = undef,
Enum['none', 'puppet'] $pki = 'puppet',
Optional[Stdlib::Absolutepath] $ssl_key_path = undef,
Optional[Stdlib::Absolutepath] $ssl_cert_path = undef,
Optional[Stdlib::Absolutepath] $ssl_cacert_path = undef,
Optional[String] $ssl_key = undef,
Optional[String] $ssl_cert = undef,
Optional[String] $ssl_cacert = undef,
Optional[String] $host_measurement = undef,
Optional[Hash] $host_tags = undef,
Optional[String] $service_measurement = undef,
Optional[Hash] $service_tags = undef,
Optional[Boolean] $enable_send_thresholds = undef,
Optional[Boolean] $enable_send_metadata = undef,
Optional[Pattern[/^\d+[ms]*$/]] $flush_interval = undef,
Optional[Integer[1]] $flush_threshold = undef,
) {

if ! defined(Class['::icinga2']) {
Expand Down

0 comments on commit 37c284c

Please sign in to comment.